Fixed MultiCombo, confirmed VALIDATE_INPUTS, IS_CHANGED works

This commit is contained in:
kosinkadink1@gmail.com 2025-07-09 00:26:15 -05:00
parent 18a7207ca4
commit a86fddcdd4
3 changed files with 11 additions and 2 deletions

View File

@ -433,7 +433,7 @@ class MultiCombo(ComfyType):
def as_dict_V1(self):
to_return = super().as_dict_V1() | prune_dict({
"multiselect": self.multiselect,
"multi_select": self.multiselect,
"placeholder": self.placeholder,
"chip": self.chip,
})

View File

@ -13,6 +13,7 @@ class TestNode(ComfyNodeABC):
"min": 0, "max": 127, "default": 42,
"tooltip": "My tooltip 😎", "display": "slider"}),
"combo": (IO.COMBO, {"options": ["a", "b", "c"], "tooltip": "This is a combo input"}),
"combo2": (IO.COMBO, {"options": ["a", "b", "c"], "multi_select": True, "tooltip": "This is a combo input"}),
},
"optional": {
"xyz": ("XYZ",),
@ -29,7 +30,7 @@ class TestNode(ComfyNodeABC):
CATEGORY = "v3 nodes"
def do_thing(self, image: torch.Tensor, some_int: int, combo: str, xyz=None, mask: torch.Tensor=None):
def do_thing(self, image: torch.Tensor, some_int: int, combo: str, combo2: list[str], xyz=None, mask: torch.Tensor=None):
return (some_int, image)

View File

@ -72,6 +72,14 @@ class V3TestNode(io.ComfyNodeV3):
is_output_node=True,
)
@classmethod
def VALIDATE_INPUTS(cls, image: io.Image.Type, some_int: int, combo: io.Combo.Type, combo2: io.MultiCombo.Type, xyz: XYZ.Type=None, mask: io.Mask.Type=None, **kwargs):
if some_int < 0:
raise Exception("some_int must be greater than 0")
if combo == "c":
raise Exception("combo must be a or b")
return True
@classmethod
def execute(cls, image: io.Image.Type, some_int: int, combo: io.Combo.Type, combo2: io.MultiCombo.Type, xyz: XYZ.Type=None, mask: io.Mask.Type=None, **kwargs):
zzz = cls.hidden.prompt