ComfyUI Node

Concatenate text

Stitching prompt blocks together

By nosiu·Created about a year ago·Updated 3 months ago· 3
Concatenate text
    • text
    text1
    text2

    The least glamorous node here, and the one that ties the pack together

    Concatenate text joins two strings with a comma and a space: text1, text2. That's it - no seed, no randomness, no options. It's not a randomizer at all, which is why it ships alongside the others: the pack's real workflow idea is build prompts from reusable blocks, and this is the glue.

    Consider the alternative the pack itself demonstrates in workflow.json. You can dump every [option|option] into one giant Text randomizer and let it explode into every combination. That works, but the prompt becomes a wall of brackets you can't reason about. Split it instead: one RandomizeText for the subject, one for the lighting, one for the style, then feed their outputs through a couple of ConcatText nodes. Each block is now independently tweakable and reusable, and the join order is visible in the graph. That's the whole philosophy - the pack README explicitly frames these as "grouping separate topics and concatenating texts" vs. "putting everything into one node."

    How it works

    Under the hood it's one line:

    return (text1 + ", " + text2,)
    

    There's nothing to tune, which is the point. But it means the separator is hardcoded - always a comma and a space. No newline option, no custom delimiter, no config. If you need a different separator (say a plain space or a newline for LLM-encoded models where prompts read as instructions), this isn't the node; grab a general-purpose string utility instead.

    Inputs and outputs

    • text1 (multiline, forced input) - first block, typically wired from a RandomizeText or another ConcatText.
    • text2 (multiline, forced input) - second block.

    Both are forced inputs, so the node expects connections rather than typed values - right-click a widget if you want to convert one to hand-typed text. The single output, text (STRING), feeds your text encoder, or another ConcatText if you're building a chain of three or more parts. A chain of two nodes gives you three blocks; there's no practical limit.

    Installing it

    Identical to the rest of the pack, and dependency-free:

    cd ComfyUI/custom_nodes
    git clone https://github.com/nosiu/comfyui-text-randomizer
    

    Restart ComfyUI. Or use ComfyUI Manager and search comfyui-text-randomizer. No pip install, no model downloads. If you installed the pack for the randomizer, this node is already there.

    Common issues and honest limits

    • Double separators - the node always adds , . If your inputs already end with a comma or a trailing space, you'll get word, , word. Keep blocks clean; let the node own the separator.
    • Want a different glue - you're out of luck here. The comma-plus-space is baked in. This is the single most-requested feature that doesn't exist, so budget accordingly.
    • Deterministic by design - unlike the seed-driven nodes in this pack, ConcatText is always reproducible. If your output varies, the variation comes from whatever is upstream feeding it, which is the point.

    The wider ecosystem has fancier text utilities - rgthree's Power Puter can concat and compute in one node - but for a beginner building a prompt from a few randomizer blocks, plain ConcatText is the most honest node on the canvas: it does exactly one thing, reads like it, and never surprises you. Pair it with the pack's Show Text node to eyeball the final string before it hits the encoder, and you've got a complete prompt-building toolkit in four nodes.

    Categoryrandomizer

    Inputs (2)

    NameTypeDefaultDescription
    text1STRING
    text2STRING

    Outputs (1)

    NameTypeDescription
    textSTRING