ZML_合并文本(动态)
Join up to twenty text inputs with a separator you actually control
- 合并文本
- 文本列表
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\nin 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_LISToutput 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.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| 分隔符 | STRING | , | — |
| 文本1opt | STRING | — | |
| 文本2opt | STRING | — | |
| 文本3opt | STRING | — | |
| 文本4opt | STRING | — | |
| 文本5opt | STRING | — | |
| 文本6opt | STRING | — | |
| 文本7opt | STRING | — | |
| 文本8opt | STRING | — | |
| 文本9opt | STRING | — | |
| 文本10opt | STRING | — | |
| 文本11opt | STRING | — | |
| 文本12opt | STRING | — | |
| 文本13opt | STRING | — | |
| 文本14opt | STRING | — | |
| 文本15opt | STRING | — | |
| 文本16opt | STRING | — | |
| 文本17opt | STRING | — | |
| 文本18opt | STRING | — | |
| 文本19opt | STRING | — | |
| 文本20opt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 合并文本 | STRING | — |
| 文本列表 | STRING | — |