diff --git a/comfy_extras/nodes_v3_test.py b/comfy_extras/nodes_v3_test.py new file mode 100644 index 000000000..d1c58471e --- /dev/null +++ b/comfy_extras/nodes_v3_test.py @@ -0,0 +1,50 @@ +import torch + +from comfy_api.v3.io import ( + ComfyNodeV3, SchemaV3, CustomType, CustomInput, CustomOutput, InputBehavior, NumberDisplay, + IntegerInput, MaskInput, ImageInput, +) + + + + + +class V3TestNode(ComfyNodeV3): + + + @classmethod + def DEFINE_SCHEMA(cls): + schema = SchemaV3( + node_id="V3TestNode1", + display_name="V3 Test Node (1djekjd)", + description="This is a funky V3 node test.", + category="v3 nodes", + inputs=[ + IntegerInput("some_int", display_name="new_name", min=0, tooltip="My tooltip 😎"), + MaskInput("mask", behavior=InputBehavior.optional), + ImageInput("image", display_name="new_image"), + ], + is_output_node=True, + ) + return schema + + def execute(self, some_int: int, image: torch.Tensor, mask: torch.Tensor=None, **kwargs): + return (None,) + + + + + + +NODES: list[ComfyNodeV3] = [ + V3TestNode, +] + + +NODE_CLASS_MAPPINGS = {} +NODE_DISPLAY_NAME_MAPPINGS = {} +for node in NODES: + schema = node.GET_SCHEMA() + NODE_CLASS_MAPPINGS[schema.node_id] = node + if schema.display_name: + NODE_DISPLAY_NAME_MAPPINGS[schema.node_id] = schema.display_name diff --git a/nodes.py b/nodes.py index 95e831b8b..369870265 100644 --- a/nodes.py +++ b/nodes.py @@ -2266,6 +2266,7 @@ def init_builtin_extra_nodes(): "nodes_ace.py", "nodes_string.py", "nodes_camera_trajectory.py", + "nodes_v3_test.py", ] import_failed = []