diff --git a/README.md b/README.md index abccf60..397fe03 100644 --- a/README.md +++ b/README.md @@ -143,8 +143,10 @@ optional `RefMods (Optional)` socket. Connect the `H3_REF_MODS` output from a RefMod loader or creator directly to that socket; the sampler clones the model and attaches the RefMod bridge only for that run. `RefMod Retention` and `RefMod Token Budget` are available beside the socket, while ordinary image -reference routing remains unchanged. The separate model bridge node is still -available for V3.8 and other samplers. +reference routing remains unchanged. The DUMAS V3.9 surface removes the +duplicated legacy resolution widgets and uses the connected `Width` and +`Height` values as its single manual-dimension source. The separate model +bridge node is still available for V3.8 and other samplers. ### DUMAS H3 RefMods to Continuum diff --git a/dumas_vendored_nodes.py b/dumas_vendored_nodes.py index 332881f..77244e3 100644 --- a/dumas_vendored_nodes.py +++ b/dumas_vendored_nodes.py @@ -106,7 +106,19 @@ def _add_direct_refmod_input(node_class): def INPUT_TYPES(cls): schema = original_input_types() schema = {name: dict(value) for name, value in schema.items()} + required = dict(schema.get("required", {})) + # V3.8 exposes both its newer resolution preset controls and the + # original aspect/size controls. The DUMAS V3.9 node is intentionally + # a clean manual-dimension node: width and height are the one source of + # truth and can be converted to linked inputs in ComfyUI. + for name in ("aspect", "preset", "custom_mp", "size_source"): + required.pop(name, None) + schema["required"] = required optional = dict(schema.get("optional", {})) + # The bundled audio reference socket supersedes the two legacy scalar + # audio inputs; exposing both makes it unclear which route is active. + for name in ("reference_audio_1", "reference_audio_vae"): + optional.pop(name, None) optional["refmods"] = ( "H3_REF_MODS", { @@ -145,6 +157,12 @@ def _add_direct_refmod_input(node_class): def run(self, refmods=None, refmod_retention=1.0, refmod_max_total_tokens=0, **kwargs): + # The clean DUMAS surface always uses the explicitly supplied width / + # height pair. Keep the upstream runtime's legacy arguments internal. + kwargs["size_source"] = "Manual" + kwargs.pop("aspect", None) + kwargs.pop("preset", None) + kwargs.pop("custom_mp", None) if refmods: model = kwargs.get("model") if model is None: diff --git a/tests/test_dumas_vendored_nodes.py b/tests/test_dumas_vendored_nodes.py index 5c21496..f85163f 100644 --- a/tests/test_dumas_vendored_nodes.py +++ b/tests/test_dumas_vendored_nodes.py @@ -24,7 +24,21 @@ class _ModernNode: class _SamplerBase: @classmethod def INPUT_TYPES(cls): - return {"required": {"model": ("MODEL",)}, "optional": {}} + return { + "required": { + "model": ("MODEL",), + "aspect": ("STRING",), + "preset": ("STRING",), + "custom_mp": ("FLOAT",), + "size_source": ("STRING",), + "width": ("INT",), + "height": ("INT",), + }, + "optional": { + "reference_audio_1": ("AUDIO",), + "reference_audio_vae": ("VAE",), + }, + } def run(self, **kwargs): return kwargs @@ -38,9 +52,22 @@ class VendoredNamespaceTests(unittest.TestCase): def test_v39_sampler_exposes_direct_refmod_socket(self): sampler = vendored._add_direct_refmod_input(_Sampler) inputs = sampler.INPUT_TYPES() + self.assertNotIn("aspect", inputs["required"]) + self.assertNotIn("preset", inputs["required"]) + self.assertNotIn("custom_mp", inputs["required"]) + self.assertNotIn("size_source", inputs["required"]) + self.assertIn("width", inputs["required"]) + self.assertIn("height", inputs["required"]) + self.assertNotIn("reference_audio_1", inputs["optional"]) + self.assertNotIn("reference_audio_vae", inputs["optional"]) self.assertEqual(inputs["optional"]["refmods"][0], "H3_REF_MODS") self.assertIn("refmod_retention", inputs["optional"]) self.assertIn("refmod_max_total_tokens", inputs["optional"]) + result = sampler().run( + model=object(), width=128, height=64, size_source="Legacy", + aspect="Auto", preset="Draft", custom_mp=0.3, + ) + self.assertEqual(result["size_source"], "Manual") def test_legacy_and_modern_nodes_get_distinct_dumas_identity(self): original_packages = vendored._PACKAGES