Prompt Switch (5)
The small prompt router that ends duplicate workflows
- selected_text
The one I'd actually reach for. Prompt Switch (5) is the same string router as its (10) and (20) siblings from itom0717's Prompt String Selector pack, but with a five-input ceiling - and five inputs is honest for most real workflows. Two or three variants is normal; a five-way switch covers you with room to spare and half the wire clutter.
What it does
You give it an id (INT, 1–5) and it passes through exactly one of the five text_01–text_05 inputs, out as selected_text. Change the number, get a different prompt. It's a static router - pick one connected string and output it - not the A1111-style [Dog|Cat] step-alternation "prompt switch" you might have seen in SD-land. That's prompt scheduling, which this node deliberately is not.
Why five is the sweet spot: it's the size that keeps the node compact on the canvas, and for the most common use - A-versus-B character or style swaps - you'll use two pins and have three spare. The pack's own sample workflow ships this variant, not the big ones: an ID Select feeds id, and the switch's selected_text drops into the pack's Aggregator next to Character and Art Style selectors. Character A or character B becomes one integer.
How it works
From the source, the mechanism is three lines of real logic:
idrequired, default 1, min 1, max 5.- Inputs are
text_01throughtext_05(two-digit labels -text_02, nottext_2), all optional STRINGs withforceInput. - The chosen string is stripped, gets a
,\nappended if it doesn't already end in a comma, and passes out - the comma is there so it chains cleanly into an aggregator or a CLIP text encode.
The failure mode is the one to remember: an unconnected or empty pin returns an empty string, not an error. It never crashes, so "my prompt just disappeared" usually means "I switched to an id whose pin is empty." With a range of only five, you'll do that exactly once before it clicks.
Install
Same as the whole pack - no requirements, no model downloads, MIT:
cd ComfyUI/custom_nodes
git clone https://github.com/itom0717/ComfyUI-Prompt-String-Selector
Restart ComfyUI (and refresh the browser so the nodes register). ComfyUI Manager → Install via Git URL also works.
Verdict
If you want to stop duplicating workflows for every prompt variant, this is the node to start with. The (10) buys you headroom if you genuinely juggle more than five variants, and the (20) is for people running a real library - but for the classic "same graph, different character" problem, five is plenty and small enough to leave on the canvas without a second thought.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| id | INT | 11–5 | — |
| text_01opt | STRING | — | |
| text_02opt | STRING | — | |
| text_03opt | STRING | — | |
| text_04opt | STRING | — | |
| text_05opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| selected_text | STRING | — |