Nodes/ComfyUI-Nodebox/String Combine
ComfyUI Node

String Combine

Glue your prompt together without the double-comma gap

By matchbull6·Created 2 months ago·Updated 2 months ago· 0
String Combine
    • combined_text
    prefix
    separator
    suffix
    option_1

    Ever generated a prompt and watched your CLIP Text Encode hand back something like portrait, , soft lighting? That's the classic seam: you'd built your prompt from a few separate text branches, one of them came up empty, and the join node faithfully glued in the blank. NDBX_StringCombine is the anti-seam node. It takes any number of connected text inputs, joins them into one string, and - the part that matters - silently drops any input that's empty or unconnected. No double commas, no orphan separators.

    Why you'd reach for it

    Prompt assembly. Real workflows rarely keep a prompt in one text box. You'll have a style block, a subject line, a pile of quality tags from a LoRA card, maybe the output of a dynamic prompt node - all living in separate nodes because they came from different places and you want to swap them independently. This node is the glue before CLIP Text Encode, and it's equally handy for assembling a multi-line negative prompt where each source contributes one line.

    The three widgets that actually matter

    • separator - the glue between your inputs. Default is "", so you will set this. ", " for booru-style tag prompts, "\n" for a line-per-entry negative prompt, " " if you just want words space-joined.
    • prefix - text prepended to the whole result (your fixed style opener, say).
    • suffix - text appended (a closing quality tag, or nothing).

    That's it. The option_1, option_2, … sockets are where your text comes in - and note these are forceInput sockets, so you can't type into them. Wire them from core Primitive String / String Multiline nodes or any other text-producing node. The single output, combined_text, feeds straight into CLIP Text Encode.

    How it actually works

    Reading the source, this is a join with a trim. It collects every connected option_N, sorts them numerically (so option_2 always lands after option_1 even if you wired them out of order), filters out any that are empty, then returns prefix + separator.join(values) + suffix. Nothing connected at all returns an empty string - so a partially-built graph degrades to nothing rather than to garbage.

    The growing socket list is the clever bit, and it's frontend work: a small JS extension watches your connections. Wire a cable into the last socket and a new one spawns; unplug trailing sockets and they get pruned; sockets always renumber to be contiguous. There's no "add input" button to hunt for - you just keep connecting.

    One quirk from that: to grow the list you need the newest socket connected. Leave option_1 dangling while you wire up option_5 and the renumbering does something that looks like reorganization.

    Installing it

    NDBX_StringCombine ships in matchbull6/ComfyUI-Nodebox, which also contains its sibling NDBX_WildcardCombine. Install once, get both. ComfyUI Manager → search "ComfyUI-Nodebox", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/matchbull6/ComfyUI-Nodebox
    

    Then restart ComfyUI. Good news: there's no requirements.txt, no model downloads, no heavy dependencies - it's pure Python plus one small JS file. Nothing to configure.

    The honest caveat

    This pack is young and unproven. The README frames it as tools "built while learning AI image generation" - a hobbyist author, and as of mid-2026 the pack has essentially zero community footprint. For a node this trivial that's fine: the logic is short, readable, and does what it says. Just don't treat a downloaded workflow that depends on it as standing on a big installed base - and if a workflow breaks, this tiny pack is not the first thing to suspect.

    CategoryNodebox

    Inputs (4)

    NameTypeDefaultDescription
    prefixSTRING
    separatorSTRING
    suffixSTRING
    option_1optSTRING

    Outputs (1)

    NameTypeDescription
    combined_textSTRING