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

Toggle String Join (3)

Three branches, one click each — Toggle String Join (3)

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

    Three inputs is where the toggle-join idea starts to feel genuinely useful. With two, you could almost get away with a manual switch. With three optional string sockets, each carrying its own ON/OFF button, you're composing prompts by clicking - which is a lot faster than rewiring, and a lot more legible than three disconnected wires hanging in space.

    Toggle String Join (3) comes from ruminar's String Join Tools pack. Each text input row has a button (left-click the row too), and the node shows QUEUE SNAPSHOT in its status area. That label is the key mechanic, so read it twice: toggle state and mode are captured when you queue, and later UI changes don't touch jobs already waiting. This is the variant you use when you've settled on a composition and want to run a batch unattended - flip the toggles, queue, leave.

    Modes: multiple vs single

    • multiple (default): every input's toggle is independent. You can have all three on, one on, two on - anything.
    • single: zero or one input can be enabled. Click a new input and it becomes the only active one. Great for an either/or choice - say "candid | studio | outdoor" where exactly one version should run at a time.

    The mode dropdown and the per-row buttons are the whole interface you'll use day to day. The enabled_mask and selected_index widgets back the buttons and are handled for you. separator (default ", ") supports the usual escapes: \n, \r\n, \t, \\.

    How it behaves

    Only strings that are connected and toggled on and non-empty make it into the output. Unconnected inputs are skipped, exact empty strings are skipped, and the separator lands only between strings that actually survived. Output is a single text STRING, ready for a CLIP encoder or a saver's metadata.

    If every input is off or empty, you get "". That's the sane behavior for a prompt - an empty string is a problem you can actually see, whereas a phantom ", ," hides in a prompt you'll swear you wrote correctly.

    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. No Python packages, no model downloads. Under String Join Tools in the node menu.

    The trap, stated plainly

    This is a snapshot node. Flip a toggle after queueing and the jobs already in line ignore you - deliberately. If your mental model is "I'll click the toggle and it applies immediately," you want the pack's Runtime Toggle variants instead, which read the latest live state when each job executes. Use this one for fixed-composition batches; use the runtime ones when the composition is still moving. Also remember it only captures at queue time: if you change a toggle and hit Run and "nothing changed," you're looking at the previous queue's snapshot. Re-queue.

    CategoryString Join Tools

    Inputs (7)

    NameTypeDefaultDescription
    separatorSTRING, Supports \n, \r\n, \t, and \\.
    modeCOMBOmultiple2 options: multiple, single
    enabled_maskINT70–7
    selected_indexINT0-1–2
    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.
    text_3optSTRINGOptional queued STRING input. Whether it is included is captured when the prompt is queued.

    Outputs (1)

    NameTypeDescription
    textSTRING