Nodes/Nifty Nodes for ComfyUI/Index Combo Switch
ComfyUI Node

Index Combo Switch

The switch you don't have to count to

By Stibo·Created 5 months ago·Updated 2 months ago· 9
Index Combo Switch
  • values
  • output
  • COMBO
  • STRING
  • index
choise
option1Option 1
option2Option 2
option3Option 3
option4Option 4
option5Option 5
option6Option 6
option7Option 7
option8Option 8
option9Option 9
option10Option 10
option11Option 11
option12Option 12
option13Option 13
option14Option 14
option15Option 15
option16Option 16

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 option1option16 labels, 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.

Categorynifty/logic

Inputs (18)

NameTypeDefaultDescription
choiseCOMBOWhich value input to pass through, the order matches. The first choise = value1, second choise = value2 etc.
valuesoptCOMFY_AUTOGROW_V3Auto-growing list of inputs. Only the selected index is evaluated (lazy).
option1optSTRINGOption 1
option2optSTRINGOption 2
option3optSTRINGOption 3
option4optSTRINGOption 4
option5optSTRINGOption 5
option6optSTRINGOption 6
option7optSTRINGOption 7
option8optSTRINGOption 8
option9optSTRINGOption 9
option10optSTRINGOption 10
option11optSTRINGOption 11
option12optSTRINGOption 12
option13optSTRINGOption 13
option14optSTRINGOption 14
option15optSTRINGOption 15
option16optSTRINGOption 16

Outputs (4)

NameTypeDescription
outputCOMFY_MATCHTYPE_V3
COMBOCOMBO
STRINGSTRING
indexINT