mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-26 17:39:15 +00:00
add hidden index input from frontend and output it
add support for custom hidden fields
This commit is contained in:
@@ -104,7 +104,11 @@ class CustomComboNode(io.ComfyNode):
|
||||
category="utils",
|
||||
is_experimental=True,
|
||||
inputs=[io.Combo.Input("choice", options=[])],
|
||||
outputs=[io.String.Output()]
|
||||
outputs=[
|
||||
io.String.Output(display_name="STRING"),
|
||||
io.Int.Output(display_name="INDEX"),
|
||||
],
|
||||
hidden=["index"],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -115,8 +119,8 @@ class CustomComboNode(io.ComfyNode):
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def execute(cls, choice: io.Combo.Type) -> io.NodeOutput:
|
||||
return io.NodeOutput(choice)
|
||||
def execute(cls, choice: io.Combo.Type, index: int = 0) -> io.NodeOutput:
|
||||
return io.NodeOutput(choice, index)
|
||||
|
||||
|
||||
class DCTestNode(io.ComfyNode):
|
||||
|
||||
Reference in New Issue
Block a user