Text Tools Merge Text Multi-SG
Reorder and toggle them without touching a wire
- merged_text
The two-input merge node covers the simple cases, but prompt building in real life isn't two fragments - it's subject, lighting, style, quality tag, and a wildcard you keep flipping. Text Tools Merge Text Multi-SG takes the same idea and scales it to five text slots with per-slot enable toggles, a reordering option, and full separator control. If you maintain a workflow with a dozen saved prompt fragments, this is the node that keeps them all in one box instead of a sprawl of Text nodes and math.
It comes from the ShammiG/ComfyUI_Text_Tools_SG pack, alongside the simpler two-input version. Pure string work - no models, no API keys, no GPU, nothing to download beyond the pack itself.
The inputs that matter
The full list looks intimidating, but you'll actually touch three things:
text_1throughtext_5- your fragments.text_1andtext_2are required (they're there with empty defaults),text_3–text_5are optional. Put anything in one of the empty slots and it just works.⬆️_enable_1through⬆️_enable_5- the killer feature. A checkbox per slot that switches that fragment in or out of the merge without unplugging anything. Want to A/B test whether the "cinematic lighting" tag stays? Toggle it and re-run. This is the "no need to disconnect noodles" promise from the README, and it's genuinely useful.text_order-Sequential(slot 1, then 2, 3…) orCustom, wherecustom_ordertakes an index list like3,1,2(default1,2,3). Note that indices are 1-based and refer to slots, not to what's currently enabled.separator(default", ") andinsert_separator(defaultBefore, Between, After) - same separator machinery as the two-input node, except the default is set to wrap the whole merged result.
The output is merged_text, a single STRING you can feed straight into CLIP Text Encode, a Save Text node, or the loaders that take a prompt string.
How it works
The Python is refreshingly honest. It collects the five slots, drops any that are disabled or empty, then either concatenates in slot order or follows your custom index list, applying the separator placement you chose. Two behavior quirks are worth knowing. First, empty and disabled are treated the same - an empty slot just doesn't participate, which is convenient but means you can't merge in a deliberate blank to create a spacing effect. Second, if custom_order references a slot that's disabled, it's skipped, and if you type garbage in custom_order, it silently falls back to sequential. No crash, just a default.
Install and gotchas
Same pack, same install - Manager or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/ShammiG/ComfyUI_Text_Tools_SG
then restart ComfyUI. No pip dependencies, no model files.
And the pack-wide caveat again, because it's in the README's opening warning: on ComfyUI 0.3.76+, disable Nodes 2.0 or the custom frontend widgets in this pack may misrender. The merge backend itself is just Python, so the logic runs regardless, but you're installing this for the tidy node UI, and that UI is written for the legacy canvas.
Worth it? If you've been stringing together five prompt parts with a formula node and an ever-growing separator expression, yes - this replaces all of it with checkboxes and a dropdown, and it makes your graph readable at a glance. If you only ever merge two strings, grab the smaller sibling instead; this one's power is the toggles and the reordering, and you don't pay for them if you don't use them.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| text_order | COMBO | 2 options: Sequential, Custom | |
| custom_order | STRING | 1,2,3 | — |
| separator | STRING | , | — |
| insert_separator | COMBO | Before, Between, After | 8 options: None, Before, After, Between, Before and After, Before and Between, +2 |
| text_1 | STRING | — | |
| ⬆️_enable_1 | BOOLEAN | true | — |
| text_2 | STRING | — | |
| ⬆️_enable_2 | BOOLEAN | true | — |
| text_3opt | STRING | — | |
| ⬆️_enable_3opt | BOOLEAN | true | — |
| text_4opt | STRING | — | |
| ⬆️_enable_4opt | BOOLEAN | true | — |
| text_5opt | STRING | — | |
| ⬆️_enable_5opt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| merged_text | STRING | — |