Nodes/Steaked-nodes/Text Concat
ComfyUI Node

Text Concat

The two-string joiner that respects the Oxford comma question

By StealthNinja1O1·Created 11 months ago·Updated 5 months ago· 0
Text Concat
    • combined
    ◄text►
    ◄order▾►
    ◄separator, ►
    ◄input_text—►

    Prompt plumbing is 80% gluing strings together, and ComfyUI gives you about a hundred ways to do it badly. Text Concat is the version that remembers the little things: it joins an incoming text stream with a text field you type into the node, lets you choose which one goes first, and - the part most concatenators get wrong - skips empty parts so you don't end up with ", " dangles everywhere.

    The mechanics are dead simple. The node takes two strings: input_text, which arrives over a wire from upstream (a wildcard picker, another text node, a library), and text, the box you type into directly on the node. order decides the sequence - "input first" or "text first" - and separator is what goes between them, defaulting to the comma-space you want for prompt tags. It strips whitespace around both parts, drops any that are empty, and joins what's left. One combined string comes out.

    The inputs that matter

    • text - your typed-in block, multiline.
    • order - "input first" or "text first." The one knob that matters.
    • separator - default ", ". Change it to a space or newline when you're not building tag lists.
    • input_text - the wired stream.

    That's it. One output, combined.

    Why this over a plain text node?

    Two reasons. First, the input_text socket is marked forceInput, so it always arrives as a wire - you can't accidentally type over the upstream value, which is the classic failure with primitive-style text nodes where the widget and the socket fight each other. Second, the empty-part handling is genuinely thoughtful: in a Steaked-nodes workflow, input_text often comes from the Prompt Library's combined output or from another concat, and those can legitimately be empty mid-edit. A naive join would give you "some tags, " with a trailing comma that poisons your prompt. This one just doesn't do that.

    It's the kind of node that doesn't deserve an essay. If you're assembling prompt fragments - character tags from a library plus a scene string, a base prompt plus a style block - this is a clean little valve. It's also a good teaching example of the plumbing layer: one socket in, one value out, no pixels touched.

    Install

    Ships in Steaked-nodes, the one-author pack it lives in. You get it with the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StealthNinja1O1/Steaked-nodes
    

    Then restart ComfyUI - or search "Steaked-nodes" in ComfyUI Manager. Dependencies are torch, numpy, and Pillow, which you already have; nothing else to fetch.

    Gotchas

    Not much to trip on. One thing: order is easy to misread - "text first" means the typed-in text box comes before the wired input_text, not the other way around. And while it strips whitespace and drops empty parts, it doesn't insert a separator if both parts are present but you typed an empty one - a blank separator joins them with no space, which is what you want for some cases but a surprise if you meant ", ". Also keep in mind it's a single joiner: for three-plus fragments you'll chain two of them or use the Prompt Library's own combined output instead.

    CategorySteaked-nodes/tools

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING—
    orderCOMBO2 options: input first, text first
    separatorSTRING, —
    input_textoptSTRING—

    Outputs (1)

    NameTypeDescription
    combinedSTRING—