Nodes/ComfyUI-ZML-Image/ZML_布尔反转
ComfyUI Node

ZML_布尔反转

The one-node NOT gate ComfyUI didn't give you

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_布尔反转
    • 反转后布尔值
    布尔值false

    ComfyUI will happily hand you a true when you need a false, and then you spend ten minutes staring at a wire. ZML_BooleanInverter (ZML_布尔反转) is the smallest possible fix: one boolean in, the opposite boolean out. It's a NOT gate. That's the whole node, and honestly it's refreshing to review a node this honest about what it does.

    What it is

    A single-widget logic node from ComfyUI-ZML-Image's logic section. One input:

    • 布尔值 (BOOLEAN, default false) - whatever value you're inverting.

    One output:

    • 反转后布尔值 (BOOLEAN) - true becomes false, false becomes true.

    There is no configuration, no mode dropdown, no secret second feature. The source is literally return (not 布尔值,).

    Why it exists and when you'll use it

    Boolean plumbing in ComfyUI is surprisingly unglamorous. The stock switch nodes and the pack's own switches gate on booleans, and it's extremely common to want the opposite condition - "run the fallback when this is not on," "enable the negative path when the main path is disabled." Without an inverter you end up either writing the workflow twice or flipping a toggle and re-engineering the branch. Drop this node in front of any boolean-consuming input and the logic reads the way you meant it.

    Install and gotchas

    Same as the whole pack:

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

    or ComfyUI Manager → ComfyUI-ZML-Image, restart.

    There is basically nothing to get wrong with this node, which is the nicest thing you can say about a utility. The only real caution is the surrounding ecosystem: many ComfyUI widgets don't take a boolean wire - they're toggle widgets on the node itself - so an inverter only helps when the target is a socket input. To feed it, either use a ZML BooleanSwitch upstream or convert a widget to an input and wire the inverted value in. 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 a node this simple is about as bug-proof as the pack gets.

    Categoryimage/ZML_图像/逻辑

    Inputs (1)

    NameTypeDefaultDescription
    布尔值BOOLEANfalse

    Outputs (1)

    NameTypeDescription
    反转后布尔值BOOLEAN