Nodes/ComfyUI-nhknodes/πŸ“ Text Combiner (nhk)
ComfyUI Node

πŸ“ Text Combiner (nhk)

Glue as many text inputs as you want into one string β€” with a separator you control

By EnashkaΒ·Created 12 months agoΒ·Updated 28 days agoΒ· 23
πŸ“ Text Combiner (nhk)
    • combined_text
    β—„separator\nβ–Ί

    Assembling a prompt from parts is the most common text chore in ComfyUI, and it's usually done by hand-wiring a chain of "concatenate" nodes that caps out after a fixed number of inputs. TextCombiner throws that away: it gives you unlimited text sockets that appear as you connect them, and joins everything into one string. The only thing you configure is the separator. That's the entire node, and for prompt-building it's genuinely the right amount of node.

    It's part of the nhk/text category in the nhknodes pack, a collection that leans hard on dynamic inputs - same trick powers the pack's TextTemplate nodes and the image grid nodes. If you've used those, TextCombiner feels immediately familiar.

    How it works

    On the front end, a small JS extension adds a fresh text socket every time you connect one, so you're never counting sockets or running out. On the back end the node collects every connected input whose name starts with text and whose value is a non-empty string, then joins them with the separator.

    The separator is where the flexibility lives. It's a plain string with two escape codes:

    • \n β†’ newline (the default - one input per line)
    • \t β†’ tab

    So separator = "\n" stacks your parts as lines, ", " gives you comma-joined keywords, and "---" inserts a divider. Empty inputs are skipped, which means you can leave a slot unwired or empty and it won't leave a hole or a dangling separator in the output.

    Output is a single combined_text STRING, ready to feed a CLIP text encoder or into another text node.

    Installing

    No special steps beyond the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Enashka/ComfyUI-nhknodes
    

    or ComfyUI Manager β†’ search "NHK Nodes" β†’ install β†’ restart. It shows up under nhk/text, no extra dependencies.

    Where people get burned

    • "The \n shows up literally in my prompt." That's the escape working as designed - if you want a literal backslash-n in the output, you don't. And if you paste \n into the separator and see line breaks, that's correct behavior, not a bug.
    • "My empty slot added a blank line." Actually it shouldn't - empty strings are filtered out before joining. If you're seeing gaps, check that the empty input is really empty (whitespace counts as non-empty).
    • Inputs that don't start with "text" get ignored. The node only picks up the dynamic text sockets it creates. If you're feeding it from a source that lands on a differently-named socket, it won't be included.

    For a node this simple there's not much else to say. If you've ever tried to keep a six-input concatenate node tidy - or cursed at a workflow that ran out of sockets - TextCombiner is the version you'll reach for without thinking. It's one of those quiet utilities you install as part of a pack and end up using in every workflow.

    Categorynhk/text

    Inputs (1)

    NameTypeDefaultDescription
    separatorSTRING\nSeparator between combined texts (\n=newline, \t=tab)

    Outputs (1)

    NameTypeDescription
    combined_textSTRINGβ€”