ComfyUI Node

Text Concatenate

How Text Concatenate Turns Fragments Into a Prompt

By pictorialink·Created about a year ago·Updated about a year ago· 12
Text Concatenate
    • STRING

    Text Concatenate is the pack's quiet workhorse, and it isn't a translation node at all - it's the string glue. You feed it two or more text inputs and it stitches them into one string. That sounds trivial until you've built a workflow where the prompt is made of parts: a base prompt you keep stable, a style fragment you swap between runs, a subject token you toggle in and out. CLIP Text Encode wants one text blob, not three. This is how you give it one.

    How it works

    The clever bit is that the node starts with zero fixed inputs. The front-end JavaScript adds them dynamically: drag a wire from any string output and ComfyUI creates text1, text2, and so on, growing the node as you connect more sources. The Python behind it is a one-liner that sums whatever strings show up - text1 + text2 + ... - and returns the result as a single STRING.

    Three things worth knowing before you use it:

    • There's no separator. Concatenate means concatenate. If one fragment ends with cat and the next starts with dog, you get catdog. ComfyUI doesn't add commas or spaces for you. Add them in the fragments themselves ("cat, " / ", dog") or accept the mash.
    • It's wire-only. You don't type into this node. Every input is created by connecting another node's output - typically a Text node from the same pack, or your translation node's output.
    • The output is one STRING. That's the only output, and it's the one you run to a CLIP Text Encode or into another text-consuming node.

    This is also the natural companion to the pack's Text Switch: switch a fragment off, it outputs an empty string, and concatenation simply swallows the hole. Fragments turn into optional building blocks without any re-wiring.

    A fix you should know about

    A 2025 changelog entry fixes exactly the bug this node used to be famous for: after refreshing the page or copy-pasting a workflow, the dynamically added inputs could stop behaving. The fix is in the current code, but if you load an old workflow and the inputs look wrong, delete the node and re-add it - the dynamic inputs regenerate from your connections.

    Installing

    Same story as the rest of this pack. Easiest via ComfyUI Manager (search ComfyUI-Text-Translation), or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/pictorialink/ComfyUI-Text-Translation
    cd ComfyUI-Text-Translation
    pip install -r requirements.txt
    

    Restart ComfyUI afterwards. The only dependency is translators - no models, no downloads, nothing GPU-shaped. If you had a pre-May-2024 version of this pack installed, delete that folder before updating; the old and new versions don't mix.

    Start with a base-prompt Text node plus one fragment node, wire both in, and add a third when you want a swappable style. That's the whole pattern. It won't write your prompts for you - but it's the difference between editing one prompt box and rebuilding a workflow.

    CategoryText Translation

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    STRINGSTRING