Nodes/ComfyUI-Nikosis-Nodes/Text Concatenate (nikosis)
ComfyUI Node

Text Concatenate (nikosis)

Text Concatenate (nikosis) — ComfyUI Node Guide

By Nikosis·Created about a year ago·Updated about a year ago· 2
Text Concatenate (nikosis)
    • STRING
    text_a
    text_b
    text_c
    text_d
    delimiter,
    clean_whitespacetrue

    This is the plumbing node - the one that seems too simple to write about until you're chaining four separate "String Concatenate" nodes by hand and wondering why nobody just gave you four text slots and a delimiter field. That's this node. It takes up to four text inputs, joins them with whatever separator you pick, and skips any slot you left empty instead of leaving you with stray commas.

    Why you'd reach for it

    Prompt-building workflows tend to fragment into pieces: a subject description you type by hand, a style fragment from a style-selector node, a camera-framing phrase from a camera-angle node, maybe a quality tag block. Each of those is its own STRING output, and at some point you need one final combined string to actually hand to CLIP Text Encode. That's the whole job here - it's the glue node that turns "four wires" back into "one prompt." It pairs naturally with this pack's own Styles Selector and Camera Angle Selector nodes for exactly that reason: pipe their positive_prompt outputs plus your own subject text into this, and you've got a complete prompt without manually copy-pasting anything.

    Inputs and outputs

    • text_a / text_b - required. These sit as widgets with an empty-string default, so you don't strictly have to wire anything into them to queue a run, but leaving one blank means that slot silently contributes nothing rather than throwing an error - worth knowing if your output looks shorter than expected.
    • text_c / text_d - optional extra slots for a third and fourth piece of text.
    • delimiter - what goes between the pieces. Defaults to ", ", which is the right call for most CLIP prompts. It also supports \n - type the literal two characters backslash-n into the field (it's a single-line box, so you can't just press Enter) and the node converts that into a real line break. That's genuinely useful if you're building a block-structured prompt for one of the newer LLM-encoded models, where separating a tag block from a natural-language description with an actual newline is part of how those prompts are meant to be structured.
    • clean_whitespace - strips leading/trailing whitespace from each piece before joining, defaults to true. Keeps you from ending up with double spaces or ragged padding when an upstream node hands you text with extra whitespace baked in.

    Output: a single STRING - the joined result. Feed it to CLIP Text Encode, chain it into another Text Concatenate for a longer pipeline, or drop it into a Save Text node if you're logging prompts.

    Installing it

    ComfyUI Manager, search "ComfyUI-Nikosis-Nodes," or manually: git clone https://github.com/Nikosis/ComfyUI-Nikosis-Nodes into ComfyUI/custom_nodes, pip install -r requirements.txt, restart. No models, no heavyweight dependencies - this is a text-manipulation node, there's nothing here that touches a GPU.

    Common issues

    Getting a blank or shorter-than-expected result. Check that text_a and text_b actually have something in them - either typed into the widget or wired from an upstream node. An unconnected required input with the default empty string won't error, it'll just quietly contribute nothing to the join, which is a much harder thing to spot than a crash.

    The \n delimiter isn't producing a line break. Make sure you typed the two characters \ and n in the delimiter field, not an actual line break (the field won't let you enter one directly since it's single-line). If your downstream node or preview is collapsing newlines back into spaces, that's the display, not the concatenation - check the raw string if you're unsure.

    Unexpected extra delimiters. The node ignores genuinely empty inputs, but "empty" means an empty string specifically. If an upstream node is handing you whitespace instead of a true empty string (a stray space, a newline), that slot won't be treated as skipped - turn on clean_whitespace or check what the upstream node is actually outputting.

    CategoryNikosis Nodes/text

    Inputs (6)

    NameTypeDefaultDescription
    text_aSTRING
    text_bSTRING
    text_coptSTRING
    text_doptSTRING
    delimiteroptSTRING,
    clean_whitespaceoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    STRINGSTRING