DP 10 String Switch Or Connect
Ten prompt slots, switch, merge, or drop the negatives
- TEXT
- CURRENT_INDEX
The maxed-out version of the Desert Pixel string switch. Ten text inputs, and the same two-jobs deal: pass exactly one through (switch), or concatenate all the connected ones (connect). Ten is a lot - you reach for this when you're managing a real library of prompt fragments, like a bank of ten style presets you cycle through, or ten scene beats you assemble into one long prompt.
It's from DesertPixelAi's pack, a sprawling collection of quality-of-life nodes. None of them generate anything; they're plumbing, in the same spirit as rgthree's utilities. This is the biggest of the string switches, and it carries one extra trick the smaller ones don't.
How it works
mode sets the behavior and index selects the input in switch mode. What's different here is that mode has six options instead of five:
- Switch - output only the string at
index. - Connected - join all connected strings directly.
- Connected with comma - join with
,. - Connected with line break - one per line.
- Connected with line break+ - line breaks with extra spacing.
- Switch Remove neg - switch to one string, but strip out its negative portion.
That last mode is the reason to know this node exists over the 5-input one. If you keep your fragments written with an embedded negative section, "Switch Remove neg" lets you pull just the positive part through - handy when a downstream node only wants the positive prompt. Test it against your own text format, since exactly what counts as "the negative part" depends on how you write it.
The inputs and outputs that matter
mode- the six behaviors above.index- integer 1 to 10, used only in the Switch modes.String_01…String_10- ten optional multiline inputs. Fill only the ones you need.
Outputs are TEXT (the result) and CURRENT_INDEX (integer). With ten slots, the index output really pays off: drive index from an incrementing seed or counter and you've got a ten-way prompt rotator that also tells you which entry it landed on.
How to install it
- ComfyUI Manager: search "Desert Pixel", install, restart. Nothing to download.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes,pip install -r requirements.txtif present, restart.
Look under the DP category in the node menu.
Common issues
Ten inputs makes the empty-slot problem more likely, not less. In a Switch mode, an index pointing at an unfilled slot outputs an empty string - easy to do when you've only wired up four of the ten. If a switch comes out blank, that's the first thing to check.
And as with its siblings, index does nothing in the Connected modes; every wired string is used there. If you meant to select just one and got all ten glued together, you left mode on a Connected option.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | Switch | 6 options: Switch, Connected, Connected with comma, Connected with line break, Connected with line break+, Switch Remove neg |
| index | INT | 11–10 | — |
| String_01opt | STRING | — | |
| String_02opt | STRING | — | |
| String_03opt | STRING | — | |
| String_04opt | STRING | — | |
| String_05opt | STRING | — | |
| String_06opt | STRING | — | |
| String_07opt | STRING | — | |
| String_08opt | STRING | — | |
| String_09opt | STRING | — | |
| String_10opt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| TEXT | STRING | — |
| CURRENT_INDEX | INT | — |