Nodes/ComfyUI-Light-Tool/Light-Tool: Connect Text Strings
ComfyUI Node

Light-Tool: Connect Text Strings

Join up to eight strings plus a whole list — the pack's one-stop string splicer

By ihmily·Created 2 years ago·Updated 4 months ago· 20
Light-Tool: Connect Text Strings
  • string_list
  • text
string_1
string_2
string_3
string_4
string_5
string_6
string_7
string_8
delimiter

ComfyUI is a graph of typed wires, and one of the most common little chores is "glue a bunch of strings together into one prompt/tag/path." That's this node: up to eight individual string inputs (string_1 through string_8) plus one string_list input, all joined by a single delimiter into one output text string. It's the pack's grown-up version of Simple Text Connect, and it's the one you'll actually leave in your default graph.

What you set

Everything except the output is optional - wire only the slots you need. string_list takes a list/array (or a string) and gets merged in with the individual strings, which is what makes this useful: you can pipe in a generated list of tags from another node and splice them together with a fixed prompt fragment. delimiter is the glue - a comma, a space, a newline, whatever. Output is a single STRING named text.

Two behaviors worth knowing before you lean on them:

  • Empty values are skipped. The node filters out empty/falsy inputs before joining, so "a" + "" + "b" with a , delimiter gives you a,b, not a,,b. That's usually what you want when building prompts from optional fragments - but if you were counting on a literal empty slot (say, for a CSV row), it'll surprise you.
  • The list input is flattened in. If string_list is a list, its items join alongside the individual strings in the order it was passed.

Where it fits

Prompt engineering is the obvious home: stitch subject + style + quality fragments from separate input nodes into one CLIP-encodable string, or assemble tag lists. It's also the right node for building file paths, delimited data, or anything that's "N strings plus a separator." This pack is text-heavy on purpose - it ships an Input Text node, a Text Replace node, and Show Text - and Text Connect is the hub that makes the fragments useful. The KB's prompt-engineering notes make the same point: ComfyUI workflows live or die on being able to assemble strings from parts, and this is a clean, dependency-free way to do it.

Installing it

Part of ComfyUI-Light-Tool by Hmily. ComfyUI Manager → search "ComfyUI-Light-Tool" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/ihmily/ComfyUI-Light-Tool
pip install -r requirements.txt
# restart ComfyUI

Pure Python string work - no models, no keys, offline.

Where people get burned

  • Empty-string filtering. As above - don't rely on empty slots to create separators.
  • String-typed vs wildcard. string_list is a wildcard (*) input, so it accepts lists from other nodes; the individual strings are plain STRING. If a list won't wire in, it's because you're feeding a type the slot won't take.
  • Order assumptions. The join order is list-then-individuals as wired; if you need a specific ordering, wire accordingly or use Simple Text Connect for a two-part sequence.

If you've been chaining primitive "concatenate" nodes from other packs, this replaces a lot of them with one clean node.

CategoryComfyUI-Light-Tool/Text

Inputs (10)

NameTypeDefaultDescription
string_listopt*
string_1optSTRING
string_2optSTRING
string_3optSTRING
string_4optSTRING
string_5optSTRING
string_6optSTRING
string_7optSTRING
string_8optSTRING
delimiteroptSTRING

Outputs (1)

NameTypeDescription
textSTRING