Nodes/ComfyUI_Text_Tools_SG/Text Tools Merge Text Multi-SG
ComfyUI Node

Text Tools Merge Text Multi-SG

Reorder and toggle them without touching a wire

By ShammiG·Created 9 months ago·Updated 6 months ago· 7
Text Tools Merge Text Multi-SG
    • merged_text
    text_order
    custom_order1,2,3
    separator,
    insert_separatorBefore, Between, After
    text_1
    ⬆️_enable_1true
    text_2
    ⬆️_enable_2true
    text_3
    ⬆️_enable_3true
    text_4
    ⬆️_enable_4true
    text_5
    ⬆️_enable_5true

    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_1 through text_5 - your fragments. text_1 and text_2 are required (they're there with empty defaults), text_3text_5 are optional. Put anything in one of the empty slots and it just works.
    • ⬆️_enable_1 through ⬆️_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…) or Custom, where custom_order takes an index list like 3,1,2 (default 1,2,3). Note that indices are 1-based and refer to slots, not to what's currently enabled.
    • separator (default ", ") and insert_separator (default Before, 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.

    Categorytext

    Inputs (14)

    NameTypeDefaultDescription
    text_orderCOMBO2 options: Sequential, Custom
    custom_orderSTRING1,2,3
    separatorSTRING,
    insert_separatorCOMBOBefore, Between, After8 options: None, Before, After, Between, Before and After, Before and Between, +2
    text_1STRING
    ⬆️_enable_1BOOLEANtrue
    text_2STRING
    ⬆️_enable_2BOOLEANtrue
    text_3optSTRING
    ⬆️_enable_3optBOOLEANtrue
    text_4optSTRING
    ⬆️_enable_4optBOOLEANtrue
    text_5optSTRING
    ⬆️_enable_5optBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    merged_textSTRING