Nodes/Vantage-Nodes/Switch Any (By Index)
ComfyUI Node

Switch Any (By Index)

Switch Any (By Index) explained

By vantagewithai·Created 8 months ago·Updated about a month ago· 25
Switch Any (By Index)
  • v1
  • v2
  • v3
  • v4
  • v5
  • v6
  • v7
  • v8
  • v9
  • v10
  • value
index0

Switch Any (By Index) is the ComfyUI equivalent of a radio button you can drive from anywhere in the graph. You feed it up to ten values and an integer, and it hands back whichever one the number points at. If you've ever rebuilt a workflow five times just to swap which checkpoint, prompt, or image a branch uses, this is the node that stops the rewiring.

It's the precise sibling of the same pack's "Switch Any." That one returns the first input that isn't None - a fallback selector. This one is exact: index 0 returns v1, index 1 returns v2, and so on. Because every input is typed ANY, the node carries almost anything - MODEL, CLIP, CONDITIONING, IMAGE, LATENT, STRING, whatever you throw at it. That's what makes it a genuinely general control node rather than another image-specific switch.

How it works

The run() method builds a tuple of your ten inputs and returns values[index] when 0 <= index < 10. Anything else returns None. No clamping, no wrapping around - an out-of-range index is a None, full stop. That's the one behavior worth engraving.

Inputs that matter:

  • index (INT, default 0) - the only required input. Drive it from a batch counter, a stepper, a seed, or just type it in the UI.
  • v1v10 (ANY, optional) - your options.

Output: value (ANY).

Where you'd actually use it

Pair index with the pack's StringListStepper or IndexWrap and you get per-frame switching in AnimateDiff or video work: prompt A for the first half of a clip, prompt B for the second. Or leave it as a UI integer and use it as a manual selector for which LoRA variant or conditioning branch to run, without touching a single wire. It's the same "route any type through one wire" idea the whole utility-pack ecosystem leans on - done with fewer moving parts than a typed switch per data type.

Gotchas

  • It's zero-based. Index 2 selects v3. Off-by-one here is the number-one failure mode.
  • None propagates. An unconnected or out-of-range slot flows None downstream, and most nodes error on a None input. Wire it into nodes that tolerate optional inputs, or gate the result with a Conditional Pass Through from the same pack.
  • It does not skip Nones. If v2 is unconnected and index is 1, you get None - it won't silently fall through to v3. That's Switch Any's fallback job, not this node's.

Installation

Vantage Nodes installs like any custom node pack. Either use ComfyUI Manager and search for "Vantage Nodes," or:

cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-Nodes.git
pip install -r requirements.txt

Restart ComfyUI afterwards. The pack's requirements.txt is heavy (librosa, soundfile, onnxruntime and friends) because it also ships GGUF and Qwen TTS tooling - plain utility nodes like this one don't need any of it at runtime, but the install pulls it all anyway.

Troubleshooting

  • Output is None: check the index is in range (valid values are 0–9 for ten inputs) and that the selected slot is actually connected.
  • Node missing from the menu: restart after install, and make sure your ComfyUI is recent - the pack targets current versions.
CategoryVantage/Control

Inputs (11)

NameTypeDefaultDescription
indexINT0
v1optANY
v2optANY
v3optANY
v4optANY
v5optANY
v6optANY
v7optANY
v8optANY
v9optANY
v10optANY

Outputs (1)

NameTypeDescription
valueANY