Nodes/zsq_prompt/Connection String
ComfyUI Node

Connection String

Glueing Up to Ten Strings Together, Separator Included

By windfancy·Created 2 years ago·Updated 5 months ago· 2
Connection String
    • text
    separator,
    text0
    text1
    text2
    text3
    text4
    text5
    text6
    text7
    text8
    text9

    ConnectionString joins strings together with a separator. Ten inputs in, one joined string out. It sounds almost too boring to install, but it's the kind of node that makes dynamic prompts practical - because in ComfyUI, the alternative to "join these strings" is usually a pile of concatenation nodes that each handle exactly two inputs and no separator logic.

    How it works

    The node exposes text0 through text9 - ten optional STRING inputs - plus a separator string. When the graph runs, it walks the inputs in order and appends each one that's present, followed by the separator. Any input you don't wire is skipped, so you can build prompts that include only the sections you've actually connected. Want commas between tags? Set separator to ,. Building a filename? Set it to _. It's string arithmetic with punctuation as the operator.

    The quirk to know about

    Here's the thing nobody mentions: the separator is appended after every value, including the last one. So three wired inputs with a comma separator produce "a,b,c," - trailing comma and all. For prompt tags that's harmless, even typical. For filenames or anything where a trailing separator breaks something, trim the result before it hits your save node, or plan around it. It's a small surprise from a simple implementation, and now you know.

    The inputs that matter

    separator is the only required input - it defaults to a comma, which is the right call for prompt work. The ten textN slots are all optional and all accept wired strings, which is where the power is: feed them from text nodes, math nodes, or conditionals, and the joined output becomes a prompt assembled at runtime instead of typed by hand.

    Output is a single text string, ready for a CLIP encoder, a ShowText debug node, or a filename prefix.

    Where you'll actually use it

    Dynamic prompts are the headline use - combine a subject, a style, and a lighting tag from separate sources, then push the result into DoubleCLIPEncode or a sampler. It also shines for building filenames, joining options for an OptionString, or any spot where a fixed number of pieces need a shared separator. It's not a general-purpose text tool, but for "glue these together with commas," it's the fastest node in the pack.

    Installing it

    Part of windfancy/zsq_prompt - search "zsq_prompt" in ComfyUI Manager and install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/windfancy/zsq_prompt
    

    then restart. Heavy requirements install alongside but this node is pure string work. And the Manager "conflict" flag you may see on zsq_prompt is the pack's generic class names colliding in the index - the community's advice is to ignore it unless you're actually running the other pack too.

    Verdict

    A ten-port string joiner with one predictable quirk. If you build dynamic prompts, it earns its spot in minutes.

    CategoryZSQ/Stinrg

    Inputs (11)

    NameTypeDefaultDescription
    separatorSTRING,
    text0optSTRING
    text1optSTRING
    text2optSTRING
    text3optSTRING
    text4optSTRING
    text5optSTRING
    text6optSTRING
    text7optSTRING
    text8optSTRING
    text9optSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING