ComfyUI Node

Join Texts

The glue node that stops your prompt fragments from colliding with commas

By craftgear·Created 8 months ago·Updated 6 months ago· 1
Join Texts
    • text
    separator,
    text_1

    ComfyUI's stock text handling has a hole: there's no native node that takes several string inputs and merges them into one prompt. You end up pasting fragments together by hand or reaching for an over-engineered "prompt combiner" pack. Join Texts is the small, boring, correct version of that - a node that concatenates any number of text inputs into a single string with a separator you control. It's the glue of this pack's text family: feed it the tags output from Load LoRAs With Tags, a fragment from Commentable Multiline Text, and a manual tag line, and out comes one clean prompt.

    How it works

    The headline feature is that inputs appear on demand. It starts with just text_1; the moment you connect something to it, a text_2 socket spawns, then text_3, and so on. Wire up as many fragments as you need - unconnected inputs are simply ignored.

    The second feature is what makes it worth using over a naive join: separator deduplication. If text_1 ends with a comma and text_2 starts with one, you don't get tag1, tag2,, tag3. Inputs that already carry the separator at the boundary are joined without doubling, so tags assembled by other nodes (which often trail a comma) won't corrupt the output. It also splits multiline inputs into lines, skips blank lines, and joins everything with your chosen separator (default ,).

    Inputs and outputs that matter

    • separator - the widget (default ,). This is the string placed between joined parts.
    • text_1, text_2, text_3… - dynamic string sockets. Connect and they grow.

    Output: text, the joined string. Wire it into CLIP Text Encode or Toggle Tags - and if that encoder feeds a KSampler, the pack's A1111 Metadata Writer will pick the resulting prompt up when it saves.

    Install

    Search craftgear in ComfyUI Manager and install a numbered version (nightly fails on security restrictions, per the README), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/craftgear/comfyui-craftgear-nodes
    

    Restart ComfyUI. No dependencies beyond ComfyUI core.

    Where people get burned

    • text_1 is an optional socket, not a text box. It's forceInput, so you can't just type a fragment into the node - everything has to come over a wire. That's deliberate (socket-only keeps the dynamic inputs predictable) but it trips people up the first time.
    • Check the separator if output looks doubled. Dedup only kicks in at the exact boundary. If a fragment has a separator inside it - tag1, tag2 as one line - it stays, which is what you want, but it means the node isn't a general de-duplicator. It joins; it doesn't clean.
    • Empty parts are skipped. A blank line or an unconnected input contributes nothing, which is normally what you want, but be aware if you're trying to force empty separators through.
    Categorycraftgear/text

    Inputs (2)

    NameTypeDefaultDescription
    separatorSTRING,
    text_1optSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING