Skip to content

Commit 6630cd8

Browse files
committed
Figured out Switch situation
1 parent 85a97cc commit 6630cd8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

comfy_api/latest/_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ def result(self):
18381838
return self.args if len(self.args) > 0 else None
18391839

18401840
@classmethod
1841-
def from_dict(cls, data: dict[str, Any]) -> "NodeOutput":
1841+
def from_dict(cls, data: dict[str, Any]) -> NodeOutput:
18421842
args = ()
18431843
ui = None
18441844
expand = None

comfy_extras/nodes_logic.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
MISSING = object()
88

99

10-
class SwitchNode(io.ComfyNode):
10+
class SoftSwitchNode(io.ComfyNode):
1111
@classmethod
1212
def define_schema(cls):
1313
template = io.MatchType.Template("switch")
1414
return io.Schema(
15-
node_id="ComfySwitchNode",
16-
display_name="Switch",
15+
node_id="ComfySoftSwitchNode",
16+
display_name="Soft Switch",
1717
category="logic",
1818
is_experimental=True,
1919
inputs=[
@@ -58,14 +58,15 @@ def execute(cls, switch, on_true=MISSING, on_false=MISSING) -> io.NodeOutput:
5858
return io.NodeOutput(on_true)
5959
return io.NodeOutput(on_true if switch else on_false)
6060

61-
class SwitchNode2(io.ComfyNode):
61+
class SwitchNode(io.ComfyNode):
6262
@classmethod
6363
def define_schema(cls):
6464
template = io.MatchType.Template("switch")
6565
return io.Schema(
66-
node_id="ComfySwitchNode2",
67-
display_name="Switch2",
66+
node_id="ComfySwitchNode",
67+
display_name="Switch",
6868
category="logic",
69+
is_experimental=True,
6970
inputs=[
7071
io.Boolean.Input("switch"),
7172
io.MatchType.Input("on_false", template=template, lazy=True),
@@ -214,7 +215,7 @@ class LogicExtension(ComfyExtension):
214215
async def get_node_list(self) -> list[type[io.ComfyNode]]:
215216
return [
216217
SwitchNode,
217-
SwitchNode2,
218+
SoftSwitchNode,
218219
CustomComboNode,
219220
DCTestNode,
220221
AutogrowNamesTestNode,

0 commit comments

Comments
 (0)