Nodes/ComfyUI Utilitools Nodes/Text Concatenation
ComfyUI Node

Text Concatenation

Join two strings, and mind the separator

By aesethtics·Created about a year ago·Updated about a year ago· 1
Text Concatenation
    • result
    text_a
    text_b
    separator

    Text Concatenation glues two strings together, with an optional separator squeezed between them. It's the node you reach for when a prompt isn't one static block anymore - when you're building it from parts. Base subject from one node, style suffix from another, a quality tag bolted on the end. In that setup, this is the piece that joins them into a single string your CLIP Text Encode can actually eat.

    ComfyUI's text encoders are particular about formatting, and the community convention is pretty consistent: tag-style prompts separated by commas, or natural language assembled from a few chunks. Either way, you're concatenating. This node is the two-input version of that job, and it's dead simple.

    The inputs:

    • text_a (required) - the first string
    • text_b (required) - the second string
    • separator (optional, default "") - what goes between them

    The output is a single result string, computed as text_a + separator + text_b. That's the entire mechanism - no smart formatting, no auto-spacing, nothing hidden.

    And here's the one trap, and it's a classic: the separator defaults to empty. If you feed in "photo of a cat" and "cinematic lighting" without setting a separator, you get "photo of a catcinematic lighting" - a word salad the text encoder will happily misinterpret. Set separator to ", " (or " " for plain text joins) and everything clicks. It's the most common reason people think this node is broken when it's actually working exactly as configured.

    Two limits worth knowing before you rely on it. First, it only takes two strings. For three or more parts, you chain nodes - feed the first result into the next node's text_a - which works fine but gets tedious fast. For real multi-part prompt assembly, a list/join node from a bigger pack is the better tool. Second, it does not trim or clean anything: if text_b is empty you get text_a plus the separator dangling off the end. Fine for controlled builds, annoying if your inputs are messy.

    Where it slots into a workflow: put it between your prompt-building nodes and CLIP Text Encode (or whatever encodes the prompt), and it turns separate strings into one. Pair it with the Utilitools Whatever To String node if you want to fold a number - a seed, a CFG value - into a prompt string, or with String Replace to clean the result afterward.

    Install. It's part of the ComfyUI Utilitools pack. In ComfyUI Manager, search "ComfyUI Utilitools" (pack title: ComfyUI Utilitools Nodes), or clone directly:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aesethtics/ComfyUI-Utilitools
    

    Then restart ComfyUI. There are no dependencies and no models to fetch - the whole pack runs on the Python standard library, so installation is genuinely just "drop it in and restart."

    One sentence of advice: this node is at its best in small, controlled workflows where you know exactly what the parts are. For anything that needs to handle arbitrary numbers of pieces, go bigger. And for the love of your text encoder, don't forget the comma.

    CategoryUtilitools/Text

    Inputs (3)

    NameTypeDefaultDescription
    text_aSTRING
    text_bSTRING
    separatoroptSTRING

    Outputs (1)

    NameTypeDescription
    resultSTRING