Temporarily adding nodes_v3_test.py file to comfy_extras for testing/sharing purposes

This commit is contained in:
Jedrzej Kosinski 2025-05-28 21:35:14 -07:00
parent 96c2e3856d
commit 5f0e04e2d7
2 changed files with 51 additions and 0 deletions

View File

@ -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

View File

@ -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 = []