EmAySee Nine Choice Selector
A nine-slot switch that hands you both the index and the label
- selected_int
- selected_label
EmAySee Nine Choice Selector is a labeled switch: an integer selector from 1 to 9, nine string labels you type in, and two outputs - the selected index and the selected label. Pick a slot, get both the number and its name back. It's a "make your graph readable" node.
The workflow that wants this is any place you're choosing between a handful of named options that get consumed as numbers downstream. You've got nine LoRA setups, nine prompt variants, nine resolution presets, whatever - and instead of a bare integer that forces you to remember "slot 4 is the portrait preset," you label each slot and the node echoes the label back. Wire selected_int into whatever switches on the value, and feed selected_label to a text display or a prompt builder so you can see at a glance which option is live. It's the difference between debugging "why is slot 6 active" and "why is the 'night city' preset active."
The "nine" is arbitrary but practical - it's how many a solo author settled on, and the input count is fixed. You can't add a tenth slot, but you can leave unused labels empty.
How it works
The mechanism is a bounded index lookup: the selector value is clamped to 1–9, used to index the list of labels, and both the (clamped) index and the label are returned. Two details from the code:
- The selector is clamped, not error-checked. Type 0 or 12 and it'll pick slot 1 or 9 rather than crash - friendly, but it means an out-of-range value silently resolves to an edge instead of telling you something's wrong.
selected_intreturns the selector value you typed (after clamping), so it's the same number that chose the slot. It's a pass-through of your input, not a re-index.
The inputs that matter
Ten inputs, but really one plus labels:
selector- INT from 1 to 9, default 1. The switch.label_1throughlabel_9- STRINGs, defaults "Option 1" through "Option 9". Replace them with whatever each slot means to you. These are static text fields, not dynamic wires.
Outputs: selected_int (INT) and selected_label (STRING).
Installing it
Part of the EmAySee pack:
# ComfyUI Manager: search "ComfyUI_EmAySee_CustomNodes" and install
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
Restart ComfyUI. No requirements.txt - pure Python, nothing to pip install.
Common issues
The main trap is wiring the selected_int output into something that expects a zero-based index - this node is 1-based, so an Impact-style switch or a Python list consumer that wants 0–8 will be off by one. Adapt before feeding it. Also, because the labels are plain typed strings, they don't update from anywhere else in the graph - if you want a dynamic label, this isn't the node. And the silent clamping means a mistyped selector value will quietly pick an edge slot; if you're driving it from a slider that can wander past 9, add your own clamp upstream or accept the behavior.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| selector | INT | 11–9 | — |
| label_1 | STRING | Option 1 | — |
| label_2 | STRING | Option 2 | — |
| label_3 | STRING | Option 3 | — |
| label_4 | STRING | Option 4 | — |
| label_5 | STRING | Option 5 | — |
| label_6 | STRING | Option 6 | — |
| label_7 | STRING | Option 7 | — |
| label_8 | STRING | Option 8 | — |
| label_9 | STRING | Option 9 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| selected_int | INT | — |
| selected_label | STRING | — |