ComfyUI Node

Text Joiner

Turn a list of tags into one comma-separated prompt

By DebugPadawan·Created about a year ago·Updated 5 months ago· 2
Text Joiner
  • text_list
  • joined_text
delimiter,
prefix
suffix
skip_emptytrue

Lists are great until a node wants one big string. Text Joiner takes a list of strings and glues them together with a delimiter - the inverse of a text splitter. Feed it ["cinematic", "volumetric light", "8k"], set the delimiter to ", ", and out comes "cinematic, volumetric light, 8k", ready for the CLIP encoder. It's the node that makes tag lists and modular prompts actually work.

It's part of DebugPadawan's ComfyUI Essentials, a pure-Python utility pack. The mechanism is Python's str.join() with a couple of thoughtful options.

How it works

Two required inputs:

  • text_list - the LIST of items to join
  • delimiter - the string to put between items (default ", ")

Three optional inputs:

  • prefix - text prepended to the whole result (default empty)
  • suffix - text appended to the whole result (default empty)
  • skip_empty - BOOLEAN, default True: drop blank/whitespace-only items before joining

One output: joined_text - the combined STRING.

A few implementation details worth knowing. Every item is coerced with str(), so a list of numbers or mixed types joins fine. With skip_empty on (the default), ["a", "", "b"] joins as "a, b", not "a, , b". And the prefix/suffix wrap the entire result, not each item: prefix="Colors: " gives "Colors: red, green, blue".

Where you'll use it

  • Building prompts from parts. Assemble a prompt from a style list, a subject, and a quality tag, then join into one string for CLIP Text Encode.
  • Tag normalization. Join a deduplicated tag list (pair with the pack's List Deduplicator) into a clean comma-separated prompt.
  • Filenames and labels. Join tokens with "_" or "-" and add a prefix/suffix for structured names.
  • Reversing a split. If Text Splitter broke something apart, this puts it back together - great for round-tripping.

Installing it

Whole pack, one install. ComfyUI Manager, searching for "DebugPadawans-ComfyUI-Essentials," or:

cd ComfyUI/custom_nodes
git clone https://github.com/DebugPadawan/DebugPadawans-ComfyUI-Essentials

Then restart ComfyUI. Requirements (numpy, torch, opencv-python) are already satisfied by stock ComfyUI; no model downloads. Don't confuse the pack with cubiq's "ComfyUI Essentials" when searching Manager - a different, larger pack now in maintenance mode.

Gotchas

  • skip_empty defaults on. If you actually want to keep empty slots (e.g. joining fixed-width fields), flip it off.
  • Empty list gives just prefix + suffix - "" by default. Not an error, just empty output; check your upstream list if joined text keeps coming out blank.
  • The delimiter is a literal string, so a delimiter of ", " inserts a comma-space; "\n" won't produce newlines unless you actually pass a newline character.
  • Whitespace-only items count as empty when skip_empty is on (it checks .strip()).
  • Small, quiet pack - the source is the doc.
CategoryDebugPadawan/Text

Inputs (5)

NameTypeDefaultDescription
text_listLIST
delimiterSTRING,
prefixoptSTRING
suffixoptSTRING
skip_emptyoptBOOLEANtrue

Outputs (1)

NameTypeDescription
joined_textSTRING