Two Text Concat
The string joiner that skips empty boxes
- STRING
Two Text Concat joins two strings with a delimiter, but the useful part is what it doesn't join. Feed it an empty text box and it quietly drops it from the result, so you never get a leading comma dangling off a half-built prompt. It's the two-input workhorse of building prompts from parts: subject + style, base prompt + character tag, anything where one half might legitimately be blank.
The mechanism is small but smarter than the name suggests. It takes text_a and text_b, optionally strips leading/trailing whitespace from each, discards any input that's empty after cleaning, and joins the survivors with your delimiter. The output is always a string - even when every input is empty, you get "" back, not a crash. Two details worth knowing: if you set the delimiter to \n (or the literal two characters backslash-n), it becomes a real newline, which is handy for multi-line positive prompts; and the whitespace cleanup is a real choice, not a default - set clean_whitespace to false and a box full of spaces is treated as actual content instead of being stripped away.
The inputs and outputs
- text_a and text_b (STRING, optional) - both are
forceInput, meaning you can't type into them; you must wire strings in. That's deliberate: this node is for joining values that already exist elsewhere, not for hand-typing. - delimiter (STRING, default
", ") - what goes between the parts.", "is the right default for tag-style prompts. - clean_whitespace (enum,
true/false) - whether to strip edges and treat whitespace-only inputs as empty. - STRING - the joined result.
This is the lean cousin of the WAS Text Concatenate that the same pack re-implements as "Duck Text Concatenate." If you ever need to join more than two strings, the WAS fork handles up to five and is sitting right next to this node in the duckcomfy category.
How to install it
Part of the duckcomfy personal nodes pack, a personal utility collection that author duckcomfy re-implements from other packs to cut dependencies. ComfyUI Manager, search "duckcomfy personal nodes"; or:
cd ComfyUI/custom_nodes
git clone https://github.com/duckcomfy/duckcomfy_personal_nodes
Restart after cloning. No model files, no Python dependencies - the pack's pyproject.toml lists none, so this installs clean on any setup.
Gotchas
Because empty inputs are skipped, the join never leaves a trailing delimiter - which is exactly what you want, and also the thing to remember if you're surprised there's no comma after an intentionally blank box. And since the inputs are wire-only, you'll need a string source (a Primitive String, a wildcard node, or the pack's own Prompt Override Selector) feeding each slot; this node won't take typed text directly. That's a small friction cost for a node that otherwise behaves exactly as advertised.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| delimiter | STRING | , | — |
| clean_whitespace | COMBO | 2 options: true, false | |
| text_aopt | STRING | — | |
| text_bopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |