Add video handling and prep utilities across nodes and UI. - mediacomparers.py: add MxdVideoComparer (saves previews, shows A/B videos) and import folder_paths/os/time; register the new node and display name. - wan22nodes.py: refactor WAN 2.2 scaling with _wan22_pick_bucket and _wan22_scale_image_core, add _select_frames_start_end, expose faster passthrough for scale(), add video prep nodes (WAN22_I2V_Video_Prep_MXD and advanced variant) that scale videos and return start/end/selected frames, improve CombineVideos_MXD audio handling to support multiple audio payload shapes and batching, and mark PreviewVideoMXD as an output node; register new nodes and display names. - Add new node file wan_svi_first_last_mxd.py: WAN 2.2 First/Last I2V SVI node that prepares SVI conditioning (anchors, padding, masks) and returns latent samples. - __init__.py: include wan_svi_first_last_mxd in dynamic imports so new node is discovered. - web/js/image_comparer.js: extend UI to support video/media (playback, sizing, URL builder, mixed image/video lists) and update widget rendering logic for media types. - pyproject.toml: bump package version to 1.8.1. These changes add end-to-end video support (preview, compare, prep for WAN 2.2 workflows), improve robustness of audio concatenation, and introduce an SVI-first/last conditioning node for WAN pipelines.
34 lines
955 B
Python
34 lines
955 B
Python
import importlib
|
|
|
|
WEB_DIRECTORY = "web"
|
|
|
|
def _safe_import(module_name: str):
|
|
try:
|
|
return importlib.import_module(f".{module_name}", __name__)
|
|
except Exception as e:
|
|
print(f"[ComfyUI-MaxedOut] Failed to import '{module_name}': {e}")
|
|
return None
|
|
|
|
def _get_mappings(mod):
|
|
if mod is None:
|
|
return {}, {}
|
|
class_map = getattr(mod, "NODE_CLASS_MAPPINGS", {}) or {}
|
|
display_map = getattr(mod, "NODE_DISPLAY_NAME_MAPPINGS", {}) or {}
|
|
return class_map, display_map
|
|
|
|
NODE_CLASS_MAPPINGS = {}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {}
|
|
|
|
for _name in ("maxedoutnodes", "mediacomparers", "wan22nodes", "loraloader_mxd", "wan_svi_first_last_mxd"):
|
|
_mod = _safe_import(_name)
|
|
_class_map, _display_map = _get_mappings(_mod)
|
|
NODE_CLASS_MAPPINGS.update(_class_map)
|
|
NODE_DISPLAY_NAME_MAPPINGS.update(_display_map)
|
|
|
|
__all__ = [
|
|
"NODE_CLASS_MAPPINGS",
|
|
"NODE_DISPLAY_NAME_MAPPINGS",
|
|
"WEB_DIRECTORY",
|
|
]
|
|
|