Nodes/NH-Nodes/Text Concatenate (NH)
ComfyUI Node

Text Concatenate (NH)

Up to 64 strings joined on one delimiter, without the mess

By jetthuangai·Created 6 months ago·Updated about a month ago· 7
Text Concatenate (NH)
    • text
    ◄string_count2►
    ◄delimiter/►
    ◄clean_whitespacetrue►
    ◄string_1►
    ◄string_2►
    ◄string_3►
    ◄string_4►
    ◄string_5►
    ◄string_6►
    ◄string_7►
    ◄string_8►
    ◄string_9►
    ◄string_10►
    ◄string_11►
    ◄string_12►
    ◄string_13►
    ◄string_14►
    ◄string_15►
    ◄string_16►
    ◄string_17►
    ◄string_18►
    ◄string_19►
    ◄string_20►
    ◄string_21►
    ◄string_22►
    ◄string_23►
    ◄string_24►
    ◄string_25►
    ◄string_26►
    ◄string_27►
    ◄string_28►
    ◄string_29►
    ◄string_30►
    ◄string_31►
    ◄string_32►
    ◄string_33►
    ◄string_34►
    ◄string_35►
    ◄string_36►
    ◄string_37►
    ◄string_38►
    ◄string_39►
    ◄string_40►
    ◄string_41►
    ◄string_42►
    ◄string_43►
    ◄string_44►
    ◄string_45►
    ◄string_46►
    ◄string_47►
    ◄string_48►
    ◄string_49►
    ◄string_50►
    ◄string_51►
    ◄string_52►
    ◄string_53►
    ◄string_54►
    ◄string_55►
    ◄string_56►
    ◄string_57►
    ◄string_58►
    ◄string_59►
    ◄string_60►
    ◄string_61►
    ◄string_62►
    ◄string_63►
    ◄string_64►

    There are a hundred ways to glue strings together in ComfyUI, and most of them leave stray spaces, double delimiters, or a pile of nodes on your canvas. Text Concatenate (NH) is the grown-up version: join up to 64 strings with a single delimiter, with whitespace cleanup built in, all in one node.

    The headline input is string_count, default 2, max 64 - it controls how many string slots the node shows. That's the feature that makes this different from a fixed-input join node: you set it to 3 or 12 or 40 and the node exposes exactly that many string_N inputs, no more, no clutter. Every slot is optional, and you can connect a text node into any of them.

    Then two things happen per input: it's stripped of surrounding whitespace (that's the clean_whitespace toggle, on by default), and everything gets joined with the delimiter between each piece. The default delimiter is /, which is a bit of a tell - this node was clearly built for building paths (filenames, folder paths, model paths) as much as prompts. Set the delimiter to , for prompt work or leave it as / for path assembly.

    The sharp edges

    Because slots are optional and whitespace is stripped, an unconnected or empty slot simply vanishes - no empty strings in the middle of your output, no a//b artifacts. That's usually what you want, but note the two ways it can still surprise you:

    • string_count controls visibility, not validity. If you raise it from 2 to 4, you get string_3 and string_4 sockets; lower it back and those inputs are hidden but their values aren't lost in a saved workflow you later re-expand. It's a display control, not a data delete.
    • It's a join, not a formatter. Every piece gets the same delimiter, so you can't do "comma between subjects, but a space before the style tag." For per-slot custom separators you're back to Prompt Join or a hand-built approach.

    The single output is text, a plain STRING, ready for a CLIP encoder, a filename node, or another text node. There's no count output here - if you need to know how many strings actually made it in, count them upstream.

    Install

    It's in the NH-Nodes pack:

    • ComfyUI Manager → search NH-Nodes → install → restart ComfyUI. Or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/jetthuangai/NH-Nodes.git
    cd NH-Nodes
    pip install -r requirements.txt
    

    Then restart ComfyUI.

    No models, no extra dependencies.

    Common issues

    The classic confusion is expecting a fixed number of inputs: you add a string to the graph and can't find the socket, because string_count was left at its default 2. Bump it and the slot appears. The other one is delimiter amnesia - a path that comes out as folderprompts/name because you forgot the leading slash on the delimiter. And if your output looks clean but the downstream node complains about empty strings, check clean_whitespace - turning it off will happily preserve those spaces you've been ignoring.

    CategoryNH-Nodes/Text

    Inputs (67)

    NameTypeDefaultDescription
    string_countINT22–64—
    delimiterSTRING/—
    clean_whitespaceBOOLEANtrue—
    string_1optSTRING—
    string_2optSTRING—
    string_3optSTRING—
    string_4optSTRING—
    string_5optSTRING—
    string_6optSTRING—
    string_7optSTRING—
    string_8optSTRING—
    string_9optSTRING—
    string_10optSTRING—
    string_11optSTRING—
    string_12optSTRING—
    string_13optSTRING—
    string_14optSTRING—
    string_15optSTRING—
    string_16optSTRING—
    string_17optSTRING—
    string_18optSTRING—
    string_19optSTRING—
    string_20optSTRING—
    string_21optSTRING—
    string_22optSTRING—
    string_23optSTRING—
    string_24optSTRING—
    string_25optSTRING—
    string_26optSTRING—
    string_27optSTRING—
    string_28optSTRING—
    string_29optSTRING—
    string_30optSTRING—
    string_31optSTRING—
    string_32optSTRING—
    string_33optSTRING—
    string_34optSTRING—
    string_35optSTRING—
    string_36optSTRING—
    string_37optSTRING—
    string_38optSTRING—
    string_39optSTRING—
    string_40optSTRING—
    string_41optSTRING—
    string_42optSTRING—
    string_43optSTRING—
    string_44optSTRING—
    string_45optSTRING—
    string_46optSTRING—
    string_47optSTRING—
    string_48optSTRING—
    string_49optSTRING—
    string_50optSTRING—
    string_51optSTRING—
    string_52optSTRING—
    string_53optSTRING—
    string_54optSTRING—
    string_55optSTRING—
    string_56optSTRING—
    string_57optSTRING—
    string_58optSTRING—
    string_59optSTRING—
    string_60optSTRING—
    string_61optSTRING—
    string_62optSTRING—
    string_63optSTRING—
    string_64optSTRING—

    Outputs (1)

    NameTypeDescription
    textSTRING—