ComfyUI Node

Boolean AND

The tiny gate that keeps your workflow from sampling when it shouldn't

By Stibo·Created 5 months ago·Updated 2 months ago· 9
Boolean AND
    • BOOLEAN
    a
    b

    Every workflow that grows past one sampler ends up asking "should this run at all?" Boolean AND is the three-cent answer: it only passes true when both inputs are true, and that's exactly the "everything is ready, go" condition you keep wanting.

    Why you'd reach for it

    In practice, these logic gates in ComfyUI aren't doing philosophy - they're gating. You chain them in front of a switch or a sampler so that an expensive generation only fires when, say, a checkbox is on and a value isn't None and a node you care about actually produced output. ComfyUI evaluates your whole graph, so a bare boolean can't stop execution by itself - but a boolean wired into a lazy switch or a bypass node absolutely decides which branch the graph bothers to run.

    It's the same job rgthree and every other utility pack's logic nodes do; this one just happens to be small, clear, and part of a pack that's built on the current comfy_api.latest v3 API, so it works on the Nodes 2.0 frontend without drama.

    The mechanism

    Two required boolean inputs - a and b - one boolean output. Output is true only if both inputs are true. That's it. There's nothing hidden here, which is the point: a gate this simple is easier to trust than a workflow that does its "should I run" math inside a big custom mega-node you can't inspect.

    The output is a BOOLEAN socket, so it drops straight into anything that takes a boolean - the boolean input on a switch, the bypass toggle on a bypass node, an enabled checkbox downstream.

    If you need more than two inputs

    Two operands is fine, but the moment you're stacking three or four conditions you'll want the sibling node in the same pack, Boolean AND All, which takes an auto-growing list of up to 16 booleans and returns true only if every connected one is true. Chain two ANDs if you must; reach for AND All if you do it more than once.

    Install

    This node ships in Nifty Nodes for ComfyUI. Manager route: ComfyUI Manager → search "Nifty Nodes for ComfyUI" → Install → restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Stibo/comfyui-nifty-nodes
    

    Then restart. No models, no API keys, no special dependencies for this one - it's pure Python logic. The pack is MIT-licensed and fairly new (v2.1.0 as of mid-2026), so keep it updated if a workflow complains.

    Gotchas

    The trap isn't the node, it's the expectation. A boolean alone doesn't stop the rest of the graph - ComfyUI still executes nodes that are connected. If you wire this into a lazy switch (the pack has Input Switch lazy/eager variants), the unused branch won't execute, which is the behavior you actually want for "don't run the upscaler when the checkbox is off." If you hook it into an eager node, both branches run regardless, and your gate becomes decoration. Know which of your downstream nodes is lazy before you trust the gate to save you compute.

    Categorynifty/logic

    Inputs (2)

    NameTypeDefaultDescription
    aBOOLEANFirst operand.
    bBOOLEANSecond operand.

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN