From 67f366d734c2bdc688f085112dde4535b79c6c68 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Tue, 27 Jan 2026 19:41:03 -0800 Subject: [PATCH] Add node --- tools/devtools/dev_nodes.py | 2 + tools/devtools/nodes/__init__.py | 2 + tools/devtools/nodes/inputs.py | 88 ++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) diff --git a/tools/devtools/dev_nodes.py b/tools/devtools/dev_nodes.py index 660518d84..57ecf3117 100644 --- a/tools/devtools/dev_nodes.py +++ b/tools/devtools/dev_nodes.py @@ -22,6 +22,7 @@ from .nodes import ( NodeWithUnionInput, NodeWithValidation, NodeWithV2ComboInput, + NodeWithDynamicCombo, ObjectPatchNode, RemoteWidgetNode, RemoteWidgetNodeWithControlAfterRefresh, @@ -55,6 +56,7 @@ __all__ = [ "NodeWithUnionInput", "NodeWithValidation", "NodeWithV2ComboInput", + "NodeWithDynamicCombo", "ObjectPatchNode", "RemoteWidgetNode", "RemoteWidgetNodeWithControlAfterRefresh", diff --git a/tools/devtools/nodes/__init__.py b/tools/devtools/nodes/__init__.py index f0ac2d8ee..254e171d7 100644 --- a/tools/devtools/nodes/__init__.py +++ b/tools/devtools/nodes/__init__.py @@ -22,6 +22,7 @@ from .inputs import ( NodeWithUnionInput, NodeWithValidation, NodeWithV2ComboInput, + NodeWithDynamicCombo, SimpleSlider, NODE_CLASS_MAPPINGS as inputs_class_mappings, NODE_DISPLAY_NAME_MAPPINGS as inputs_display_name_mappings, @@ -81,6 +82,7 @@ __all__ = [ "NodeWithUnionInput", "NodeWithValidation", "NodeWithV2ComboInput", + "NodeWithDynamicCombo", "ObjectPatchNode", "RemoteWidgetNode", "RemoteWidgetNodeWithControlAfterRefresh", diff --git a/tools/devtools/nodes/inputs.py b/tools/devtools/nodes/inputs.py index ac31056ca..9bf6f32d7 100644 --- a/tools/devtools/nodes/inputs.py +++ b/tools/devtools/nodes/inputs.py @@ -303,6 +303,91 @@ class NodeWithV2ComboInput: return (combo_input,) +class NodeWithDynamicCombo: + """ + Test node with DynamicCombo that shows/hides widgets based on selection. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "first_widget": ( + "INT", + {}, + ), + "dynamic_combo": ( + "COMFY_DYNAMICCOMBO_V3", + { + "options": [ + { + "key": "none", + "inputs": {"required": {}}, + }, + { + "key": "one", + "inputs": { + "required": { + "w1": ( + "INT", + {}, + ), + } + }, + }, + { + "key": "two", + "inputs": { + "required": { + "w1": ( + "INT", + {}, + ), + "w2": ( + "INT", + {}, + ), + } + }, + }, + { + "key": "three", + "inputs": { + "required": { + "w1": ( + "INT", + {}, + ), + "w2": ( + "INT", + {}, + ), + "w3": ( + "INT", + {}, + ), + } + }, + }, + ], + }, + ), + "last_widget": ( + "INT", + {}, + ), + } + } + + RETURN_TYPES = ("INT",) + FUNCTION = "execute" + CATEGORY = "DevTools/Testing" + DESCRIPTION = "Test node for dynamic combo widget behavior" + + def execute(self, **kwargs): + print(kwargs) + return (1,) + NODE_CLASS_MAPPINGS = { "DevToolsLongComboDropdown": LongComboDropdown, "DevToolsNodeWithOptionalInput": NodeWithOptionalInput, @@ -318,6 +403,7 @@ NODE_CLASS_MAPPINGS = { "DevToolsNodeWithSeedInput": NodeWithSeedInput, "DevToolsNodeWithValidation": NodeWithValidation, "DevToolsNodeWithV2ComboInput": NodeWithV2ComboInput, + "DevToolsDynamicComboNode": NodeWithDynamicCombo, } NODE_DISPLAY_NAME_MAPPINGS = { @@ -335,6 +421,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { "DevToolsNodeWithSeedInput": "Node With Seed Input", "DevToolsNodeWithValidation": "Node With Validation", "DevToolsNodeWithV2ComboInput": "Node With V2 Combo Input", + "DevToolsDynamicComboNode": "Dynamic Combo Node", } __all__ = [ @@ -352,6 +439,7 @@ __all__ = [ "NodeWithSeedInput", "NodeWithValidation", "NodeWithV2ComboInput", + "NodeWithDynamicCombo", "NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", ]