ZML_任意开关-五
Pass only what you switch on
- 输入1
- 输入2
- 输入3
- 输入4
- 输入5
- 输出1
- 输出2
- 输出3
- 输出4
- 输出5
ZML_AnyTypeSwitchFive picks one input from five. ZML_AnyTypeSwitchFiveBoolean (ZML_任意开关-五) is the "pick any subset" version: five inputs, five switches, five outputs, and each switch independently decides whether its own input makes it through to its own output. Turn on switches 1 and 3 and only those two values come out the other side - the rest are dropped. Same any-type flexibility, different job.
What it is
This is a set of five independent gates bundled into one node, and it's the most flexible of the pack's switch family because the booleans don't compete - 开关1 gates 输入1 → 输出1, and so on down the line. The natural use case is a "which of these do I want this run" panel. Say you have five optional enhancement images that should sometimes be baked into a composition and sometimes not: wire them all in, flip the toggles, and only the enabled ones flow to the downstream composer. It's the same null-output-placeholder idea the node-plumbing layer describes - an unselected branch deliberately emits nothing instead of garbage.
The inputs that matter:
- 开关1 … 开关5 (BOOLEAN, switch 1 defaults to true, the rest false) - the gates. In the UI they render as proper toggles with 开/关 labels, so it reads like a control panel rather than five text boxes.
- 输入1 … 输入5 (any type, all optional) - what you're gating.
Outputs are 输出1 … 输出5, each mirroring its input when the matching switch is on and passing nothing when it's off.
How it works
Two mechanics worth knowing. First, it's lazy, like the other switches: it tells the executor which input keys the enabled switches actually need, so upstream branches behind an off switch don't run. Second, the node is marked as an output node (OUTPUT_NODE = True), which changes execution flow - ComfyUI treats output nodes as the ends of execution and works backward from them, which is exactly what you want from a "gate a whole downstream branch" control. If every switch is off, there's nothing for downstream nodes to receive, and they simply don't run.
Install and gotchas
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image
or ComfyUI Manager → ComfyUI-ZML-Image, restart.
The thing that bites people here is subtle: because the outputs are all * type, a downstream node will happily accept the connection - but if its switch is off, the value never arrives, so the downstream node runs with None and may error or silently no-op depending on how it's written. That's not this node's bug, it's the nature of gating with any-type sockets. Also, the UI is Chinese-first; the English translation patch at github.com/zml-w/ZZZ_ZML_English_Patch makes the five toggles a lot less cryptic. And if you only ever need one of five, the plain AnyTypeSwitchFive is the simpler tool - this one earns its keep when you want several branches on at once. One-person pack, no English forum to ask - GitHub issues, or the Help outputs this pack loves, are your docs.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| 开关1 | BOOLEAN | true | — |
| 开关2 | BOOLEAN | false | — |
| 开关3 | BOOLEAN | false | — |
| 开关4 | BOOLEAN | false | — |
| 开关5 | BOOLEAN | false | — |
| 输入1opt | * | — | |
| 输入2opt | * | — | |
| 输入3opt | * | — | |
| 输入4opt | * | — | |
| 输入5opt | * | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| 输出1 | * | — |
| 输出2 | * | — |
| 输出3 | * | — |
| 输出4 | * | — |
| 输出5 | * | — |