Nodes/ComfyUI Assistant Node/PVL BooleanLogic
ComfyUI Node

PVL BooleanLogic

A two-input AND/OR gate for your workflow, that's the whole node

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL BooleanLogic
    • result
    bool_afalse
    bool_bfalse
    logic_operatorAND

    This is the smallest possible useful node: two booleans in, one boolean out, choose AND or OR. PVL_BooleanLogic lives in the pvlprk/comfyui-pvl-api-nodes pack and does exactly what its name says - nothing more, nothing hidden, no API, no key, no dependencies beyond the pack itself. You'd be forgiven for thinking it's trivial. It is. And once you're building workflows with conditional routing, it turns out to be exactly the kind of trivial node you keep reaching for.

    The scenario: you've got a "use upscaler?" toggle and a "batch mode?" toggle, and you only want the expensive branch to run when both are on. That's an AND. Or you've got two "skip this step" signals from different condition checks, and either one should bail - that's an OR. Wiring booleans straight into a switch or a bypass can't express that; one tiny logic gate can.

    How it works

    bool_a and bool_b are plain boolean widgets (both default false), and logic_operator is an enum with just AND and OR (default AND). It evaluates the pair and returns result as a BOOLEAN. That's the entire mechanism - a and/or in Python, three lines. The value is in the socket, not the code: both inputs are widget-backed, so you can either click them or wire another boolean node's output into them (ComfyUI lets you connect a BOOLEAN into a widget).

    Inputs and outputs

    • bool_a, bool_b (both required BOOLEAN).
    • logic_operator (AND / OR).
    • Output: result (BOOLEAN) - True for AND only when both inputs are true; for OR when either is.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/pvlprk/comfyui-pvl-api-nodes
    

    Restart ComfyUI. No key, no network, and you can ignore the pack's heavy requirements.txt for this one.

    Where people get burned

    • There's no NOT / XOR / NAND. The pack's author kept this one genuinely minimal - if you need to invert a boolean, you'll want a separate not-able node or a switch. Don't go looking for a third operator in the enum; there isn't one.
    • Widget-vs-socket behavior can confuse. Because the inputs are widgets, a wired boolean overrides the clicked value - so a stale click can look like the node is "ignoring" your connection. Check both.
    • Booleans feeding downstream nodes need the right type. Some ComfyUI nodes expect BOOLEAN output and others accept it loosely; if a downstream node won't accept result, it's usually that node's type tolerance, not this node failing.
    CategoryPVL

    Inputs (3)

    NameTypeDefaultDescription
    bool_aBOOLEANfalse
    bool_bBOOLEANfalse
    logic_operatorCOMBOAND2 options: AND, OR

    Outputs (1)

    NameTypeDescription
    resultBOOLEAN