Prompt Join (NH)
Building prompts from fragments without the comma soup
- result
- count
ComfyUI is full of small annoyances, and hand-assembling a prompt from pieces is a classic. You've got a subject fragment, a style fragment, a quality tail, and you're typing them together with commas in your head - which works until one of them is empty and your prompt reads a portrait of, , masterpiece. Prompt Join (NH) is the small, boring node that fixes exactly that.
It takes up to five text inputs (text_1 through text_5), joins them with a separator you choose, and spits out a single result string. The defaults are already sensible: separator is ", " (comma-space) and skip_empty is on, so blank fragments are dropped before joining instead of leaving dangling commas. It also outputs count, the number of fragments that actually made it in - handy for logging or routing ("did we get a style term or not?").
The behavior under the hood is a touch stricter than you might expect: each fragment is stripped of surrounding whitespace before joining, and with skip_empty on, a fragment that's only whitespace counts as empty. So " portrait " becomes portrait, and a genuinely blank slot disappears. That whitespace cleanup is the difference between clean joins and accidental double spaces, and it's the main reason to use this over just wiring strings into a concatenate node.
What it's actually for
This shines wherever prompt fragments come from different places - a base-subject node, a style-preset node, a wildcard-ish selection, maybe a tag pulled out of a filename. Instead of one giant text box you have to edit in five places, each fragment lives in its own small node and Join assembles them. It's the prompt-engineering version of one-source-many-consumers: change the style fragment in one spot and every downstream prompt updates.
Where people get tripped up: it's a join, not a format. If you need {subject}, {style} <lora:thing:0.8> with different separators between each pair, or per-slot fallbacks, this node won't do it - that's Prompt Template (NH) territory. Also note the hard ceiling: five inputs. If you need eight fragments, chain two Joins or look at the Text Concatenate node, which goes up to 64.
Install
Part of the NH-Nodes pack, so the usual:
- ComfyUI Manager → search NH-Nodes → install → restart ComfyUI. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
pip install -r requirements.txt
Then restart ComfyUI.
No models, no extra deps - it's a plain text node.
Common issues
Most problems here are expectations, not bugs. If your output has a comma stuck on the front, you've probably got a leading-space fragment that skip_empty doesn't catch (it's not empty, it's just whitespace-y - though the strip usually saves you). If the count output looks wrong, remember it counts joined fragments, not inputs. And if you turn skip_empty off, empty slots come through as empty strings - which is exactly when you'll see the double-comma soup this node was built to prevent.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| separator | STRING | , | — |
| skip_empty | BOOLEAN | true | — |
| text_1opt | STRING | — | |
| text_2opt | STRING | — | |
| text_3opt | STRING | — | |
| text_4opt | STRING | — | |
| text_5opt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |
| count | INT | — |