ComfyUI Node

Concat (str)

Glue prompt pieces together without hand-managing commas

By Elypha·Created 2 years ago·Updated 12 months ago· 0
Concat (str)
    • STRING
    separator,
    str_1

    You know the workflow smell: a base prompt from a String node, a style block from another, an artist tag from a third - and you're manually typing them into one text box with commas, hoping the spacing survives. Concat (str) exists to end that. Wire your pieces in, pick a separator, and get one clean STRING out the other side.

    The mechanism is simple and worth knowing precisely because the defaults are so forgiving. There's a separator input (default ","), and a growing list of str_N inputs. Every connected string gets trimmed - whitespace collapsed, stray commas stripped - and then the non-empty ones are joined with your separator, with a space tacked on. So a separator of "," produces "base, style, artist". Empty inputs are skipped, which means you can leave a slot unwired and nothing breaks.

    What makes it feel alive in the graph is the dynamic slots. Unlike the static node schema, the str_N inputs aren't fixed: connect a string to the last one and the frontend adds another empty slot. It's the same self-extending-input trick Impact Pack popularized, and it means you build up a chain by just wiring - no reconfiguration. (The pack's own JS drives this for Concat (str), Format (str), and Combine (cond) specifically.)

    Where you'll reach for it: composing a prompt from parts you want to swap independently. Keep "masterpiece, best quality" on one node, the subject on another, the style on a third, and you can swap any one without editing the others - the "one source, many consumers" philosophy from the node-plumbing docs applied to prompt assembly.

    The inputs that matter

    • separator - what goes between pieces; default "," gives the comma-space you'd type by hand
    • str_1 (and friends, as you connect them) - the pieces

    One output: STRING, typically wired into a CLIP Text Encode.

    Installing it

    ComfyUI-Prompt-Helper has no dependencies beyond what ComfyUI already installs and no model downloads. ComfyUI Manager → search ComfyUI-Prompt-Helper, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/elypha/ComfyUI-Prompt-Helper
    

    Restart, and it appears under prompt_helper.

    Honest take: it's a nicety, not a revolution - you can absolutely do this with Format (str) or by hand. But the auto-trimming and the skip-empty behavior mean it tolerates exactly the sloppy inputs you'll feed it from a dozen different sources, which is worth more than it looks.

    Categoryprompt_helper

    Inputs (2)

    NameTypeDefaultDescription
    separatorSTRING,
    str_1optSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING