Nodes/Painting Coder Utils/Text Combiner ✍️
ComfyUI Node

Text Combiner ✍️

Glue N text inputs into one string without a pile of concatenate nodes

By jammyfu·Created 2 years ago·Updated about a year ago· 16
Text Combiner ✍️
    • text
    separator,
    use_regexfalse

    Assembling a prompt from parts - a base prompt, a style chunk, a LoRA trigger, a quality suffix - is the most common text chore in ComfyUI, and doing it with a chain of concatenate nodes is clunky. Text Combiner lets you plug in as many text inputs as you need (the ports grow as you connect), pick a separator, and get one joined string out. It's the pack's workhorse text node, and it earns its place in almost any graph that builds prompts dynamically.

    It's part of the Painting Coder Utils pack, and it's a natural match for the pack's other text tools - feed it from Simple Text Input / Multiline Text Input, and watch the result in Show Text Plus 📝.

    How it works

    The node starts with a separator field (default ,) and a use_regex toggle, plus dynamic text input ports that appear as you connect (the same front-end trick as the pack's Dynamic Image/Mask inputs). Each connected input is split on the separator, empty chunks are dropped, and the survivors are joined back with the separator.

    The separator is where it gets interesting:

    • , joins with commas → base, style, quality
    • \n (leave it as a literal \n and the node decodes the escape) joins line-by-line
    • ,|\n with use_regex on supports both at once - split on commas or newlines, whichever appears
    • Empty separator joins with spaces

    A smart detail: if the separator contains a newline, the output is line-joined; otherwise it's separator-joined. And when nothing's connected yet, it returns a waiting message rather than an empty string, so you can pre-place the node in a workflow.

    Inputs and output

    • separator - the join string (supports \n and \r escapes; used as a regex if use_regex is on).
    • use_regex - treat the separator as a regular expression.
    • Dynamic text_N inputs - appear as you connect.
    • Output: text - the joined STRING.

    Where you'll use it

    Prompt assembly is the obvious job - separate concerns into their own inputs and combine them at the end, so tweaking one chunk doesn't mean editing one giant string. It's also great for building lists of tags, feeding multiline text into a batch processor, or joining pieces for filenames. Wire the result into a Show Text Plus to verify before it hits the text encoder, and you've got a tidy prompt pipeline.

    Install

    ComfyUI Manager → Painting Coder Utils, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jammyfu/ComfyUI_PaintingCoderUtils.git
    

    Restart ComfyUI. No models or keys anywhere in the pack; its dependencies (numpy, Pillow, torch, gradio) are already present in a stock ComfyUI. The dynamic ports need the pack's front-end JS to load - if you've disabled custom node front-ends you'll only see the separator fields. And the usual caveat for inherited workflows: v0.3.0 renamed the node namespace, fixable with the bundled docs/fix/workflow_fixer.html.

    Category🎨Painting👓Coder/📝Text

    Inputs (2)

    NameTypeDefaultDescription
    separatorSTRING,
    use_regexBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    textSTRING