Expose upstream RefMod creator in DUMAS

This commit is contained in:
2026-10-20 13:39:54 +00:00
parent e747945ba5
commit 70c3e0b472
3 changed files with 59 additions and 0 deletions
+30
View File
@@ -85,6 +85,34 @@ def _continuum_reference_bundle_type():
)
def _upstream_refmod_creator_type():
"""Find the maintained creator already loaded by ComfyUI."""
for module in list(sys.modules.values()):
creator = getattr(module, "MiniMaxH3RefModExtract", None) if module is not None else None
if creator is not None and hasattr(creator, "define_schema") and hasattr(creator, "execute"):
return creator
raise RuntimeError(
"DUMAS H3 RefMod Create requires the maintained "
"ComfyUI-MiniMaxH3Mod pack to be installed and loaded."
)
class DumasH3RefModCreate:
"""DUMAS-labelled compatibility entry for the maintained RefMod creator.
The extraction implementation remains upstream-owned so improvements to
modes, masks, folder bundles, and token budgeting are not forked here.
"""
@classmethod
def define_schema(cls):
return _upstream_refmod_creator_type().define_schema()
@classmethod
def execute(cls, *args, **kwargs):
return _upstream_refmod_creator_type().execute(*args, **kwargs)
def _decode_refmod_image(video_vae, mod):
if torch is None:
raise RuntimeError("DUMAS RefMod-to-Continuum requires PyTorch/ComfyUI.")
@@ -315,11 +343,13 @@ class DumasH3RefModsToContinuum:
NODE_CLASS_MAPPINGS = {
"DumasH3RefModCreate": DumasH3RefModCreate,
"DumasH3RefModSave": DumasH3RefModSave,
"DumasH3RefModsToContinuum": DumasH3RefModsToContinuum,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"DumasH3RefModCreate": "DUMAS H3 RefMod Create (upstream)",
"DumasH3RefModSave": "DUMAS H3 RefMod Save",
"DumasH3RefModsToContinuum": "DUMAS H3 RefMods to Continuum",
}