ComfyUI Node

Any Switch

Any Switch (SKBundle)

By SKBv0·Created 2 years ago·Updated 3 months ago· 125
Any Switch
  • input_1
  • input_2
  • input_3
  • input_4
  • input_5
  • image_output
  • text_output
  • int_output
select1

Any Switch is a manual, five-way router: plug up to five things into it, turn a dial from 1 to 5, and whatever's in that slot comes out the other side. No muting, no fancy graph logic - you pick a number and that's your active branch. If you've used rgthree's Any Switch (which does this by mute-state instead), this is the same idea with the training wheels left on, and for a lot of people that's exactly what they want.

Why you'd reach for it

You've got several possible values feeding into the same next step - three candidate prompts, two upscaled variants, a couple of different conditioning paths - and you want to pick one without physically rewiring the graph every time. The obvious way is a switch node. SKBundle's version skips the "which node is muted" indirection entirely: there's a select widget right on the node, you set it to a number, and that input becomes live. It's the version of a switch you can hand to someone who's never heard of ComfyUI's execution model and have them understand it in five seconds. It also happens to be the most-searched node in this whole pack by a wide margin - everything else here barely registers, but people are specifically looking for this one.

How it works

Five optional input slots (input_1 through input_5), each typed as a wildcard so you can plug in an image, a string, a number, whatever. The select widget (an integer, 1 to 5) tells the node which slot to read. Here's the part worth knowing before you wire it up: the outputs are not wildcard. There are exactly three of them - image_output, text_output, and int_output - each locked to its own type. So the node doesn't hand back "whatever you selected" on one generic socket; it hands back your value on whichever of the three typed outputs matches it, and the other two just sit there empty.

Practically, that means Any Switch is really scoped to switching between images, text, and integers - not truly anything. Feed it a LATENT or a MODEL in the slot you select, and there's no output socket built to carry it out.

Inputs and outputs

  • select (int, 1–5) - which input slot is active.
  • input_1…input_5 (any type, optional) - your candidate values. You don't need all five filled; just fill the ones you're switching between.
  • image_output / text_output / int_output - pick the one matching the type of whatever you selected, and wire from there.

Installing it

It ships as part of ComfyUI SKBundle, the personal node collection from u/skbphy (GitHub: SKBv0), who's been fairly open that they're not a programmer by trade - the pack was built with Cursor AI's help and grew out of nodes they needed for their own workflows, citing rgthree and mxToolkit as the inspiration. Install through ComfyUI Manager by searching ComfyUI SKBundle, or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/SKBv0/ComfyUI_SKBundle.git
pip install -r requirements.txt

Restart ComfyUI afterward. No model downloads involved - this is pure graph plumbing, same as the rest of the utility nodes in the pack.

Common issues

The one that trips people up is exactly the type mismatch above: you select an input, then reflexively wire from text_output because that's the socket closest to your mouse, and nothing shows up because your selected value was an image. Match the output socket to what you actually plugged into that slot.

The other thing to know is that unlike a mute-based switch, every connected input here still gets pulled into the execution graph when something downstream needs the node's output - Any Switch just picks which value to forward after the fact, it doesn't stop the unselected branches from running. If you're chaining something expensive (a whole second sampling pass, say) behind one of the unused slots, that cost still gets paid. For workflows where you genuinely want the unpicked branch to not execute at all, that's what rgthree's mute-based switches are for; this one optimizes for simplicity, not for skipping work.

Beyond that, it's about as low-maintenance as a custom node gets. No dependencies to fight, no version pinning to worry about - it's a small Python class reading a widget value.

CategorySKB

Inputs (6)

NameTypeDefaultDescription
selectINT11–5
input_1opt*
input_2opt*
input_3opt*
input_4opt*
input_5opt*

Outputs (3)

NameTypeDescription
image_outputIMAGE
text_outputSTRING
int_outputINT