Nodes/Kinburg-Nodes/Any Switch
ComfyUI Node

Any Switch

Pick one of twenty inputs, of any type

By Kinburg·Created 3 months ago·Updated 6 days ago· 1
Any Switch
  • input_1
  • input_2
  • output
  • selected
select1

A switch is one of those plumbing nodes you don't think about until you need it, and then you need it constantly. Any Switch routes one of several inputs through to a single output, and the routing is done by an integer - not by you rewiring the graph. Keep two model loaders, two prompt branches, or two VAE chains in one workflow and flip between them with a single number. It accepts any type - * wildcard sockets - so it'll happily route a MODEL, a LATENT, an IMAGE, or a plain string without you setting anything.

The mechanism is dead simple, and the README-adjacent docs are honest about the one thing people misunderstand: it's not a lazy gate. ComfyUI still computes every branch feeding the switch; the node just passes the selected one through. If you're using it to skip an expensive branch (say, a heavy second sampler you only sometimes want), you're not saving the compute - you'd need bypass or group control for that. What you are buying is a single knob that switches a whole pipeline segment, which is exactly the right tool when both branches are cheap enough to run anyway.

The inputs that matter:

  • select - 1-based index of the input to pass through. Clamped to the number of connected inputs, so setting it to 10 when you've only wired three won't error, it just picks the last one.
  • input_1 / input_2 … - auto-growing wildcard slots. The node shows only the ones you've connected plus one spare, so a two-way switch looks like two inputs and a twenty-way switch looks like twenty.

Outputs are output (the routed value, same type as what went in) and selected (the index that was actually chosen - clamped, so you can read back what happened). That second output is quietly useful: wire selected into a text node or a filename and your workflow can label which variant it just produced.

Installing

Ships in Kinburg-Nodes. ComfyUI Manager → search "Kinburg-Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Kinburg/Kinburg-Nodes
# restart ComfyUI

Pure utility - no dependencies beyond what ComfyUI already ships.

Notes from the field

If you're coming from rgthree, note the difference: rgthree's Any Switch is a first-non-null fallback (it walks its inputs and passes the first connected one, no selector). This one is an A/B shape - you choose. Both are legit, they just solve different problems: fallback picks automatically when the graph decides, this one picks when you decide. For the classic "two loaders, one sampler, flip between them" pattern, this is the one you want. And a tip from the plumbing docs: because the other branches still compute, using a switch to hide an expensive branch is how workflows get mysteriously slow - if that's your goal, a group mute is the tool, not a switch.

CategoryKinburg-Nodes/util

Inputs (3)

NameTypeDefaultDescription
selectINT11–20Which connected input to pass through (1-based). Clamped to the number of connected inputs.
input_1opt*
input_2opt*

Outputs (2)

NameTypeDescription
output*
selectedINT