Nodes/WAS Node Suite v3/Text Concatenate
ComfyUI Node Runs on cloud

Text Concatenate

Glue prompt fragments together with a delimiter

By WASasquatch·Created 3 years ago·Updated 5 days ago· 1,844
Text Concatenate
    • STRING
    delimiter,
    clean_whitespacetrue
    text_a
    text_b
    text_c
    text_d
    text_e
    text_f
    text_g
    text_h
    text_i
    text_j
    text_k
    text_l
    text_m
    text_n
    text_o
    text_p
    text_q
    text_r
    text_s
    text_t
    text_u
    text_v
    text_w
    text_x

    Once you start building prompts out of pieces - a style fragment here, a subject from a wildcard there, a quality tag on the end - you need something to stitch those pieces into one string before it hits your text encoder. That's Text Concatenate. It merges several text inputs into a single output, with a delimiter you choose sitting between them.

    It's unglamorous plumbing, and that's exactly why it's everywhere. The node graph is great at splitting logic into small nodes; the moment you do that with text, you need a join. This is the join.

    How it works

    You feed it a handful of text strings and tell it what to put between them. Common choices are a comma-and-space for prompt tags, a single space for sentence-style prompts, or a newline when you're assembling something multi-line. It walks the inputs in order and glues them together with that separator. Empty inputs generally get skipped rather than leaving you with a dangling , , in the middle, which is the behavior you actually want when some of your fragments are conditional.

    One thing to know about WAS text nodes in general: the pack moved its text output type from ASCII to plain STRING back in mid-2023, precisely so it's clear what's flowing down the wire. If you're following an old tutorial that talks about ASCII outputs, that's the same thing under a new, saner name - the config flips use_legacy_ascii_text to false automatically.

    Inputs and outputs that matter

    The pieces that matter are the text inputs you wire in (or type directly) and the delimiter that separates them. Set the delimiter to , for tag-style prompts and you're 90% of the way to a clean concatenation. The output is a single STRING, which you then run into a CLIP Text Encode - or, if you're staying inside this pack, the Text to Conditioning node.

    Where this earns its keep is in combination with the rest of the WAS text toolkit: pull a line from a file with Text Load Line From File, run a Text Find and Replace to swap a token, then Concatenate it onto your base style. Each step is legible on its own instead of buried in one giant prompt box.

    How to install it

    ComfyUI Manager is the low-friction route: search was-node-suite-comfyui, install, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/WASasquatch/was-node-suite-comfyui
    

    then install requirements (pip install -r requirements.txt in your ComfyUI venv, or the python_embeded variant on a portable build) and restart. The text nodes are pure Python string handling, so they don't pull in any heavy models or libraries of their own - the weight of this pack lives in its image and model nodes, not here.

    Common issues & troubleshooting

    Everything comes out mashed together with no spaces. Your delimiter is empty. If you want tags, set it to , ; if you want a running sentence, set it to a single space. A blank delimiter concatenates with nothing between, which is occasionally what you want and usually not.

    A stray comma or double separator shows up. That's usually one of your inputs being an empty-but-not-null string with its own trailing punctuation. Trim your fragments upstream, or lean on a Find and Replace to clean up doubles before encoding.

    The output looks like a list, not a string. Note the README lists two similarly named things - one merges plain strings, one merges lists of strings. If you wired a list-typed source in, you may have grabbed the list variant. Make sure your inputs are string text, not a text list, when you want a single joined prompt.

    The whole pack won't import after updating ComfyUI. This is the well-known WAS Node Suite headache, not a text-node bug. The suite downgrades a few packages for its older modules, so a ComfyUI update can knock the import over on startup. Re-run the pack's requirements.txt against the activated ComfyUI venv (or use its install.bat). The suite has been maintenance-only since late 2023, so budget for the occasional post-update reinstall.

    CategoryWAS Suite/Text

    Inputs (26)

    NameTypeDefaultDescription
    delimiterSTRING, Put between the joined pieces; STRING. Eg: ', ' for a prompt, for one per line, empty to run them together.
    clean_whitespaceBOOLEANtrueTrim whitespace off each piece before joining. `on` also drops a piece holding only spaces.
    text_aoptSTRINGFirst piece to join; STRING. Joined with delimiter; empty pieces are skipped. Eg: masterpiece
    text_boptSTRINGPiece 2; STRING. Empty is skipped.
    text_coptSTRINGPiece 3; STRING. Empty is skipped.
    text_doptSTRINGPiece 4; STRING. Empty is skipped.
    text_eoptSTRINGPiece 5; STRING. Empty is skipped.
    text_foptSTRINGPiece 6; STRING. Empty is skipped.
    text_goptSTRINGPiece 7; STRING. Empty is skipped.
    text_hoptSTRINGPiece 8; STRING. Empty is skipped.
    text_ioptSTRINGPiece 9; STRING. Empty is skipped.
    text_joptSTRINGPiece 10; STRING. Empty is skipped.
    text_koptSTRINGPiece 11; STRING. Empty is skipped.
    text_loptSTRINGPiece 12; STRING. Empty is skipped.
    text_moptSTRINGPiece 13; STRING. Empty is skipped.
    text_noptSTRINGPiece 14; STRING. Empty is skipped.
    text_ooptSTRINGPiece 15; STRING. Empty is skipped.
    text_poptSTRINGPiece 16; STRING. Empty is skipped.
    text_qoptSTRINGPiece 17; STRING. Empty is skipped.
    text_roptSTRINGPiece 18; STRING. Empty is skipped.
    text_soptSTRINGPiece 19; STRING. Empty is skipped.
    text_toptSTRINGPiece 20; STRING. Empty is skipped.
    text_uoptSTRINGPiece 21; STRING. Empty is skipped.
    text_voptSTRINGPiece 22; STRING. Empty is skipped.
    text_woptSTRINGPiece 23; STRING. Empty is skipped.
    text_xoptSTRINGPiece 24; STRING. Empty is skipped.

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGThe connected inputs joined in socket order, separated by the delimiter.