String Switch (Multiline)
Swap a whole prompt with one checkbox
- STRING
Two prompt boxes, one boolean, one output. It's the cheapest way to keep two versions of a prompt inside a single workflow instead of duplicating everything upstream of the text encoder.
What it's for
Prompt A/B testing in ComfyUI has an annoying shape: a prompt lives in a text box, so comparing two of them means either editing the same box between runs (and losing the first prompt) or duplicating the encode-and-sample chain (and now you have two graphs to keep in sync, which is how you end up comparing two prompts and two samplers).
This node puts both prompt variants in one place and lets a checkbox choose. Flip it, queue again, and everything downstream is byte-identical. That matters, because the thing you're testing is the prompt. The community's most reliable debugging advice is to change one variable with the seed locked - this node is that advice as a piece of plumbing.
The second use is negative prompts. Positive and negative sometimes want to swap roles when you're testing a model's response to a phrase, and having both candidates in named slots makes that switch explicit instead of accidental.
How it works
Three required inputs, all widgets on the node:
switch- BOOLEAN, default on. The tooltip: "True outputs the First String, False outputs the Second String."true_switch_string- multiline text box, returned when the switch is on.false_switch_string- multiline text box, returned when it's off.
One output, STRING ("the selected multiline string"). The implementation is a conditional expression - no trimming, no concatenation, no weight rebalancing.
Both text boxes are genuinely multiline, so you can paste a full paragraph with line breaks and it survives. What you cannot do is feed either candidate from a wire: they're text boxes, not sockets. If one of your two prompt versions is the output of another node - a String Replace, a key-value selector, a model-derived tag list - this node can't take it, and you want a switch with real input sockets instead.
One stylistic note from the frontend: the boolean reads as a plain checkbox, so on a shared workflow label the node itself (right-click → Title) as "Prompt: portrait / landscape" or you will absolutely forget which way is which by Thursday.
Installing it
ComfyUI-MDSNodes, by MarwanDSAI. ComfyUI Manager: search ComfyUI-MDSNodes or MDSNodes, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/MarwanDSAI/comfyui-mdsnodes
# restart ComfyUI
No pip step, no downloads - the repo's requirements.txt is empty and the README says the pack runs on stock ComfyUI dependencies. Nothing here touches a model.
Search String Switch (Multiline); the pack files it under MDSNodes/logic next to the single-line string switch, the float switch and Is Empty.
Common issues
Only one of your two strings is being used and the other is ignored. That's the node. The unused box is inert - it isn't tokenised, it isn't in the graph's execution, and it isn't in the metadata of the run. If you wanted both, you want a concatenate/merge node.
The output is empty. The selected box is empty. There's no fallback behaviour: whichever branch the switch points at is what comes out, blank included.
You need to wire the prompt in. Can't - the candidates are widgets. Use a switch node with STRING input sockets, or convert the target text-encode node's prompt input and feed it directly.
Missing from the node list. Shipped in pack version 1.8.0 (September 2026). Update in Manager and restart ComfyUI; the node registry only rebuilds at startup.
Long prompts look mangled after a copy-paste between workflows. Check for autocorrect-style whitespace changes before blaming the node - it passes the string through untouched, so what you see in the box is what the CLIP encoder gets.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| switch | BOOLEAN | true | True outputs the First String, False outputs the Second String. |
| true_switch_string | STRING | Text returned when the switch is True. | |
| false_switch_string | STRING | Text returned when the switch is False. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | The selected multiline string. |