Nodes/DD-LogicNodes/DD And Gate
ComfyUI Node

DD And Gate

The \"everything's ready, go\" check

By dumbdemon·Created 6 months ago·Updated a day ago· 0
DD And Gate
    • *
    expression1true
    expression2true

    The AND gate is the polite one: it only says yes when every condition agrees. Wire two booleans into it and you get true back exactly when both are true - one false and it collapses to false. If you've ever wanted ComfyUI to do anything resembling an if statement, this is a piece of the puzzle, because the node graph has no native "if both these things then do that." You build it out of gates like this plus a value router.

    It lives in the DD Logic Nodes/Logic Gates section, in the small DD-LogicNodes pack from DumbDemon. ComfyUI actually ships basic comparison and switch nodes, but not a tidy set of boolean gates, and that's the gap this pack fills.

    What it does

    Two inputs, expression1 and expression2, both plain BOOLEAN (both default to true on the node). One output, named *, which is just a boolean. The math is exactly Python's expression1 and expression2:

    • true AND truetrue
    • anything else → false

    There's no hidden state, no sampling, no caching. It's a two-line function wrapped in a node, and being that boring is the point - a condition you can read at a glance beats a tangle of comparisons feeding a switch.

    Why you'd actually reach for it

    Gates earn their keep when you have more than one thing that has to be true before an expensive step runs. A classic setup: "only run the face detailer if a face was detected and the quality check passed." You wire the detector's boolean into expression1, your quality comparison into expression2, and the gate's output into whatever decides whether the detailer branch executes. Same shape for "only upscale if the image is above a size threshold AND it's not a transparent sprite," or any other two-condition gating.

    The gate's output is just a boolean, so you can't feed it straight into an image or latent input - it's meant to drive a getter, a switch, or another gate. That gate-then-route pattern is the natural ComfyUI idiom, and the pack's getter nodes (like DD And Getter) are designed to sit right after this one.

    Installing it

    The whole pack installs as one unit, and it's the rare one with zero baggage - no Python dependencies, no model downloads, nothing to configure.

    • ComfyUI Manager: search for DD-LogicNodes, hit Install, restart ComfyUI.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/dumbdemon/DD_LogicNodes, then restart.

    Where people get tripped up

    The gotcha that bites most often isn't this node's fault: both inputs default to true, so a freshly dropped, unwired AND gate happily outputs true. If your downstream branch is running when you expect it not to, check whether you actually connected both expressions. Also note the pack is built on ComfyUI's newer extension API - on an old install the node may not appear at all, and the fix is updating ComfyUI rather than reinstalling the pack. Beyond that there's not much to break; this is a node you'll stop noticing exists, which is the highest compliment a utility can get.

    CategoryDD Logic Nodes/Logic Gates

    Inputs (2)

    NameTypeDefaultDescription
    expression1BOOLEANtrue
    expression2BOOLEANtrue

    Outputs (1)

    NameTypeDescription
    *BOOLEAN