Index Combo Switch
The switch you don't have to count to
- values
- output
- COMBO
- STRING
- index
Every index router has the same flaw: you end up counting inputs to remember which one is number 4. Nifty Index Combo Switch fixes that by replacing the raw index with a named dropdown. You label each branch with a string, the dropdown (choise, yes - that's the author's spelling) is built from those labels at runtime, and you pick by name instead of by number.
Mechanically it's the Index Input Switch under the hood: the selected label maps to the matching input in the auto-growing values list - first dropdown option = value1, second = value2, and so on. And it's lazy: only the chosen branch evaluates, so the other fifteen never run.
The inputs that matter
- choise - the dropdown. Its options come from the
option1–option16labels, which are plain string inputs with defaults like "Option 1." - values - the auto-growing list of actual values to route. Connect one per label.
- option1 … option16 - the labels. Rename these to something meaningful ("SDXL", "Flux", "Qwen") and the dropdown reads like a menu.
Outputs: output (the routed value), plus three freebies - COMBO and STRING (the selected label, in two types) and index (the 0-based position of the selection). That index output is handy for driving other nodes; the string output is great for feeding a prompt or filename.
Why it's worth it
Two reasons this beats the raw-index version for most people. First, readability: you open a workflow six months later and a dropdown full of real names tells you instantly what the switch does, where "index = 4" tells you nothing. Second, it wires into preset-style workflows cleanly - pick a named workflow variant, and output routes the right model while string carries the name onward for logging or filenames.
The one thing to keep straight: the label list and the values list are separate. Add a value to values and you must give it a corresponding option label (or accept the default), or the dropdown won't line up. And because it's lazy, an unselected branch can't have side effects - for that, there's the eager twin, Index Combo Switch (Eager).
Install
Nifty Nodes, standard install: ComfyUI Manager → search "Nifty Nodes", or
cd ComfyUI/custom_nodes
git clone https://github.com/Stibo/comfyui-nifty-nodes
Restart ComfyUI, and keep ComfyUI current - the pack targets the v3 API. No extra dependencies. If you only install one switch from this pack, make it this one; the named dropdown is the difference between a workflow you debug and a workflow you just read.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| choise | COMBO | Which value input to pass through, the order matches. The first choise = value1, second choise = value2 etc. | |
| valuesopt | COMFY_AUTOGROW_V3 | Auto-growing list of inputs. Only the selected index is evaluated (lazy). | |
| option1opt | STRING | Option 1 | — |
| option2opt | STRING | Option 2 | — |
| option3opt | STRING | Option 3 | — |
| option4opt | STRING | Option 4 | — |
| option5opt | STRING | Option 5 | — |
| option6opt | STRING | Option 6 | — |
| option7opt | STRING | Option 7 | — |
| option8opt | STRING | Option 8 | — |
| option9opt | STRING | Option 9 | — |
| option10opt | STRING | Option 10 | — |
| option11opt | STRING | Option 11 | — |
| option12opt | STRING | Option 12 | — |
| option13opt | STRING | Option 13 | — |
| option14opt | STRING | Option 14 | — |
| option15opt | STRING | Option 15 | — |
| option16opt | STRING | Option 16 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| output | COMFY_MATCHTYPE_V3 | — |
| COMBO | COMBO | — |
| STRING | STRING | — |
| index | INT | — |