Nodes/String Join Tools/Runtime Toggle String Join (10)
ComfyUI Node

Runtime Toggle String Join (10)

Live prompt composition for long queues — Runtime Toggle String Join (10)

By ruminar·Created 2 months ago·Updated 27 days ago· 2
Runtime Toggle String Join (10)
    • text
    separator,
    modemultiple
    enabled_mask1023
    selected_index0
    state_key
    text_1
    text_2
    text_3
    text_4
    text_5
    text_6
    text_7
    text_8
    text_9
    text_10

    This is the flagship of ruminar's String Join Tools pack, and it's built for one specific, slightly obsessive workflow: queue a long batch of generations, then keep re-composing the prompt while it drains. Runtime Toggle String Join (10) gives you ten toggle-able string inputs whose state stays live on the ComfyUI server, so a click between queued jobs changes what the next job generates. No re-queueing. No reloading the workflow.

    The README calls out the design target directly: these nodes are "intended for long, pre-queued generation runs." The idea is that LoRA, seed, character, and other job-specific settings can be queued in advance while the prompt composition is still being fiddled with. Queue a hundred jobs with the settings pinned, spend the run clicking style blocks on and off, and each new image reflects your latest clicks.

    How the live mechanism works

    Each toggle click pushes the mode and enabled mask to a server-side state store, keyed by state_key. When the node executes, it reads that live state rather than the queue-time snapshot, then joins only the currently enabled non-empty strings. If live state is unavailable (fresh restart, say), it falls back to the saved queue-time values - a safe fallback, not an error. You can tell it's a runtime node at a glance: faint amber tint, LIVE in the status area.

    Three behaviors follow from the implementation and are worth internalizing:

    • The cache can't hide your changes. The node includes a monotonic revision number in its IS_CHANGED result, so flipping a toggle invalidates the cached join and forces re-execution downstream. Change something and it takes effect, which is the whole trick.
    • Timing is "the next image onward." A change affects jobs whose node hasn't executed yet. The image currently generating finishes with its old composition.
    • One browser tab per workflow. Live state is shared by state_key on the server, and the README's rule is blunt: use one active tab for controlling a given workflow, because a second tab holding the same key can overwrite your clicks.

    What you set

    • mode - multiple (independent toggles) or single (zero or one enabled; clicking a new input turns all others off).
    • Per-row ON/OFF buttons - the actual control surface.
    • separator - default ", ", with \n, \r\n, \t, \\ escapes.
    • state_key - auto-generated per node; set it only to deliberately share live state between copies.
    • text_1text_10 - optional STRING sockets. Output: one text STRING, straight into CLIP Text Encode or a saver's metadata.

    The enabled_mask and selected_index widgets back the buttons and are managed for you. Ten sockets means ten optional branches - use three or ten, the unused ones just stay out of the output.

    Installing it

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

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

    Restart and refresh. Zero Python dependencies, no model downloads. Under String Join Tools.

    The honest caveats

    Live state is in server memory and dies on a ComfyUI restart - after a restart you're on fallback values until you touch a toggle. Deleting a node doesn't immediately kill its server state (the pack keeps it around so already-queued jobs can still resolve it), and workflow copies that share a state key can overwrite each other if controlled simultaneously. And the honest question: if you're not running long queues, the snapshot Toggle String Join (10) is simpler and gives the same answer for single runs. This node's machinery is worth it exactly when the queue is long and the composition is still moving.

    CategoryString Join Tools

    Inputs (15)

    NameTypeDefaultDescription
    separatorSTRING, Supports \n, \r\n, \t, and \\.
    modeCOMBOmultiple2 options: multiple, single
    enabled_maskINT10230–1023
    selected_indexINT0-1–9
    state_keySTRING
    text_1optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_2optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_3optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_4optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_5optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_6optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_7optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_8optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_9optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.
    text_10optSTRINGOptional queued STRING input. Its generated value is accepted or rejected at execution time by the live toggle.

    Outputs (1)

    NameTypeDescription
    textSTRING