Nodes/String Join Tools/Toggle String Join (2)
ComfyUI Node

Toggle String Join (2)

Two prompts, one button — Toggle String Join (2)

By ruminar·Created 2 months ago·Updated 27 days ago· 2
Toggle String Join (2)
    • text
    separator,
    modemultiple
    enabled_mask3
    selected_index0
    text_1
    text_2

    Imagine you've built a workflow where one branch carries a plain portrait prompt and the other carries a style-heavy variant, and you want to flip between them by clicking, not by rewiring. That's the Toggle String Join family in ruminar's String Join Tools pack, and (2) is its smallest member: two optional string sockets, each with an ON/OFF switch on the node face.

    The toggle is the whole idea. Each input row gets a button (and you can left-click the row itself), so you can mute an entire branch with one click instead of unplugging a wire. In multiple mode each input is independent. In single mode at most one input is enabled - click one and it's the only one that flows.

    The part that surprises people: it's a queue snapshot

    Here's the mechanic to internalize before you use it: the toggle state and mode are captured when the prompt is queued. The node shows QUEUE SNAPSHOT in its status area, and that's not decoration - it means a toggle you flip after pressing Queue has no effect on jobs already waiting in line. Each queued job uses the toggle state as it was at queue time.

    That's a feature, not a bug. It makes this variant perfect for unattended batch runs: you set the composition you want, queue a hundred images, and walk away - nobody's mid-batch flip is going to silently change the prompt for job 47. The pack pairs this with an explicit recommendation: choose the desired prompt composition, then queue.

    If instead you want a toggle you can flip mid-batch and have it apply to the next queued job, the same pack ships "Runtime Toggle String Join" variants that read live state at execution time. Two tools, two philosophies: snapshot vs live.

    What you actually set

    • separator - default ", ", supports \n, \r\n, \t, \\ escapes.
    • mode - multiple (each input independent) or single (zero or one enabled).
    • The buttons on each input row - this is really the whole UI. The enabled_mask and selected_index widgets underneath are managed for you; you'll rarely touch them directly.
    • text_1, text_2 - optional STRING sockets, wire-only.
    • Output: text, a single STRING.

    Unconnected inputs are ignored, and so are exact empty strings - the same empty-string forgiveness as the pack's Optional joins. The only strings that survive are connected and toggled on and non-empty.

    Installing it

    ComfyUI Manager: search "String Join Tools" or "ComfyUI-StringJoinTools". Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ruminar/ComfyUI-StringJoinTools
    

    Restart and refresh. Zero Python dependencies, no model downloads. It lives under String Join Tools.

    Where it bites

    The queue-snapshot behavior is the trap if you're not expecting it. Flip a toggle, queue again, and you'll get the new state - but if you're staring at a queue of jobs, the ones already in it ignore you. That's the documented, deliberate design. If you ever find yourself mid-run and wishing a queued job would pick up your change, you want the Runtime variants, not this one. And if you're flipping toggles and "nothing changed," check that you actually re-queued: the snapshot is taken per-queue, not per-click.

    CategoryString Join Tools

    Inputs (6)

    NameTypeDefaultDescription
    separatorSTRING, Supports \n, \r\n, \t, and \\.
    modeCOMBOmultiple2 options: multiple, single
    enabled_maskINT30–3
    selected_indexINT0-1–1
    text_1optSTRINGOptional queued STRING input. Whether it is included is captured when the prompt is queued.
    text_2optSTRINGOptional queued STRING input. Whether it is included is captured when the prompt is queued.

    Outputs (1)

    NameTypeDescription
    textSTRING