Nodes/ComfyUI-ZML-Image/ZML_合并文本(动态)
ComfyUI Node

ZML_合并文本(动态)

Join up to twenty text inputs with a separator you actually control

By zml-w·Created about a year ago·Updated 3 months ago· 232
ZML_合并文本(动态)
    • 合并文本
    • 文本列表
    ◄分隔符, ►
    ◄文本1—►
    ◄文本2—►
    ◄文本3—►
    ◄文本4—►
    ◄文本5—►
    ◄文本6—►
    ◄文本7—►
    ◄文本8—►
    ◄文本9—►
    ◄文本10—►
    ◄文本11—►
    ◄文本12—►
    ◄文本13—►
    ◄文本14—►
    ◄文本15—►
    ◄文本16—►
    ◄文本17—►
    ◄文本18—►
    ◄文本19—►
    ◄文本20—►

    The text-joining workhorse of the ZML pack: up to twenty inputs, one separator, two outputs. It's the node that answers "how do I glue five prompt fragments together without writing a small app to do it."

    The "dynamic" in the display name (ZML_合并文本(动态)) is the point - the README notes the node starts with a single input and a second one appears the moment you plug something into it. No pre-deciding how many text boxes you'll need; the node grows to fit your graph. If the pack has a theme, it's this: author ZML noticed ComfyUI could process lists and dynamic inputs "like n8n," and he leaned into it hard.

    What it does

    Inputs:

    • 分隔符 (default ,\n\n) - the glue between chunks. The default is the pack's house style: a comma plus two newlines, which keeps prompt fragments visually separated in the text box and in the final CLIP-encoded string. Change it to " " for plain-space joins or "\n" for line breaks. The literal \n in the widget is converted to a real newline at runtime.
    • 文本1 through 文本20 (all optional) - whatever you're joining. Empty inputs are skipped, so you can leave gaps in the numbering without getting ,, in your output.

    Outputs:

    • 合并文本 (STRING) - everything joined, with empty entries dropped. It also runs through the pack's punctuation formatter (format_punctuation_global), which cleans up stray commas and NAI-style weight syntax into SD-friendly formatting - a nice "the pack tidies your prompt for you" touch.
    • 文本列表 (STRING, list) - the same chunks as an actual list, no separator inserted. This is the output for the pack's batch/list machinery, the OUTPUT_IS_LIST output that lets downstream nodes iterate.

    Where you'd use it

    Prompt assembly is the obvious one: a base prompt fragment, a character fragment, a style fragment, an artist fragment - merge them with ,\n\n and feed the result into a CLIP Text Encode. But the list output is the quietly powerful half. The ZML pack (and ComfyUI's list handling in general - see the KB's node-plumbing doc) can fan a list out across batch processing, so merging twenty fragments into a list and letting downstream nodes iterate over them is a legitimate workflow, not a hack.

    Install

    Standard ZML pack install - you get all 160+ nodes at once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-ZML-Image
    # restart ComfyUI
    

    or via ComfyUI Manager → search "ComfyUI-ZML-Image". No dependencies beyond the pack baseline. Chinese-first UI - 分隔符 is "separator," 合并文本 is "merged text" - and English users can grab the translation patch at https://github.com/zml-w/ZZZ_ZML_English_Patch.

    It's one of the author's daily-driver nodes (prompt text tools are where the pack started, per the README's founding story about saving prompts), so it's had a lot of real-world mileage. The only thing to watch is the punctuation formatter: if it ever mangles text you didn't want touched, remember there's a sibling family of multi-text-input nodes with a 格式化标点符号 toggle for exactly that control.

    Categoryimage/ZML_图像/文本

    Inputs (21)

    NameTypeDefaultDescription
    分隔符STRING, —
    文本1optSTRING—
    文本2optSTRING—
    文本3optSTRING—
    文本4optSTRING—
    文本5optSTRING—
    文本6optSTRING—
    文本7optSTRING—
    文本8optSTRING—
    文本9optSTRING—
    文本10optSTRING—
    文本11optSTRING—
    文本12optSTRING—
    文本13optSTRING—
    文本14optSTRING—
    文本15optSTRING—
    文本16optSTRING—
    文本17optSTRING—
    文本18optSTRING—
    文本19optSTRING—
    文本20optSTRING—

    Outputs (2)

    NameTypeDescription
    合并文本STRING—
    文本列表STRING—