๐ผ> Text Combine
Gluing two prompt strings together without fighting ComfyUI's string nodes
- text
Vanilla ComfyUI doesn't give you a clean way to stick two bits of text together. You end up either hardcoding everything into one giant text box, or reaching for a whole node suite (WAS, Impact Pack) just to get a string concat. Text Combine is the one-job answer: it takes two text inputs and joins them, with a separator you control.
That sounds almost too simple to write about, but it's the connective tissue in a lot of dynamic-prompt workflows. Say you've got a base subject prompt coming out of one text box and a style block ("cinematic lighting, 35mm film, shallow depth of field") coming out of another - maybe even picked randomly by YANC's own Text Pick Random Line. Text Combine is what stitches them into the single string your CLIP Text Encode actually wants. Same idea if you're building a filename or caption from a prefix plus something dynamic, like the file_name output of Load Image From Folder.
How it works
Nothing clever under the hood - it's a string join. text and text_append get concatenated, with delimiter inserted between them. If you want the two chunks on separate lines instead of side by side, add_empty_line throws a blank line in between rather than (or alongside) the delimiter.
The inputs and outputs that matter
textandtext_append(STRING, required) - your two pieces. Order matters:textcomes first,text_appendgets tacked on after.delimiter(default", ") - what sits between them. Leave it as a comma-space for tag-style prompts, clear it out if you're combining sentences that already end in punctuation, or swap it for a newline character if you want them stacked.add_empty_line(defaultfalse) - inserts a blank line between the two chunks. Handy if you're combining a positive-prompt block with a separate notes section and want visual breathing room, less useful for comma-separated tags.
One output: text, the combined string - wire it straight into a CLIP Text Encode, a Save Image filename field, or another Text Combine if you're chaining more than two pieces together.
How to install it
Easiest path is ComfyUI Manager: open it, search "yanc" or "YANC - Yet Another Node Collection," install, restart. Manually it's the standard drill:
cd ComfyUI/custom_nodes
git clone https://github.com/ALatentPlace/ComfyUI_yanc
then restart ComfyUI. There's no requirements.txt to run and nothing to download - the whole pack is pure Python string/image manipulation on top of libraries ComfyUI already ships with, so this is about as low-risk an install as custom nodes get. Keep ComfyUI itself reasonably current; the author calls that out explicitly in the README as the main thing that keeps the pack working.
Common issues & troubleshooting
The delimiter shows up when you don't want it. If one of your two inputs is sometimes empty (say text_append is fed by a conditional branch that can output nothing), you'll get a stray ", " at the end of your prompt. There's no built-in "skip delimiter if empty" toggle here - if that matters for your workflow, clear the delimiter and handle spacing inside the text itself, or gate the node so it only runs when both inputs are populated.
Nothing shows up at all. Both text and text_append are required inputs, not optional - if either one is unconnected, the node has nothing to combine. Feed it an empty string explicitly (a Text node with nothing typed in) rather than leaving the socket dangling.
You need more than two pieces. Text Combine only takes two inputs. For three or more, chain a second Text Combine off the output of the first - it's a small extra node, but it keeps each join's delimiter independently controllable, which a single "combine N strings" node usually doesn't let you do.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| text_append | STRING | โ | |
| delimiter | STRING | , | โ |
| add_empty_line | BOOLEAN | false | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | โ |