Nodes/ComfyUI 1hewNodes/Any Switch Select
ComfyUI Node

Any Switch Select

One integer to route between ten workflow branches

By 1hew·Created about a year ago·Updated 7 days ago· 33
Any Switch Select
  • input_1
  • input_2
  • input_3
  • input_4
  • input_5
  • input_6
  • input_7
  • input_8
  • input_9
  • input_10
  • output
  • select
select1

ComfyUI workflows get big, and the way you keep them manageable is by not building ten separate graphs. Any Switch Select is the multiplexer: one select integer picks one of up to ten inputs and passes it through. Flip the integer, and a completely different subgraph feeds your next node - same wire, different data.

Where this shines over a manual rewire: lazy evaluation. Only the selected input branch actually runs. The other nine inputs are never computed. That's not a performance nicety - it's the difference between a switch that loads one model and a "switch" that loads ten and picks the result. In a world where "switch" nodes sometimes still compute everything, lazy selection is the reason to reach for this one.

How it works

  • select - integer, 1–10, maps to input_1 through input_10. Out-of-range values get clamped rather than erroring.
  • input_1…input_10 - any type (*), all optional.
  • output - the chosen input's value.
  • select (the output port) - the effective clamped value actually used for routing. Feed it downstream if you want to know what really got selected.

The type-agnostic * ports mean you can switch between images, models, prompts, conditioning - anything. The lazy check runs before execution: if the selected input isn't connected, you get None immediately instead of hanging the graph waiting for a dead branch.

Install

Part of ComfyUI-1hewNodes:

cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes

Restart ComfyUI. No models, no downloads.

Where it fits

The patterns that click with it:

  • Mode multiplexer - one select routes between "portrait / landscape / square" resize branches, or "fast / quality" samplers.
  • Model or LoRA picker - select between alternative resources without unloading anything.
  • Presence-based routing - combine with the pack's Any Empty Int to derive select from whether some earlier input exists, turning a manual switch into an automatic fallback.

Siblings worth knowing: Any Switch Bool is the two-way boolean version, and Multi Switch Select routes one input to multiple outputs. This one is the classic "pick one of N" case.

Common issues

  • Getting None out - select points at an input that isn't connected. Check the number on the select input matches a wired port.
  • Expecting all branches to run - they don't, and that's the feature. If you need everything computed (say, for side effects), this isn't the node.
  • Index confusion - it's 1-based. select=0 clamps to 1, not to a "none" option.

For the price of learning one integer input, you get to keep a multi-mode workflow in a single file instead of maintaining five copies. That's the real value.

Category1hewNodes/logic

Inputs (11)

NameTypeDefaultDescription
selectINT11–10
input_1opt*
input_2opt*
input_3opt*
input_4opt*
input_5opt*
input_6opt*
input_7opt*
input_8opt*
input_9opt*
input_10opt*

Outputs (2)

NameTypeDescription
output*
selectINT