fix(nodes): inverted switch logic

This commit is contained in:
psychedelicious
2025-03-08 17:33:03 +10:00
parent 3b0f5ecd6b
commit 661625e8d7

View File

@@ -553,8 +553,10 @@ class AnyOutput(BaseInvocationOutput):
class SwitcherInvocation(BaseInvocation):
a: Any = InputField(description="The first input", ui_type=UIType.Any)
b: Any = InputField(description="The second input", ui_type=UIType.Any)
switch: bool = InputField(description="Switch between the two inputs")
switch: bool = InputField(
description="Switch between the two inputs. If false, the first input is returned. If true, the second input is returned."
)
def invoke(self, context: InvocationContext) -> AnyOutput:
value = self.a if self.switch else self.b
value = self.b if self.switch else self.a
return AnyOutput(value=value)