Added new Custom and ComfyTypeIO helpers, use ComfyTypeIO class to simplify defining basic types

This commit is contained in:
Jedrzej Kosinski
2025-06-17 04:47:55 -05:00
parent ef04c46ee3
commit 1711e44e99
2 changed files with 77 additions and 153 deletions

View File

@@ -11,6 +11,7 @@ class XYZ:
class Output(io.OutputV3):
...
class V3TestNode(io.ComfyNodeV3):
def __init__(self):
@@ -26,6 +27,8 @@ class V3TestNode(io.ComfyNodeV3):
inputs=[
io.Image.Input("image", display_name="new_image"),
XYZ.Input("xyz", optional=True),
io.Custom("JKL").Input("jkl", optional=True),
#JKL.Input("jkl", optional=True),
#CustomInput("xyz", "XYZ", optional=True),
io.Mask.Input("mask", optional=True),
io.Int.Input("some_int", display_name="new_name", min=0, max=127, default=42,
@@ -60,7 +63,7 @@ class V3TestNode(io.ComfyNodeV3):
)
@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):
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):
#some_int
if hasattr(cls, "hahajkunless"):
raise Exception("The 'cls' variable leaked instance state between runs!")