Nodes/ComfyUI_Mira/Text Switcher Three Ways
ComfyUI Node

Text Switcher Three Ways

Reorder three prompts six ways

By mirabarukaso·Created 2 years ago·Updated 5 days ago· 206
Text Switcher Three Ways
    • text1
    • text2
    • text3
    text1
    text2
    text3
    switch1

    The three-input version of Mira's text switcher. Where the Two Ways node just swaps a pair, this one takes three prompts and can emit them in any of the six possible orderings, selected by a single number. It's built for the three-region regional-prompting case - three characters or three zones, and you want to shuffle which prompt lands where without touching the wiring.

    Regional prompting is the going answer to attribute bleed, where two or more subjects in one prompt trade hair colors, outfits, and poses because conditioning applies globally. Once you've masked the canvas into three regions, the assignment of prompts to regions is just a permutation. This node makes that permutation a dial you can spin - useful when you found a seed and composition you like and just want to audition "what if the middle character were on the left" quickly.

    How it works

    The switch integer, 1 through 6, indexes the six permutations of three items. Per the README's table: 1 → 123 (original order), 2 → 132, 3 → 213, 4 → 231, 5 → 312, 6 → 321. The node reads your three inputs and routes them to the three outputs according to whichever ordering you picked. No editing, no combining - a three-way crossbar.

    The inputs and outputs

    • text1 / text2 / text3 - your three prompts.
    • switch (INT, 1–6) - chooses the ordering from the table above.
    • Outputs text1 / text2 / text3 - the three prompts, permuted per the switch.

    Wire the three outputs into your three regional conditioning branches. Change switch to reassign which prompt drives which region.

    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, and if you hit a load error run pip install -r requirements.txt inside the folder before restarting. No models.

    Common issues

    The same asymmetry warning applies as with the Two Ways node, and it matters more with three regions: if your mask layout weights the regions unequally (say 1:2:1), then reordering the prompts also moves them into differently sized areas. Permuting text without a glance at your layout can hand a background character the biggest region. For an even three-way split it's a clean shuffle; otherwise, keep your mask layout in mind when you change the switch.

    The other easy slip is the indexing - switch starts at 1, not 0, and each value is a specific permutation, not "rotate by N." Keep the README table handy until the mapping is muscle memory; 1 is always the identity (123) if you just want passthrough.

    It belongs to ComfyUI_Mira, mirabarukaso's personal utility pack (they're the WAI Character Select dev). If you only have two prompts to juggle, the lighter Text Switcher Two Ways is the one to grab; this three-way version earns its keep specifically when you're running three regions and want fast permutation. The README's regional-conditioning example shows the intended wiring.

    CategoryMira/Text

    Inputs (4)

    NameTypeDefaultDescription
    text1STRING
    text2STRING
    text3STRING
    switchINT11–6

    Outputs (3)

    NameTypeDescription
    text1STRING
    text2STRING
    text3STRING