Nodes/Deforum Nodes/(deforum) Logical AND
ComfyUI Node

(deforum) Logical AND

The two-boolean gate for chaining conditions in your animation

By XmYx·Created 3 years ago·Updated 3 months ago· 198
(deforum) Logical AND
    • BOOLEAN
    condition_1
    condition_2

    (deforum) Logical AND is exactly what it sounds like: a node that takes two booleans and outputs true only if both are true. It belongs to the pack's small logic section, the same family as its INT Comparator and Logical OR/NOT siblings, and it exists for the moments when you want your animation to change behavior only under a combination of conditions - camera shakes when there's both a beat and the frame count is past the intro, for example.

    How it works

    There's nothing clever under the hood: it returns all(condition_1, condition_2). Both inputs are BOOLEAN type, both required, and the single output is BOOLEAN. If either input is false, the output is false. That's the whole mechanism, which is the point - in a node graph you often need an explicit gate to make a condition "AND another condition," and this is the clean, wired form of that.

    The inputs and outputs

    • condition_1 - first boolean condition.
    • condition_2 - second boolean condition.
    • BOOLEAN - output: true only when both inputs are true.

    Wire the output into anything that takes a boolean - a condition-based switch, a comparator feeding a schedule gate, a logic branch. It doesn't matter much where it lands; the node is a building block.

    When you'd actually use it

    Real talk: for most simple Deforum builds you'll never open the logic drawer, and there are general-purpose logic packs (rgthree, for instance, which the Deforum README itself recommends) that do this kind of thing in a more general way. Where the Deforum-specific logic nodes earn their keep is inside a workflow you've already committed to this pack - you don't want to install a second pack for one AND gate. The honest use cases are: gating an effect to "beat detected AND past frame N," combining a comparator result with a manual toggle, and keeping a condition true only while two separate audio-derived signals agree.

    Installing it

    Part of Deforum Nodes (XmYx). ComfyUI Manager → "Deforum Nodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/XmYx/deforum-comfy-nodes.git
    

    Restart ComfyUI; first boot runs install.py (librosa, opencv-contrib-python, moviepy, numpy<2.0.0, deforum-studio backend). Python 3.10 per the README.

    Where people get burned

    The one genuine gotcha is assuming the node handles more than two conditions from the dropdown - it doesn't. It's strictly two in, one out; if you need a three-way AND, chain two of these nodes. And remember that in ComfyUI a boolean wire is just data - this node doesn't enable or disable other nodes' execution the way you might hope. It computes a value; whether that value does anything depends on what you connect it to. If your gated effect isn't firing, check the thing downstream actually consumes a boolean condition, not just that the AND node shows true.

    Categorydeforum/logic

    Inputs (2)

    NameTypeDefaultDescription
    condition_1BOOLEAN
    condition_2BOOLEAN

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN