Split the three monoliths into nodes/ domain modules:
- maxedoutnodes.py -> nodes/{latents,resolution,prompts,masks,media_io}.py
- wan22nodes.py -> nodes/wan22/{buckets,latent_io,i2v,video_ops}.py
- ltxnodes.py -> nodes/ltx/{latents,samplers,preview}.py
(LTX_Image_Scaler_MXD moved from the Wan file to nodes/ltx/latents.py)
- mediacomparers.py -> nodes/comparers.py
- checkpoint_loader_mxd.py + save_checkpoint_mxd.py -> nodes/checkpoints.py
- combine_materials_ffgo_mxd.py -> nodes/ffgo.py
- video_preview_mxd.py -> system/live_preview.py
- model_paths_autoregister_mxd.py -> system/model_paths.py
(model_storage_config.json still resolved at repo root)
All node mapping keys, display names, categories, inputs, routes, and
events unchanged: scripts/dump_node_schema.py --compare reports 68 nodes
identical to the pre-refactor baseline.
Provably-dead code dropped during the move (verified unreachable):
- _add_mxd_aliases() no-op alias pass (every key already contains MXD)
- unreachable code after return in WAN22_I2V_Image_Scaler_MXD.scale and
Frames_Select_StartEnd_MXD.main, plus the orphaned _pick_bucket method
- unused BUCKETS_480/BUCKETS_720 module constants
- mediacomparers' unused WEB_DIRECTORY/__all__ declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40 lines
998 B
Python
40 lines
998 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 (
|
|
"nodes",
|
|
"loraloader_mxd",
|
|
"CharacterPrompts",
|
|
"smart_loaders_mxd",
|
|
"system.live_preview",
|
|
"system.model_paths",
|
|
):
|
|
_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",
|
|
]
|