Join Text
The other half of Split Text, with a free prefix and suffix
- text
Join Text is the inverse of Split Text - if Split Text is the knife, this is the glue. It takes a list of strings, stitches them together with a delimiter you choose, and optionally wraps the whole result with a prefix and suffix. If you split a string apart to work on the pieces, Join Text is how you put it back together when you're done.
What it does
A list like ["red", "green", "blue"] with join_with=", " becomes "red, green, blue". The prefix and suffix fields wrap the final result - handy for adding "best quality, " to the front or ", masterpiece" to the back of a reconstructed prompt without extra nodes.
The natural workflow is a round trip: Split Text breaks a tag list into elements, you (optionally) transform each piece with other nodes in this pack, then Join Text reassembles a single string for your prompt encoder. ComfyUI's prompt encoder wants one STRING; Join Text is what takes the list back down to one.
How it works
The node declares itself list-input (INPUT_IS_LIST), so the text input is a list of strings. The logic is prefix + join_with.join(text) + suffix - Python's str.join, nothing fancier. Join with ", " and you get comma-separated; join with "\n" and you get newline-separated; join with "" and you get concatenation.
Inputs:
- text - the list of strings to join. Wired in (a Split Text output is the classic source; this input is
forceInput, so there's no text box). - join_with - the separator, default
", ". Typeable. - prefix - text placed before the joined result, default empty.
- suffix - text placed after, default empty.
Output: text, a single STRING.
How to install it
From exectails/comfyui-et_stringutils ("String Utils"). ComfyUI Manager → search "String Utils", or:
cd ComfyUI/custom_nodes
git clone https://github.com/exectails/comfyui-et_stringutils
Restart, and it appears under exectails/Strings. No dependencies, no models, pure stdlib - a boring, safe install.
Common issues
Two things get people:
- The tooltip on
textsays "The text to replace in." That's a copy-paste slip from the pack's Text Replacer node, not a description of what this input does. It's the list you're joining - trust the node name, not the tooltip. - Round trips don't preserve the original unless the delimiters match. If you split on
","and join on", ", you get comma-space back, not your original. Also, if your split produced empty elements (consecutive delimiters), Join Text happily re-joins those empties - you get the gap back, not a cleaned string.
Beyond that it's hard to misuse: join a single element and you get it back with prefix/suffix applied. It's one of those nodes that's invisible when the workflow is working, and that's exactly what you want from it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | The text to replace in. | |
| join_with | STRING | , | The string to join the elements with. |
| prefix | STRING | A string to place before the text. | |
| suffix | STRING | A string to place after the text. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |