mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-22 12:30:50 +08:00
Add (and leave commented out) some potential logic nodes
This commit is contained in:
parent
37e94ed583
commit
322e3d01ec
@ -129,6 +129,10 @@ class CustomComboNode(io.ComfyNode):
|
|||||||
outputs=[io.String.Output()]
|
outputs=[io.String.Output()]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def validate_inputs(cls, choice: io.Combo.Type) -> bool:
|
||||||
|
return True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def execute(cls, choice: io.Combo.Type) -> io.NodeOutput:
|
def execute(cls, choice: io.Combo.Type) -> io.NodeOutput:
|
||||||
return io.NodeOutput(choice)
|
return io.NodeOutput(choice)
|
||||||
@ -234,6 +238,21 @@ class ComboOutputTestNode(io.ComfyNode):
|
|||||||
def execute(cls, combo: io.Combo.Type, combo2: io.Combo.Type) -> io.NodeOutput:
|
def execute(cls, combo: io.Combo.Type, combo2: io.Combo.Type) -> io.NodeOutput:
|
||||||
return io.NodeOutput(combo, combo2)
|
return io.NodeOutput(combo, combo2)
|
||||||
|
|
||||||
|
class ConvertStringToComboNode(io.ComfyNode):
|
||||||
|
@classmethod
|
||||||
|
def define_schema(cls):
|
||||||
|
return io.Schema(
|
||||||
|
node_id="ConvertStringToComboNode",
|
||||||
|
display_name="Convert String to Combo",
|
||||||
|
category="logic",
|
||||||
|
inputs=[io.String.Input("string")],
|
||||||
|
outputs=[io.Combo.Output()],
|
||||||
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def execute(cls, string: str) -> io.NodeOutput:
|
||||||
|
return io.NodeOutput(string)
|
||||||
|
|
||||||
class AnyTypeTestNode(io.ComfyNode):
|
class AnyTypeTestNode(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
@ -249,6 +268,21 @@ class AnyTypeTestNode(io.ComfyNode):
|
|||||||
def execute(cls, any: io.AnyType.Type) -> io.NodeOutput:
|
def execute(cls, any: io.AnyType.Type) -> io.NodeOutput:
|
||||||
return io.NodeOutput(any)
|
return io.NodeOutput(any)
|
||||||
|
|
||||||
|
class InvertBooleanNode(io.ComfyNode):
|
||||||
|
@classmethod
|
||||||
|
def define_schema(cls):
|
||||||
|
return io.Schema(
|
||||||
|
node_id="InvertBooleanNode",
|
||||||
|
display_name="Invert Boolean",
|
||||||
|
category="logic",
|
||||||
|
inputs=[io.Boolean.Input("boolean")],
|
||||||
|
outputs=[io.Boolean.Output()],
|
||||||
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def execute(cls, boolean: bool) -> io.NodeOutput:
|
||||||
|
return io.NodeOutput(not boolean)
|
||||||
|
|
||||||
class LogicExtension(ComfyExtension):
|
class LogicExtension(ComfyExtension):
|
||||||
@override
|
@override
|
||||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||||
@ -256,10 +290,12 @@ class LogicExtension(ComfyExtension):
|
|||||||
SwitchNode,
|
SwitchNode,
|
||||||
# SoftSwitchNode,
|
# SoftSwitchNode,
|
||||||
# CustomComboNode,
|
# CustomComboNode,
|
||||||
|
# ConvertStringToComboNode,
|
||||||
# DCTestNode,
|
# DCTestNode,
|
||||||
# AutogrowNamesTestNode,
|
# AutogrowNamesTestNode,
|
||||||
# AutogrowPrefixTestNode,
|
# AutogrowPrefixTestNode,
|
||||||
# ComboOutputTestNode,
|
# ComboOutputTestNode,
|
||||||
|
# InvertBooleanNode,
|
||||||
# MatchTypeTestNode,
|
# MatchTypeTestNode,
|
||||||
# AnyTypeTestNode,
|
# AnyTypeTestNode,
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user