mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-30 19:31:25 +00:00
Some node changes to compare v1 and v3
This commit is contained in:
@@ -1,35 +1,33 @@
|
||||
import torch
|
||||
|
||||
from comfy_api.v3.io import (
|
||||
ComfyNodeV3, SchemaV3, CustomType, CustomInput, CustomOutput, InputBehavior, NumberDisplay,
|
||||
IntegerInput, MaskInput, ImageInput, ComboInput, NodeOutput, FolderType, RemoteOptions
|
||||
ComfyNodeV3, SchemaV3, InputBehavior, NumberDisplay,
|
||||
IntegerInput, MaskInput, ImageInput, ComboInput, CustomInput,
|
||||
IntegerOutput, ImageOutput,
|
||||
NodeOutput,
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class V3TestNode(ComfyNodeV3):
|
||||
|
||||
|
||||
@classmethod
|
||||
def DEFINE_SCHEMA(cls):
|
||||
return SchemaV3(
|
||||
node_id="V3TestNode1",
|
||||
display_name="V3 Test Node (1djekjd)",
|
||||
display_name="V3 Test Node",
|
||||
description="This is a funky V3 node test.",
|
||||
category="v3 nodes",
|
||||
inputs=[
|
||||
IntegerInput("some_int", display_name="new_name", min=0, tooltip="My tooltip 😎", display_mode=NumberDisplay.slider),
|
||||
MaskInput("mask", behavior=InputBehavior.optional),
|
||||
ImageInput("image", display_name="new_image"),
|
||||
ComboInput("combo", image_upload=True, image_folder=FolderType.output,
|
||||
remote=RemoteOptions(
|
||||
route="/internal/files/output",
|
||||
refresh_button=True,
|
||||
),
|
||||
tooltip="This is a combo input"),
|
||||
# ComboInput("combo", options=["a", "b", "c"], tooltip="This is a combo input"),
|
||||
CustomInput("xyz", "XYZ"),
|
||||
MaskInput("mask", behavior=InputBehavior.optional),
|
||||
IntegerInput("some_int", display_name="new_name", min=0, max=127, default=42,
|
||||
tooltip="My tooltip 😎", display_mode=NumberDisplay.slider),
|
||||
ComboInput("combo", options=["a", "b", "c"], tooltip="This is a combo input"),
|
||||
# ComboInput("combo", image_upload=True, image_folder=FolderType.output,
|
||||
# remote=RemoteOptions(
|
||||
# route="/internal/files/output",
|
||||
# refresh_button=True,
|
||||
# ),
|
||||
# tooltip="This is a combo input"),
|
||||
# IntegerInput("some_int", display_name="new_name", min=0, tooltip="My tooltip 😎", display=NumberDisplay.slider, ),
|
||||
# ComboDynamicInput("mask", behavior=InputBehavior.optional),
|
||||
# IntegerInput("some_int", display_name="new_name", min=0, tooltip="My tooltip 😎", display=NumberDisplay.slider,
|
||||
@@ -41,23 +39,15 @@ class V3TestNode(ComfyNodeV3):
|
||||
# CombyDynamicOptons("option2", [])
|
||||
# ]]
|
||||
],
|
||||
outputs=[
|
||||
IntegerOutput("int_output"),
|
||||
ImageOutput("img_output", display_name="img🖼️", tooltip="This is an image"),
|
||||
],
|
||||
is_output_node=True,
|
||||
)
|
||||
|
||||
def execute(self, some_int: int, image: torch.Tensor, mask: torch.Tensor=None, **kwargs):
|
||||
a = NodeOutput(1)
|
||||
aa = NodeOutput(1, "hellothere")
|
||||
ab = NodeOutput(1, "hellothere", ui={"lol": "jk"})
|
||||
b = NodeOutput()
|
||||
c = NodeOutput(ui={"lol": "jk"})
|
||||
return NodeOutput()
|
||||
return NodeOutput(1)
|
||||
return NodeOutput(1, block_execution="Kill yourself")
|
||||
return ()
|
||||
|
||||
|
||||
|
||||
|
||||
def execute(image: torch.Tensor, xyz, some_int: int, combo: str, mask: torch.Tensor=None):
|
||||
return NodeOutput(some_int, image)
|
||||
|
||||
|
||||
NODES_LIST: list[ComfyNodeV3] = [
|
||||
|
||||
Reference in New Issue
Block a user