ComfyUI Node

textconcatenate

Concatenate up to 50 strings, because ComfyUI makes you build prompts in pieces

By MakkiShizu·Created 2 years ago·Updated about a year ago· 26
textconcatenate
    • text
    text_count3
    delimiter,
    clean_whitespacetrue
    replace_underscoretrue
    text_1
    text_2
    text_3
    text_4
    text_5
    text_6
    text_7
    text_8
    text_9
    text_10
    text_11
    text_12
    text_13
    text_14
    text_15
    text_16
    text_17
    text_18
    text_19
    text_20
    text_21
    text_22
    text_23
    text_24
    text_25
    text_26
    text_27
    text_28
    text_29
    text_30
    text_31
    text_32
    text_33
    text_34
    text_35
    text_36
    text_37
    text_38
    text_39
    text_40
    text_41
    text_42
    text_43
    text_44
    text_45
    text_46
    text_47
    text_48
    text_49

    ComfyUI has no built-in "join these strings together" node, which is absurd given how often you need one. The moment you start building prompts modularly - a fixed subject string here, a style string from a wildcard node there, a quality block from somewhere else - you're either juggling nodes or typing the whole thing into one box. textconcatenate is the glue: take up to 50 text inputs, join them with a separator, hand you back one clean string.

    The author's own comment in the source says it's a rework of the classic WAS Node Suite's Text Concatenate, so you're getting a well-trodden design with a slightly friendlier face. It's the natural companion to the pack's wildcard nodes: makiwildcards gives you a random scene fragment, makitextwildcards gives you a random line, and this stitches everything - plus your fixed text - into a single prompt string for a CLIP Text Encode.

    How it works

    The node has a text_count dial (1–50). Set it to 4 and you get four text fields, set it to 8 and you get eight - the unused fields hide themselves via the pack's frontend script, so you're not staring at 49 empty boxes. On run, it takes the active text inputs in order, drops any that are empty, optionally strips leading/trailing whitespace, optionally turns underscores into spaces, and joins the survivors with your delimiter.

    Two details worth knowing. First, empty strings are silently skipped, so text_count can be generous and the node just concatenates whatever is actually filled. Second, if you put \n in the delimiter field it becomes a newline - handy for line-break-separated prompts or negative-prompt blocks, and the same trick the wildcard nodes use.

    Inputs and outputs

    • text_count - how many text slots are active (default 3).
    • text_1 … text_N - the strings to join.
    • delimiter - separator between texts, default ", ".
    • clean_whitespace - strip the ends of each input (default on).
    • replace_underscore - turn _ into spaces (default on). This one earns its keep on danbooru-style tag lists where the model reads long_hair and long hair differently.

    Output is a single text string. Feed it into a positive prompt or negative prompt encode - for negatives it's especially nice, since a shared bad quality, blurry, watermark block can live in one input you reuse across workflows.

    Installation

    Part of the ComfyUI-Prompt-Wildcards pack. ComfyUI Manager: search "ComfyUI-Prompt-Wildcards". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MakkiShizu/ComfyUI-Prompt-Wildcards.git
    

    Restart ComfyUI. No extra Python packages, no model files.

    Common issues

    • Changing text_count doesn't show new fields. The show/hide is handled by the pack's JS. If you're on a fresh install, make sure you fully reload the frontend (hard refresh in the browser) after restarting ComfyUI so the extension registers.
    • Output has double separators. Check clean_whitespace. If a text input ends with a space and you also have a delimiter, you can get thing, , thing. The default cleaning usually prevents this; a pasted input with trailing spaces is the usual culprit.
    • Underscores you wanted to keep get replaced. That's what replace_underscore does - flip it off if you're joining text where _ is meaningful.

    It won't win any prizes for excitement, but it's the kind of node that quietly unblocks a dozen workflows. If you'd rather not count slots at all, the same pack's textconcatenate_v2 grows its inputs as you connect them - no text_count to think about.

    Categoryutils/Prompt-Wildcards

    Inputs (53)

    NameTypeDefaultDescription
    text_countINT31–50
    delimiterSTRING,
    clean_whitespaceBOOLEANtrue
    replace_underscoreBOOLEANtrue
    text_1STRING
    text_2STRING
    text_3STRING
    text_4STRING
    text_5STRING
    text_6STRING
    text_7STRING
    text_8STRING
    text_9STRING
    text_10STRING
    text_11STRING
    text_12STRING
    text_13STRING
    text_14STRING
    text_15STRING
    text_16STRING
    text_17STRING
    text_18STRING
    text_19STRING
    text_20STRING
    text_21STRING
    text_22STRING
    text_23STRING
    text_24STRING
    text_25STRING
    text_26STRING
    text_27STRING
    text_28STRING
    text_29STRING
    text_30STRING
    text_31STRING
    text_32STRING
    text_33STRING
    text_34STRING
    text_35STRING
    text_36STRING
    text_37STRING
    text_38STRING
    text_39STRING
    text_40STRING
    text_41STRING
    text_42STRING
    text_43STRING
    text_44STRING
    text_45STRING
    text_46STRING
    text_47STRING
    text_48STRING
    text_49STRING

    Outputs (1)

    NameTypeDescription
    textSTRING