Merge Texts
Stitch prompt parts together with a separator, no more hand-joining
- STRING
Most good prompts are built from parts: a subject, a style, a quality tag block, maybe a LoRA trigger phrase you want to inject conditionally. ComfyUI's stock text nodes don't give you a clean way to merge those parts into one string - which is exactly what Merge Texts does. It takes any number of text inputs and joins them with a separator into a single STRING output. The clever part is how it handles those inputs: plug a text link in and the node grows another slot, automatically. Unplug it and the slot disappears.
How it works
The backend is dead simple. execute() joins every connected text value with your chosen separator and returns the merged string. What makes it feel like magic is the front-end widget. The node starts with a single free "text" input; when you connect a link, the widget renames the occupied slots (text_1, text_2, β¦), adapts each slot's type to whatever the upstream node actually outputs, and keeps a fresh empty "text" slot on the end ready for the next connection. Disconnect something and the slot is removed on the spot. There's also a read-only textarea on the node showing the merged result after each run, so you can eyeball the prompt before it ever reaches the CLIP encoder.
The inputs that matter
- separator (STRING, default
", ") - the one thing you actually set. Comma-space is right for joining positive-prompt tags. The field is a plain single-line box, so if you want line breaks, use a character like" | "or a comma rather than trying to type a newline.
Everything else is the dynamic text inputs you create by wiring. Output is a single STRING, which feeds straight into a CLIP Text Encode node as your positive prompt - or into a Textarea if you want to watch it land.
Why you'd reach for it
This is the standard "prompt builder" pattern, and it shines when parts of your prompt are conditional. Toggle a style branch on and off with a bypass and the merge drops it out of the string automatically. It's also handy for joining tag lists - say a base prompt plus trigger words read from a LoRA loader - into one coherent line without manual comma-pushing.
How to install it
ComfyUI Manager β search "ComfyUI AstroCorp Nodes" β install β restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/AstroCorp/ComfyUI-AstroCorp-Nodes
Restart and it's under "ππ AstroCorp ππ". Zero model downloads, zero real Python deps - the pack's pyproject.toml declares none (the tensorrt line in requirements.txt only matters for the pack's ONNX upscaler nodes).
Common issues
Two gotchas trip people up. First, Merge Texts is a pure joiner - there's no manual text entry. The "text" slot you see is a connection point, not a typing box, and the read-only textarea is display only. If you want a node where you type by hand, use the pack's Textarea instead.
Second, when a slot vanishes on disconnect, that's by design, not a bug. If you were mid-thought about what was plugged where, the renumbering can momentarily confuse - but that's the trade for not having forty empty inputs sitting on the node.
For a small personal pack with no community track record, this is a solidly built utility. It's not glamorous; it's the kind of node you forget is there until you're stuck doing string surgery by hand - and then you remember why you installed it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| separator | STRING | , | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |