Introduce a new CharacterPrompts extension: adds node implementations (Character Create, Character Edit/Delete, Character Prompt Encode) with storage, resolver, and README. Adds persistent character library storage (default/ComfyUI-CharacterPrompts-MXD/characters.json), server route (/mxd/characters/list), and a web UI integration (mxd_character_prompts.js + import) to refresh/pick characters in the graph. Update root __init__ to register the new module. Also remove the Grow Blur Mask MXD node from maxedoutnodes, and bump package version to 1.9.0 in pyproject.toml.
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 (
|
|
"maxedoutnodes",
|
|
"mediacomparers",
|
|
"wan22nodes",
|
|
"loraloader_mxd",
|
|
"wan_svi_first_last_mxd",
|
|
"CharacterPrompts",
|
|
):
|
|
_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",
|
|
]
|