Nodes/ComfyUI_EmAySee_CustomNodes/EmAySee Nine Choice Selector
ComfyUI Node

EmAySee Nine Choice Selector

A nine-slot switch that hands you both the index and the label

By EmAySee·Created about a year ago·Updated 4 months ago· 2
EmAySee Nine Choice Selector
    • selected_int
    • selected_label
    selector1
    label_1Option 1
    label_2Option 2
    label_3Option 3
    label_4Option 4
    label_5Option 5
    label_6Option 6
    label_7Option 7
    label_8Option 8
    label_9Option 9

    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_int returns 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_1 through label_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.

    CategoryEmAySee/Utils

    Inputs (10)

    NameTypeDefaultDescription
    selectorINT11–9
    label_1STRINGOption 1
    label_2STRINGOption 2
    label_3STRINGOption 3
    label_4STRINGOption 4
    label_5STRINGOption 5
    label_6STRINGOption 6
    label_7STRINGOption 7
    label_8STRINGOption 8
    label_9STRINGOption 9

    Outputs (2)

    NameTypeDescription
    selected_intINT
    selected_labelSTRING