ComfyUI Node

String Concat

Join text with the separator you actually want, not just a comma

By uihp·Created 2 years ago·Updated about a year ago· 1
String Concat
    • STRING
    separator
    previous
    string

    String Concat is the sibling of String Chain in the same pack, and it fixes the one thing String Chain hard-codes away: it lets you choose the separator. Same two string inputs, same single STRING output, same chainable previous socket - but instead of a fixed comma, you get a separator field where you type exactly what should land between the two halves.

    That one field is the whole difference, and it matters more than it sounds. String Chain gives you "a, b" and nothing else. String Concat can give you "a b" (type a single space), "a - b", "ab" if you leave the separator empty, or any glue a prompt actually needs. If you're assembling a natural-language sentence from fragments - say a scene description where you want spaces rather than booru commas - this is the node to grab instead of its comma-locked sibling. The KB's guidance on LLM-encoded checkpoints (Flux 2, Anima, the Z-Image family) is that prompts read as sentences and comma tags are at best inert, so a space-joining concat is genuinely the better tool there.

    How it works

    Mechanically it's the same tiny, readable pattern as String Chain: if both inputs are non-empty you get previous + separator + string, otherwise you get whichever side has text (or an empty string if both are empty - the node never fabricates a dangling separator). previous is forceInput, so it's a wire-in socket, and the output feeds straight into CLIPTextEncode's text input or into the next node's previous for multi-way daisy chains.

    Gotchas

    Where people get burned: the separator default is an empty string, so if you forget to set it, "cat" + "dog" quietly becomes "catdog" with no space. And the separator is a literal string - what you type is what lands between the halves. There's no escape processing, so typing \n gives you backslash-n, not a line break, and fitting a real newline into a single-line text box is fiddly. This is a comma/space/dash/colon tool; for actual multiline joins you want the Toggle's multiline sibling or a prompt-shaping node.

    Install

    Install is the same story as the whole pack: ComfyUI Manager, search ComfyUI-String-Chain, or clone it into custom_nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/uihp/ComfyUI-String-Chain
    

    Restart and it's there. No requirements.txt, no models, no GPU work - pure standard library. This is a small, young pack with an empty README and no community chatter yet, but String Concat's code is short enough that "will it keep working" isn't a real worry. If you only install one string node from this family, make it String Toggle (it does everything Concat does plus on/off switching); if you just need a custom-joiner, this one is it.

    Categoryutils

    Inputs (3)

    NameTypeDefaultDescription
    separatorSTRING
    previousoptSTRING
    stringoptSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING