mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-28 00:36:32 +00:00
Fixed MultiCombo, confirmed VALIDATE_INPUTS, IS_CHANGED works
This commit is contained in:
parent
18a7207ca4
commit
a86fddcdd4
@ -433,7 +433,7 @@ class MultiCombo(ComfyType):
|
|||||||
|
|
||||||
def as_dict_V1(self):
|
def as_dict_V1(self):
|
||||||
to_return = super().as_dict_V1() | prune_dict({
|
to_return = super().as_dict_V1() | prune_dict({
|
||||||
"multiselect": self.multiselect,
|
"multi_select": self.multiselect,
|
||||||
"placeholder": self.placeholder,
|
"placeholder": self.placeholder,
|
||||||
"chip": self.chip,
|
"chip": self.chip,
|
||||||
})
|
})
|
||||||
|
@ -13,6 +13,7 @@ class TestNode(ComfyNodeABC):
|
|||||||
"min": 0, "max": 127, "default": 42,
|
"min": 0, "max": 127, "default": 42,
|
||||||
"tooltip": "My tooltip 😎", "display": "slider"}),
|
"tooltip": "My tooltip 😎", "display": "slider"}),
|
||||||
"combo": (IO.COMBO, {"options": ["a", "b", "c"], "tooltip": "This is a combo input"}),
|
"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": {
|
"optional": {
|
||||||
"xyz": ("XYZ",),
|
"xyz": ("XYZ",),
|
||||||
@ -29,7 +30,7 @@ class TestNode(ComfyNodeABC):
|
|||||||
|
|
||||||
CATEGORY = "v3 nodes"
|
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)
|
return (some_int, image)
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,6 +72,14 @@ class V3TestNode(io.ComfyNodeV3):
|
|||||||
is_output_node=True,
|
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
|
@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):
|
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
|
zzz = cls.hidden.prompt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user