marduk191's 5 way text switch
A five-way prompt switcher for A/B/C/D/E testing
- STRING
The best way to pick a prompt is by turning a dial, not by rewiring your graph. marduk191's 5 way text switch is exactly that dial: one integer input from 1 to 5, and the node routes exactly one of five incoming strings to its single output. It's A/B testing with five lanes, and it's one of those nodes you don't appreciate until you've tried comparing prompts by unhooking and re-hooking wires ten times in a row.
What it does
An Input field (an INT, default 1, clamped 1–5) selects which text lane wins. Feed text1 through text5 from other string nodes, set Input to 3, and text3 is what comes out of the STRING output. Change Input to 4, re-queue, and now text4 flows. The selection logic is trivial - it's a five-way if/else - which is exactly what you want from a switch: predictable, instant, no state.
Pair it with the pack's other text node (marduk191's 5 text strings), whose STRING1–STRING5 outputs plug straight into text1–text5. That combo gives you a single box of five prompts and a switch to pick among them. The idea is borrowed from Comfyroll's string selector, per the pack's credits, so the pattern is proven.
The gotcha that trips everyone up
The text1–text5 inputs are forceInput - meaning you can't type into them. A beginner opens the node, sees five empty text fields, and assumes they should be editable. They're not. They're input ports that must be wired from a text-producing node (the pack's 5-text-string node, a core Text node, a Text Multiline, whatever). If you're staring at empty, non-editable fields, that's not a bug - wire them up.
The Input selector, by contrast, is a normal widget you can just click and type into. You can also drive it from another INT output if you want to change the selection programmatically.
Install
Same story as the rest of the pack - zero dependencies, no model downloads. Via ComfyUI Manager, search "marduk191" and install the pack titled "marduk191 workflow settings", then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/marduk191/comfyui-marnodes
Restart ComfyUI afterward. The pack's requirements.txt is empty, so there's nothing else to install.
Common issues
- "I change Input and nothing happens" - make sure you re-queue; the switch only re-evaluates when the graph runs. Also double-check that the selected lane actually has a string wired in.
- "It outputs nothing" - an unwired lane yields an empty string. The switch doesn't complain; it just passes through nothing.
- "My Input went out of range" - the widget clamps to 1–5, but if you drive
Inputfrom another node, keep it in range: the code's fallback for any value other than 1–4 is to outputtext5, which can silently surprise you.
For comparing five prompt variants without rebuilding the graph, this is the node. Keep your lane texts on the 5-text-string box, flip the dial, and let the sampler do the rest.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| Input | INT | 11–5 | — |
| text1opt | STRING | — | |
| text2opt | STRING | — | |
| text3opt | STRING | — | |
| text4opt | STRING | — | |
| text5opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |