ZML_选择文本
Five prompt inputs, five switches — your on-canvas prompt switcher
- 文本
Most of the time your prompt comes from one place and you type it in once. But the moment you start A/B testing styles, or toggling a quality suffix, or keeping a "safe" and a "spicy" version of a prompt in the same workflow, you need a switch. ZML_SelectText is the version of that idea where the text itself lives outside the node: five optional input sockets, each with a matching on/off toggle, and whatever's enabled gets joined together and passed out as one string.
This is the one to use when your prompt text comes from somewhere else - a text file loader, a tag loader, another ZML text node - and you want to route between sources. If you'd rather type the prompts straight into the node, its sibling ZML_SelectTextV2 is the same thing with the text boxes built in.
The inputs that matter
There are really two groups:
- 文本1 … 文本5 (optional, force-input sockets) - wire whatever text you want. Unplugged inputs are simply skipped.
- 启用1 … 启用5 - the toggles, defaulting to 启用1 on and the rest off. Only enabled inputs get included in the output.
- 分隔符 - what's inserted between the enabled texts. Default is
,\n\n(comma, blank line) - the pack's standard prompt-joining separator, chosen so each prompt section stays visually distinct and CLIP sees the commas.
The node then concatenates the enabled inputs in order, in this case joined by your separator. Output is a single 文本 string that feeds straight into a CLIP Text Encode or wherever your prompt goes.
Why you'd bother
The pattern is "one graph, several moods." Keep a base prompt on 文本1, a quality/detail block on 文本2, a style-adding block on 文本3 - flip toggles to test combinations without editing anything. Because the toggles are booleans, they also play nicely with logic nodes: an upstream condition can flip 启用2 for you, turning this from a manual switch into an automated one.
It's a thin node, and that's fine - the plumbing-layer value (see the KB's node-plumbing notes) is real even though the mechanism is two lines of Python. The one honest caveat: with five sockets and five switches the node gets a little busy on a crowded canvas, which is why the pack's later versions moved the text inside the node where you don't need five wires feeding in. Choose V1 when the text genuinely comes from elsewhere; choose V2 or V3 when it doesn't.
Install
Same pack, same dance: ComfyUI Manager → search "ComfyUI-ZML-Image", or cd ComfyUI/custom_nodes && git clone https://github.com/zml-w/ComfyUI-ZML-Image, restart. The node labels are Chinese (the display name is ZML_选择文本), so if that's not your language, install the English patch too. No models, no extra dependencies beyond what ComfyUI ships.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| 分隔符 | STRING | ,\n\n | — |
| 启用1 | BOOLEAN | true | — |
| 启用2 | BOOLEAN | false | — |
| 启用3 | BOOLEAN | false | — |
| 启用4 | BOOLEAN | false | — |
| 启用5 | BOOLEAN | false | — |
| 文本1opt | STRING | — | |
| 文本2opt | STRING | — | |
| 文本3opt | STRING | — | |
| 文本4opt | STRING | — | |
| 文本5opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 文本 | STRING | — |