ComfyUI Node

Join Texts

Stitch a bunch of strings into one, quietly

By luku756·Created about a month ago·Updated about a month ago· 0
Join Texts
    • joined_text
    input_size2
    delimiter\n
    skip_emptytrue

    Join Texts is the least glamorous node in StringKit and the one you'll wire up on autopilot: several string inputs in, one joined string out. It's the node you reach for when a prompt is really three prompt fragments, when a filename is two parts plus an extension, or when you have a stack of tag lines that need to become one comma-separated prompt.

    The socket count is dynamic, and that's the feature to notice first. input_size - 1 to 50 - controls how many text_1 … text_N inputs exist; crank it and the sockets appear, shrink it and they fold away. Unconnected slots are simply skipped, so you never get doubled separators from an empty middle socket.

    The three settings that do the work

    • input_size - how many text sockets you get. It's a widget, so you don't need a node to set it.
    • delimiter - what goes between the pieces. Default is \n (newline), and you write it as the two-character escape, not an actual line break, since widgets can't hold one. \t, \r, and \\ work too. Set it to a blank string and pieces are glued together with nothing between them.
    • skip_empty - on by default. Empty or whitespace-only inputs are dropped, so joining "a", "", "b" with a comma gives a, b, not a, , b. Turn it off and empty inputs still occupy their slot, which is what you want when position matters (think CSV-ish lines).

    The output is a single joined_text string that drops into any STRING input. Nothing fancy, and that's the point.

    One design detail worth knowing

    Join Texts deliberately does not declare itself as a list-processing node the way its sibling Loop Texts does. That means if you put it after a loop that runs N times, Join Texts executes once per element and merges each one individually - which is exactly what you want when you're assembling per-image filenames inside a batch. A join that ran "once over the whole list" would give you one giant string for all N images, and you'd have to undo it.

    Install

    Part of ComfyUI-StringKit: MIT, zero dependencies, no models, no API keys. Install via ComfyUI Manager (search ComfyUI-StringKit) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/luku756/ComfyUI-StringKit
    

    Then restart ComfyUI fully - the dynamic sockets live in frontend JS, and hot reload won't load them. Look under the StringKit category.

    If you're only joining two strings, the core Text Concatenate node does that with one less install. The moment you're stitching five, skipping empties, or working inside a batch loop, this is the cleaner tool - the dynamic socket count alone beats a pile of concatenate nodes.

    CategoryStringKit

    Inputs (3)

    NameTypeDefaultDescription
    input_sizeINT21–50
    delimiterSTRING\n
    skip_emptyBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    joined_textSTRING