ComfyUI Node

TK 文本合并

The boring four-slot text joiner you'll wire into everything

By Ararararararaki·Created 3 months ago·Updated about 16 hours ago· 10
TK 文本合并
    • text
    text_a
    separator逗号 ,
    text_b
    text_c
    text_d

    No one searches for a text-joining node. Then you build your first real Anima workflow, end up with a lighting node, a clothing node, a trigger-word node and a camera node all producing strings, and realise a CLIP text encode takes exactly one.

    TK 文本合并 is four string slots and a separator. That's it. It's part of TK Toolkit (anima-toolkit by 时运tk), the pack built around Anima, and it exists for precisely the reason above: the pack authors other nodes that each emit one piece of a prompt, and something has to put those pieces together.

    How it works

    It joins text_a through text_d in fixed order, skipping any slot that's empty or whitespace, using the separator you chose. The separator enum is 逗号 , / 空格 / 换行 / 无 - comma, space, newline, or nothing at all.

    The comma mode does one extra thing that earns the node its keep: after joining, it collapses runs of commas and strips a leading or trailing comma. This matters because tag lists come with commas already attached. The upstream lighting_prompt from TK 光影提示词 ends in a trailing comma by design, so a naive join gives you soft lighting, , smile - ugly in the prompt box and technically two adjacent separators the tokenizer sees. This node eats that.

    Inputs and output

    • text_a - required, and it's the only required one.
    • separator - 逗号 , is the sane default for tag-style prompts. 换行 is for block-structured prompts; 无 is for gluing literal fragments like a filename prefix.
    • text_b, text_c, text_d - optional sockets. Unwired slots simply contribute nothing.

    One output, text, type STRING. Wire it straight into a CLIP text encode.

    The workflow it's actually for

    Once you use more than one TK prompt node, you want them separate rather than pasted into one box, because each one has its own controls and you want to change them independently. So the shape ends up like:

    TK 光影提示词 · lighting_prompt  → text_a
    TK 服装抽卡 · 服装提示词          → text_b
    TK 触发词 · trigger_words        → text_c
    TK 可动素体相机 · 相机提示词      → text_d
                                            ↓
                                      TK 文本合并 · text
                                            ↓
                                      CLIPTextEncode (positive)
    

    Now nudging the lighting preset doesn't touch the outfit, and swapping the outfit doesn't mean re-typing your camera tags. This is the same reasoning behind every value/plumbing node in ComfyUI: one source, many consumers, and no copy-paste drift in between.

    Install

    Standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Ararararararaki/comfyui-anima-toolkit
    # restart ComfyUI
    

    ComfyUI Manager users: search TK Toolkit (registry id anima-toolkit). Requirements are just aiohttp and requests; both come in via requirements.txt. The node appears under TK/text.

    Where it disappoints

    Order is fixed. It's a→b→c→d, and there's no reordering widget. If prompt position matters to you - and on Anima, word order is what binds attributes, so it often does - you either re-arrange by rewiring, or reach for TK 字符串路由器, which lets you drag channels into the order you want. Text merge is the quick tool; the router is the one you use once the graph matters.

    It doesn't dedupe. Two upstream nodes emitting soft lighting gives you soft lighting, soft lighting. Usually harmless, occasionally not what you meant.

    The 无 separator will silently glue words together. blue skirt plus white socks with 无 gives blue skirtwhite socks. That's not a bug, but it surprises people who expected a space.

    It's strings only. No list handling, no formatting, no conditionals. If you need to join a batch of prompts, this isn't the node.

    CategoryTK/text

    Inputs (5)

    NameTypeDefaultDescription
    text_aSTRING
    separatorCOMBO逗号 ,4 options: 逗号 ,, 空格, 换行, 无
    text_boptSTRING
    text_coptSTRING
    text_doptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING