Text Index Switch 3
Prompt slots that label themselves
- text
- label
- index
The AUN pack ships four text index switches, and the numbers aren't versions - they're personalities. Text Index Switch 3 is the one that treats prompt slots as little labeled cards: it gives you an index output, a label output, and a clever text-slot convention where the first line of a slot doubles as its name. If you've ever stared at "Slot 1" and forgotten which prompt that was, this node was written for you.
What it does
Like the others, it selects one of up to 20 text slots by index and outputs the chosen text. The difference is in the label behavior, and it's genuinely neat:
- If a node is connected to the input, the label is that connected node's title.
- If no node is connected, the label is the first line of the text input - and that first line is stripped out of the text output.
So you type cinematic bokeh\nA portrait in a rainy alley, warm neon into a slot. The label reads "cinematic bokeh," and the actual prompt sent to CLIP is just "A portrait in a rainy alley, warm neon." The first line becomes the name, free of charge, no extra node needed. That single convention is why this is the one I reach for when I'm building multi-prompt workflows by hand.
Inputs and outputs
index- selects which slot, 1–20.slot_count- how many slots are visible/active. Unlike the "visible_inputs" of the V1 switch, this actually bounds which slots are considered - the node builds its text list from slots1..slot_count.text1–text20- the slots, multiline. Defaults say "Slot 1", "Slot 2" so you always know what's where before you rename them.
Outputs: text, label, and index (the active index, handy for chaining into other controllers).
How it works
Slots are regular multiline widgets on the node, saved with the workflow. On execution it clamps slot_count, collects the active slots, and picks the one at index. The first-line-as-label trick comes from a simple parse: the first line is peeled off for the label and the remainder becomes the prompt. When a node is wired in instead, the connected title wins as the label. It also records its state into the workflow's extra info, so the node remembers its slot count and index across reloads.
Where it fits
Text Index Switch 3 sits between the bare V1 (index + text, no built-in index generation) and the all-in-one Text Index Switch 4 (which adds Select/Increment/Random/Range modes). This one's strength is organization: the label convention means your filenames and display nodes get meaningful names without any extra wiring. It also uses dynamicPrompts on its slots, so you can drop wildcard-style expressions into them.
The tradeoff is that it doesn't generate its own index - feed it from an AUN Random/Select INT or a counter. If you want the randomness built in, Text Index Switch 4 does that; if you want the cleanest labeling convention, this is the one.
Installing
It's part of the AUN ComfyUI Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
Restart ComfyUI, or install via ComfyUI Manager (search "AUN"). No model downloads or heavy deps; the pack's requirements (piexif, opencv-python-headless, requests, imageio-ffmpeg) are auto-installed by Manager. If you cloned manually, pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt covers it.
One habit that pays off: use the first-line convention consistently and your prompt slots become self-documenting. A workflow that's been sitting for two months still makes sense when every slot announces itself.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| index | INT | 11–20 | Selects which text input to output. |
| slot_count | INT | 21–20 | Number of visible text slots |
| text1 | STRING | Slot 1 | — |
| text2 | STRING | Slot 2 | — |
| text3 | STRING | Slot 3 | — |
| text4 | STRING | Slot 4 | — |
| text5 | STRING | Slot 5 | — |
| text6 | STRING | Slot 6 | — |
| text7 | STRING | Slot 7 | — |
| text8 | STRING | Slot 8 | — |
| text9 | STRING | Slot 9 | — |
| text10 | STRING | Slot 10 | — |
| text11 | STRING | Slot 11 | — |
| text12 | STRING | Slot 12 | — |
| text13 | STRING | Slot 13 | — |
| text14 | STRING | Slot 14 | — |
| text15 | STRING | Slot 15 | — |
| text16 | STRING | Slot 16 | — |
| text17 | STRING | Slot 17 | — |
| text18 | STRING | Slot 18 | — |
| text19 | STRING | Slot 19 | — |
| text20 | STRING | Slot 20 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| label | STRING | — |
| index | INT | — |