* docs: design ComfyUI-native BAGEL migration * docs: plan ComfyUI-native BAGEL migration * docs: align BAGEL migration with custom node layout * docs: define BAGEL test environment constraints * docs: split BAGEL nodes by responsibility * docs: retain flat custom node entrypoints * feat: add converted BAGEL runtime loader * feat: register native BAGEL ComfyUI nodes * docs: document native BAGEL workflows * fix: add custom node root to import path * fix: log skipped BAGEL model discovery entries * fix: prefer BAGEL model folder for native checkpoints * feat: add BAGEL sidecar metadata helper * fix: list BAGEL safetensors without metadata precheck * fix: preserve BAGEL extra model paths * fix: set Qwen token ids for BAGEL config fallback * fix: decouple default Qwen RoPE from transformers registry * feat: add streaming BAGEL metadata embedder * feat: add free Colab metadata release workflow * feat: describe BAGEL variant release metadata * feat: prepare remaining BAGEL metadata releases * fix: declare Echo-4o release as fp16 * fix: validate BAGEL latent image geometry * fix: align BAGEL edit workflow preprocessing * docs: add native BAGEL workflow figures * chore: prepare 1.1.0 release contents * docs: finalize release README and metadata validation * fix: restore native BAGEL parity and lifecycle * fix: align native controls with BAGEL app * fix: migrate native thinking workflow controls * docs: update native workflow examples * fix: mark legacy nodes as deprecated
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""ComfyUI node registration for BAGEL.
|
|
|
|
Native nodes are the default BAGEL nodes. Legacy all-in-one nodes remain
|
|
registered from ``nodes_deprecated.py`` with deprecated display names so older
|
|
workflows can still load.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import importlib
|
|
|
|
|
|
NODE_CLASS_MAPPINGS = {}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {}
|
|
|
|
NODE_MODULES = (
|
|
(".nodes_model_loading", "ModelLoading"),
|
|
(".nodes_generation", "Generation"),
|
|
(".nodes_editing", "Editing"),
|
|
(".nodes_understanding", "Understanding"),
|
|
(".nodes_deprecated", "Deprecated"),
|
|
)
|
|
|
|
|
|
def register_nodes(module_path: str, name: str) -> None:
|
|
module = importlib.import_module(module_path, package=__package__)
|
|
classes = getattr(module, "NODE_CLASS_MAPPINGS", {})
|
|
displays = getattr(module, "NODE_DISPLAY_NAME_MAPPINGS", {})
|
|
duplicates = NODE_CLASS_MAPPINGS.keys() & classes.keys()
|
|
if duplicates:
|
|
raise RuntimeError(f"Duplicate BAGEL node class types in {name}: {sorted(duplicates)}")
|
|
NODE_CLASS_MAPPINGS.update(classes)
|
|
NODE_DISPLAY_NAME_MAPPINGS.update(displays)
|
|
|
|
|
|
for _module_path, _name in NODE_MODULES:
|
|
register_nodes(_module_path, _name)
|
|
|
|
|
|
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|