Text Switcher Two Ways
Swap the order of two prompts with one toggle
- text1
- text2
Two text inputs, two text outputs, one toggle that decides whether they come out in order or swapped. That's the whole node. It sounds almost pointless until you're doing regional prompting and realize how often you want to try "character A on the left, B on the right" versus the reverse without rewiring anything.
That's exactly the use case the author had in mind. When you've split the canvas into regions and assigned a prompt to each - the standard fix for two characters bleeding their features into each other - the mapping of which prompt goes to which region is just an ordering. This node lets you flip that ordering from one boolean instead of physically swapping two cables every time you want to see the mirror version.
How it works
Dead simple. The switch boolean is off → text1 comes out of output 1 and text2 out of output 2. Switch on → they trade places, text2 out of output 1 and text1 out of output 2. No combining, no editing - it's a crossbar for two strings.
The inputs and outputs
- text1 - first prompt (usually a full region prompt).
- text2 - second prompt.
- switch (
BOOLEAN) - off passes them straight through; on swaps them. - Outputs text1 and text2 - the two prompts, in original or swapped order depending on the toggle.
Wire the two outputs into your two regional conditioning branches. Flipping the switch then flips which region gets which prompt.
Installing it
Install the pack. ComfyUI Manager: Manager -> Custom Nodes Manager, search ComfyUI_Mira, Install, restart. Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/mirabarukaso/ComfyUI_Mira.git
Restart. If loading errors, pip install -r requirements.txt inside the folder, then restart. No models.
Common issues
The one real caveat comes straight from the README, and it's easy to forget: if your regions aren't symmetrical - a 1:1 split is symmetrical, but 1:2:3 weighting is not - then swapping the prompts also means you should rethink your mask layout, because the left region might be a quarter of the canvas and the right three-quarters. Swap the prompts without adjusting the layout and character A now gets B's real estate. For an even split it's a free flip; for a lopsided one, swapping text alone changes the composition in ways you might not want.
Otherwise there's nothing to break. It's a crossbar. If you have three prompts to permute rather than two, the sibling Text Switcher Three Ways does the same trick across three inputs with all six orderings.
It's part of ComfyUI_Mira, mirabarukaso's personal utility pack (the WAI Character Select dev), and this is a textbook example of the pack's whole reason for existing - a tiny convenience that removes a repetitive rewiring chore from a regional-prompting graph. The README's regional example shows it in context.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text1 | STRING | — | |
| text2 | STRING | — | |
| switch | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text1 | STRING | — |
| text2 | STRING | — |