Nodes/isekai-comfy-node/Concatenate String
ComfyUI Node

Concatenate String

The glue that makes dynamic prompts possible

By isekai-sh·Created 9 months ago·Updated 8 months ago· 3
Concatenate String
    • concatenated_string
    delimiter
    text_a
    text_b
    text_c
    text_d
    text_e
    text_f
    text_g
    text_h
    text_i
    text_j

    IsekaiConcatenateString joins up to ten text inputs into one string with a delimiter. It sounds too boring to be interesting, and then you realize it's the node that turns ComfyUI into a prompt-building machine. Take a base prompt from one node, a character name from a dropdown, a style tag from a CSV, an LLM output from IsekaiClaude - glue them together with spaces or commas, and feed the result into a CLIP Text Encode. Without a concat node, every one of those combinations means editing text by hand.

    How it works

    Straightforward: up to ten optional inputs (text_a through text_j) get joined in order using your delimiter. Two behaviors worth knowing:

    • It skips empty inputs. Only non-empty strings make it into the result, so you can leave slots dangling and the output stays clean - no double spaces, no stray commas at the end. That's the difference between this and pasting strings together with + in your head.
    • Ordering is alphabetical (a before b before c...), which is exactly the order you'd expect. Empty slots are skipped, not turned into blank spaces.

    The delimiter defaults to a single space. Set it to , if you're building booru-style tag lists (SDXL-era models still want comma-separated tags), or \n if you're assembling a block for an LLM prompt. The forceInput flag on the text fields means you can wire any STRING output into them - that's what makes it glue rather than just a text box.

    The inputs that matter

    • delimiter - the string put between parts (default: space).
    • text_a through text_j - up to ten string inputs, all optional.

    Output is concatenated_string, a single STRING. Wire it to a CLIP Text Encode, another concat node (yes, you can chain), or an LLM prompt.

    Installing it

    Ships in isekai-comfy-node:

    ComfyUI Manager: search "isekai" → install isekai-comfy-node → restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/isekai-sh/isekai-comfy-node
    cd isekai-comfy-node
    pip install -r requirements.txt
    

    Restart and it's under Isekai → Dataset. Pillow and requests are the only deps - this node doesn't even need Pillow to function, it's pure Python string work.

    Common issues

    The failure modes here are conceptual, not technical. If your generated prompt looks wrong, check the delimiter first: a space vs a comma changes everything for tag-based models. And remember that ComfyUI evaluates the graph once per queue run - if you're building prompts from a random or dynamic source, the concat node will faithfully assemble whatever came out of that source, garbage and all. Garbage in, garbage out is not a bug.

    One genuinely useful combo: concat the output of IsekaiDynamicString (random selection) with a fixed style suffix, so the style stays constant while the subject varies per seed. That's the pattern half the dynamic-prompt workflows in the wild are built on, and it's two nodes doing one trivial job each.

    CategoryIsekai/Dataset

    Inputs (11)

    NameTypeDefaultDescription
    delimiterSTRING
    text_aoptSTRING
    text_boptSTRING
    text_coptSTRING
    text_doptSTRING
    text_eoptSTRING
    text_foptSTRING
    text_goptSTRING
    text_hoptSTRING
    text_ioptSTRING
    text_joptSTRING

    Outputs (1)

    NameTypeDescription
    concatenated_stringSTRING