Nodes/Sage Utils/Join Text
ComfyUI Node

Join Text

Slam any number of strings together with a separator, then feed the result onward

By arcum42·Created 2 years ago·Updated 28 days ago· 33
Join Text
  • strings
  • str
separator,
add_separator_to_endfalse

Prompt assembly in ComfyUI is mostly just string concatenation with a separator, and ComfyUI's stock text-concat node makes you do it one pair at a time. Join Text (the node's display name; the class is Sage_DynamicJoinText) fixes the annoying part: it takes any number of string inputs - the input list grows as you add wires, up to 100 of them - and joins them all with a single separator. Add ten sources, one node, done.

The strings input is the autogrowing one: it's a dynamic multi-input socket that adds a new slot each time you connect another string. The separator defaults to ", " - the comma-space that prompt building runs on - and you can swap it for a newline, a pipe, anything. There's also add_separator_to_end (default off), which is exactly the option name suggests: it tacks the separator onto the end of the result. That's for when you're building a line that'll have more text appended later and want the separator already in place.

The mechanism is trivial under the hood - collect the inputs, separator.join(...) - but the ergonomics matter. The single str output plugs straight into a CLIP Text Encode, a metadata constructor, a text display, or anything else that wants a prompt string. This is the node that turns "keyword list + style string + LoRA keywords + quality tags" into one clean prompt line, and it composes perfectly with the pack's Collect Keywords From LoRA Stack (which gives you trigger words as a string you can feed in as one of the inputs).

When to reach for it over alternatives: if you're running Sage Utils anyway, this is the join node in the pack, and it's better than the core concat for anything beyond two strings. The autogrowing input list means no "add another text input" checkbox fiddling - just drag a wire in and a new slot appears. The one behavior to remember is that empty inputs are still inputs: if a source string is empty, you'll get doubled separators (e.g. "a, , b") unless you clean it up first with the pack's Clean Text or your source produces no empties. For a workflow where a branch is often empty, that's a real gotcha worth planning for.

Install

ComfyUI Manager → search Sage Utils → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt

Restart ComfyUI. No models, no keys; only dependency is the pack's dynamicprompts. Found under Sage Utils → text → helper.

CategorySage Utils/text/helper

Inputs (3)

NameTypeDefaultDescription
stringsCOMFY_AUTOGROW_V3Input value for strings.
separatorSTRING, String used to separate joined inputs.
add_separator_to_endBOOLEANfalseAdd separator to the end of the joined string.

Outputs (1)

NameTypeDescription
strSTRINGOutput value for str.