Use vendored RefMod creator implementation
This commit is contained in:
@@ -117,14 +117,6 @@ roots for the current ComfyUI process so the DUMAS picker can discover them.
|
|||||||
For persistence across restarts, add the folder to ComfyUI's `refmods` mapping
|
For persistence across restarts, add the folder to ComfyUI's `refmods` mapping
|
||||||
in `extra_model_paths.yaml`.
|
in `extra_model_paths.yaml`.
|
||||||
|
|
||||||
### DUMAS H3 RefMod Create
|
|
||||||
|
|
||||||
`DUMAS H3 RefMod Create (upstream)` is a DUMAS-labelled compatibility entry
|
|
||||||
for the maintained `ComfyUI-MiniMaxH3Mod` creator. It delegates to that pack's
|
|
||||||
current implementation, so new extraction modes, masks, folder bundles, and
|
|
||||||
token-budget improvements remain available without creating a stale DUMAS fork.
|
|
||||||
The maintained MiniMax H3 RefMod pack must still be installed and loaded.
|
|
||||||
|
|
||||||
### DUMAS H3 RefMod Visual Picker
|
### DUMAS H3 RefMod Visual Picker
|
||||||
|
|
||||||
`DUMAS H3 RefMod Visual Picker` provides a small browser button for selecting
|
`DUMAS H3 RefMod Visual Picker` provides a small browser button for selecting
|
||||||
|
|||||||
@@ -85,34 +85,6 @@ 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):
|
def _decode_refmod_image(video_vae, mod):
|
||||||
if torch is None:
|
if torch is None:
|
||||||
raise RuntimeError("DUMAS RefMod-to-Continuum requires PyTorch/ComfyUI.")
|
raise RuntimeError("DUMAS RefMod-to-Continuum requires PyTorch/ComfyUI.")
|
||||||
@@ -343,13 +315,11 @@ class DumasH3RefModsToContinuum:
|
|||||||
|
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"DumasH3RefModCreate": DumasH3RefModCreate,
|
|
||||||
"DumasH3RefModSave": DumasH3RefModSave,
|
"DumasH3RefModSave": DumasH3RefModSave,
|
||||||
"DumasH3RefModsToContinuum": DumasH3RefModsToContinuum,
|
"DumasH3RefModsToContinuum": DumasH3RefModsToContinuum,
|
||||||
}
|
}
|
||||||
|
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||||
"DumasH3RefModCreate": "DUMAS H3 RefMod Create (upstream)",
|
|
||||||
"DumasH3RefModSave": "DUMAS H3 RefMod Save",
|
"DumasH3RefModSave": "DUMAS H3 RefMod Save",
|
||||||
"DumasH3RefModsToContinuum": "DUMAS H3 RefMods to Continuum",
|
"DumasH3RefModsToContinuum": "DUMAS H3 RefMods to Continuum",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,27 +78,6 @@ class DumasRefModSaveTests(unittest.TestCase):
|
|||||||
with self.assertRaisesRegex(ValueError, "input_folder"):
|
with self.assertRaisesRegex(ValueError, "input_folder"):
|
||||||
node.save([ (FakeMod("hero"), 1.0) ], save_location="Input folder")
|
node.save([ (FakeMod("hero"), 1.0) ], save_location="Input folder")
|
||||||
|
|
||||||
def test_creator_entry_delegates_to_loaded_upstream_class(self):
|
|
||||||
upstream = types.ModuleType("fake_minimax_refmod_nodes")
|
|
||||||
|
|
||||||
class Creator:
|
|
||||||
@classmethod
|
|
||||||
def define_schema(cls):
|
|
||||||
return "schema"
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def execute(cls, *args, **kwargs):
|
|
||||||
return (args, kwargs)
|
|
||||||
|
|
||||||
upstream.MiniMaxH3RefModExtract = Creator
|
|
||||||
sys.modules[upstream.__name__] = upstream
|
|
||||||
try:
|
|
||||||
node = self.module.DumasH3RefModCreate
|
|
||||||
self.assertEqual(node.define_schema(), "schema")
|
|
||||||
self.assertEqual(node.execute("x", name="hero")[1]["name"], "hero")
|
|
||||||
finally:
|
|
||||||
sys.modules.pop(upstream.__name__, None)
|
|
||||||
|
|
||||||
@unittest.skipUnless(torch is not None, "PyTorch is only available in the ComfyUI runtime")
|
@unittest.skipUnless(torch is not None, "PyTorch is only available in the ComfyUI runtime")
|
||||||
def test_refmods_to_continuum_decodes_and_routes_prompt_tags(self):
|
def test_refmods_to_continuum_decodes_and_routes_prompt_tags(self):
|
||||||
bundle_module = types.SimpleNamespace(
|
bundle_module = types.SimpleNamespace(
|
||||||
|
|||||||
Reference in New Issue
Block a user