Nodes/WAS Node Suite v3/Any Input Switch
ComfyUI Node Runs on cloud

Any Input Switch

The boring A/B valve that handles any type

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Any Input Switch
  • input_a
  • input_b
  • output
booleantrue

Some nodes deserve a whole essay. This one deserves a sentence: it's a two-position valve that passes one of two inputs, chosen by a boolean, and it doesn't care what type those inputs are. If that sounds like the least interesting node in the pack, you've never had to keep two loaders in one workflow and flip between them by editing wires.

Any Input Switch sits under WAS Suite/Logic/Switch. The three inputs are input_a, input_b, and the boolean that chooses - true sends input_a through, false sends input_b. One output carries the winner. That's the whole interface, and the reason it's worth installing is what happens behind it: the unselected input is not evaluated. Flip the boolean to false and everything upstream of input_a is skipped. So you can park two full branches - two different checkpoints, two LoRA stacks, two entirely different image pipelines - behind the two sockets and pay for only the one you selected on each run.

The typing rule that trips people once

The node is untyped until you connect it. The first wire fixes the type: connect a MODEL to input_a and the whole node narrows to MODEL, which means input_b must then also carry a model. If you try to wire an IMAGE into input_b after input_a is a model, ComfyUI will refuse the connection - that's the type system doing its job, not a bug. Connect a model and an image to the same A/B switch and you get a type error, because the node genuinely can't output "a model or an image." This is the difference between WAS's typed-at-first-connection approach and the truly type-erasing "anything anywhere" style of node, and honestly the typing is the feature: it catches your own wiring mistakes at connect time instead of at queue time.

When you'll actually reach for it

  • Two checkpoints, one workflow. Wire both into A and B, drive boolean from a widget, a Compare, or anything upstream, and your "test the new model against the old one" workflow becomes a one-click toggle.
  • A/B testing a branch. Same graph, two variations, flip the boolean to choose which runs. Since only the chosen side evaluates, you're not wasting VRAM warming the loser.
  • Driving it from a test result. Compare Any → boolean → switch gives you an if/else: if a condition holds do the A path, otherwise the B path. It's the compositional core that the fancier Condition Chain nodes build on.

The honest limits

Two inputs only. If your branching is "one of three or more," this isn't the node - that's the job of the Index Switch (index-driven, many inputs) or the First Connected switch (fallback by connectivity), both of which ship in the same menu. And like every switch, it routes; if the false case should mean "do nothing at all," you want Any Gate, which blocks a branch outright rather than rerouting it.

Installing

Part of WAS Node Suite v3 (WASasquatch/was-node-suite-comfyui), WASasquatch's MIT pack, going since 2023 and over a million downloads in. This node is pure plumbing with zero dependencies - no pip install, no model weights. It needs ComfyUI 0.14.0+, since v3 is written against ComfyUI's newer node authoring API.

Install via ComfyUI Manager by searching WAS Node Suite v3, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

Restart ComfyUI afterwards. If the node is missing from the menu after a clean install, check your ComfyUI version first - this pack simply won't register its nodes on anything older than 0.14.0.

CategoryWAS Suite/Logic/Switch

Inputs (3)

NameTypeDefaultDescription
input_aCOMFY_MATCHTYPE_V3Passed on when boolean is true. Any type. The first connection fixes the type; input_b and output then take that type only.
input_bCOMFY_MATCHTYPE_V3Passed on when boolean is false. Must match input_a's type.
booleanBOOLEANtrueSelects the input. true = input_a, false = input_b.

Outputs (1)

NameTypeDescription
outputCOMFY_MATCHTYPE_V3The selected input, typed to whatever was connected.