Nodes/Comfyroll Studio/πŸ”€ CR Text Input Switch (4 way)
ComfyUI Node Runs on cloud

πŸ”€ CR Text Input Switch (4 way)

Pick one of four text sources by number

By Suzie1Β·Created 3 years agoΒ·Updated 2 years agoΒ· 1,296
πŸ”€ CR Text Input Switch (4 way)
    • STRING
    • show_help
    β—„Input1β–Ί
    β—„text1β€”β–Ί
    β—„text2β€”β–Ί
    β—„text3β€”β–Ί
    β—„text4β€”β–Ί

    The same switch idea as CR Text Input Switch, stretched from two options to four. Wire in up to four text strings, set one number from 1 to 4, and whichever one you picked comes out. Reach for this over the plain two-way version once you're comparing more than a couple of prompt or caption variants and don't want to nest two-way switches inside each other.

    How it works

    text1 through text4 are all optional - only wire the ones you're actually using. Input, an integer from 1 to 4, is the switch itself: it decides which of the four gets forwarded to the single output. Nothing about the strings is modified; it's pure selection, not a blend or a merge of any kind.

    Because Input is just an integer, it's also the node you'd reach for if you want to drive the selection programmatically rather than click through options by hand - wire it from something like CR XY Index's output, or from a loop counter, to cycle through four fixed text variants automatically across a batch, rather than manually flipping the number between runs.

    Why four instead of nesting two-way switches

    You could get the same result by chaining two CR Text Input Switch nodes - one picking between text1/text2, another picking between text3/text4, a third picking between those two results - but that's three nodes and two extra wires to express something this single node does with one widget. It also means three separate places Input-equivalent values could be set, which is exactly the kind of "which one did I leave on 1" confusion a dedicated four-way switch avoids. If you know up front you're choosing among four fixed options - four style presets, four subject variants for a themed batch - reach for this directly rather than building the nesting by hand.

    Inputs and outputs that matter

    • Input - integer, 1 through 4. The switch.
    • text1 through text4 - the four optional text sources.

    Output: a single STRING (whichever was selected), plus the standard show_help link.

    How to install it

    ComfyUI Manager - search "Comfyroll Studio", install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git
    

    then restart. No models - pure routing of text you've already produced elsewhere in the graph.

    Common issues

    Same core trap as the two-way version, just with more room to make it: change text3 and forget Input is still sitting on 1, and nothing appears to happen. Always check the switch value first.

    With four slots instead of two, it's also easier to lose track of which branch is actually live, especially in a busy graph. If you're switching between these regularly, a label or a show_text-style preview on whichever text node feeds the selected slot saves a lot of "wait, which one is this" moments.

    If none of the pack's nodes appear in search, that's Comfyroll's shared import failing, not this node - check your ComfyUI console for Comfyroll Studio: Failed to load ... nodes, most often a Pillow version conflict introduced by another custom node, and reinstall Pillow or update the pack through Manager.

    Category🧩 Comfyroll Studio/πŸ› οΈ Utils/πŸ”€ Logic

    Inputs (5)

    NameTypeDefaultDescription
    InputINT11–4β€”
    text1optSTRINGβ€”
    text2optSTRINGβ€”
    text3optSTRINGβ€”
    text4optSTRINGβ€”

    Outputs (2)

    NameTypeDescription
    STRINGSTRINGβ€”
    show_helpSTRINGβ€”