Switch Any (By Index)
Switch Any (By Index) explained
- v1
- v2
- v3
- v4
- v5
- v6
- v7
- v8
- v9
- v10
- value
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.v1…v10(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
v2is unconnected and index is 1, you get None - it won't silently fall through tov3. 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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| index | INT | 0 | — |
| v1opt | ANY | — | |
| v2opt | ANY | — | |
| v3opt | ANY | — | |
| v4opt | ANY | — | |
| v5opt | ANY | — | |
| v6opt | ANY | — | |
| v7opt | ANY | — | |
| v8opt | ANY | — | |
| v9opt | ANY | — | |
| v10opt | ANY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | ANY | — |