Nodes/LiamUtil/Merge Text @Liam
ComfyUI Node

Merge Text @Liam

Three strings, one output, zero magic

By ai-liam·Created 2 years ago·Updated 2 years ago· 2
Merge Text @Liam
    • STRING
    text1
    text2,
    text3

    The plumbing tier of any ComfyUI workflow is string handling, and this node is about as plumbing as it gets: it concatenates three text inputs into one string. Wire a subject into text1, a comma into text2, a style tag into text3, and out comes subject, style tag ready for a CLIP Text Encode. That's the whole job, and honestly it's a nice shape for prompt building - three slots is exactly the "base, separator, suffix" pattern people end up hand-wiring with less obvious tools.

    There's one subtlety worth knowing before you lean on it: the merge is a literal concatenation. text1 + text2 + text3, no spaces inserted, no smart joining. The reason the middle slot defaults to , is precisely so you get the comma-and-space separator you probably wanted between the other two - it's a separator field by convention, not by logic. If text1 already ends in a space, you'll get a double space; if you want two commas between parts, you'll get them.

    Inputs and outputs

    • text1 - the first part (default empty).
    • text2 - the middle part. Defaults to ,, which makes it your separator in practice.
    • text3 - the last part (default empty).

    All three are multiline STRING fields, and you can wire other text nodes into any of them. Output: one STRING, the concatenation. It also displays the merged result in the node's UI on each run, which is a small but welcome touch when you're debugging a prompt.

    How it works

    Straight text1 + text2 + text3 in Python - there is no delimiter option, no template, no trimming. What you see in the three boxes is exactly what lands in the output, in order.

    Installing it

    Ships in LiamUtil:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ai-liam/comfyui-liam
    pip install -r requirements.txt
    

    or via ComfyUI Manager (search LiamUtil) and restart. Only dependency is opencv-python.

    Where people get burned

    The separator convention trips up people who assume a join-with-comma. If you put text in text2 expecting it to be joined between the others with automatic punctuation, no - you're responsible for the separator, and the default comma is in the middle slot. Leave text3 empty and it contributes nothing, which is fine. And since there's no trimming, trailing whitespace in any field rides along into your prompt - which can be a silent source of those weird "why is there a gap" CLIP encodings. If you need smarter string work (templating, regex, case handling), grab a dedicated text-utility pack; this one is deliberately simple, and for simple joins it's genuinely the right tool.

    CategoryLiam/text

    Inputs (3)

    NameTypeDefaultDescription
    text1STRING
    text2STRING,
    text3STRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING