π§© Text Concatenator (4-Way)
Four strings in, one clean prompt out β empties skipped
- merged_text
"π§© Text Concatenator (4-Way)" is glue. It takes up to four strings and joins them into one, and it's worth having on your canvas for one reason: it skips the empty inputs. Wire three of four slots and leave the fourth dangling, and you get a clean three-part prompt instead of a ", , " scar down the middle. That single behavior is why it beats typing + strings by hand in half the places you'd think to.
How it works
Each input is optional and multi-line. The node strips whitespace off every fragment, drops the ones that are empty or None, joins the survivors with your separator, then strips leading/trailing junk and any trailing comma. It's deliberately forgiving plumbing - the kind of node that exists so the randomizers in this pack don't dump half-formed text into your sampler.
The one thing to decide is the separator, default "; ". That's a semicolon-space, which reads like a style-qualifier separator - good for joining a subject block to a lighting block to a camera block. If you're building comma-tag prompts instead, set it to ", " and the outputs behave like Danbooru tags. Since the node skips empties, the separator only ever lands between actual content, so switching separators is safe no matter how many inputs you use.
The inputs that matter
- separator - what goes between fragments. Default
"; "; switch to", "for tag-style. - input_1 through input_4 - the fragments. Optional, so leave unwired whatever you don't need.
Output: merged_text (STRING), straight into a CLIP Text Encode. Because empty inputs are dropped, the output is always clean - no separator soup.
Installing it
Same as the whole pack - no requirements.txt, no models, pure Python, README "TODO." but nothing to install besides the folder itself.
ComfyUI Manager β Custom Nodes Manager β search "TextRandomizer" β Install β Restart
or cd ComfyUI/custom_nodes && git clone https://github.com/fls-eugene/ComfyUI_TextRandomizer, then restart.
When to reach for it
This is the natural landing point after a randomizer: pick a subject with the Weighted Multiline Randomizer, pick lighting with another, and merge them here with the style block you always keep. The empty-skip behavior is the quiet killer feature - it means one workflow shape works whether you wire two, three, or four sources, and the graph doesn't break when you mute a branch. If you routinely need more than four sources, the pack also ships the 8-way version; it's the same engine with double the slots. If four is usually plenty, don't bother with the bigger one.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| separator | STRING | ; | β |
| input_1opt | STRING | β | |
| input_2opt | STRING | β | |
| input_3opt | STRING | β | |
| input_4opt | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| merged_text | STRING | β |