ZML_布尔开关
A toggle that doubles as a doorbell for your workflow
- 开关状态
Every workflow ends up with a switch you flip to turn a whole mode on or off, and the only question is which pack's toggle you'll adopt. ZML_BooleanSwitch (ZML_布尔开关) is this pack's entry: one boolean in, the same boolean out, wrapped in a JS-drawn toggle that the README brags about - there are two visual styles, a bar slider and a square button, and the toggle is scaled up to be actually clickable in a sea of tiny widgets.
What it is
A primitive-value node from ComfyUI-ZML-Image's logic section. The inputs and outputs are as minimal as they get:
- 启用 (BOOLEAN, default true) - the switch itself.
- 开关状态 (BOOLEAN) - passes it straight through.
That's it. One boolean in, one boolean out. The value is meant to be wired to something that consumes a boolean socket - a switch, a gate, a "run this branch only when true" condition in the pack's own logic family.
How it works and why it's more than a pass-through
Under the hood it's return (启用,) - the simplest possible node. The interesting part is the frontend: this is the node the README calls out for its JS-built toggle with "unlimited scaling" and two style options. The point of a dedicated node like this, versus just typing true into a widget, is the same one the node-plumbing layer makes about primitive nodes: it turns a value into a wire, so one toggle can fan out to many consumers, and its state lives in the graph where you can see it instead of buried in a widget. Wire one to five gates and you've got a single master switch for a whole workflow region.
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.
Two caveats, both ecosystem-level rather than node-level. First, a boolean output only helps nodes with boolean socket inputs - plenty of ComfyUI nodes only have widget toggles, so you'll often need "convert widget to input" on the target to make the wire land. Second, the fancy JS toggle renders in the browser UI, and the pack has a documented history of its web frontend having display quirks after updates (the README is full of "fixed a UI display bug" entries) - if the toggle looks wrong after a ComfyUI update, refresh hard or update the pack. It's a Chinese-labeled node in a Chinese-first pack (English patch at github.com/zml-w/ZZZ_ZML_English_Patch), one-person project, no English community - but there's genuinely nothing to get wrong with a pass-through switch, so it'll be fine.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| 启用 | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 开关状态 | BOOLEAN | — |