ComfyUI Node

AND

The gate your workflow is missing

By silveroxides·Created 7 months ago·Updated 3 months ago· 3
AND
  • inputs
  • BOOLEAN

AND is one of those logic nodes that looks pointless until your workflow grows a second boolean and you realize you have no clean way to combine them. It takes two to ten boolean inputs and returns true only if every one of them is true. Any single false, and the whole thing goes false. That's the classic gate: "only do the thing if all the conditions are met."

Think about the workflows that produce booleans: a compare node, a seed-parity check, a "was the last upscale skipped" flag, a result from a conditional. When you want to fire a downstream step only when several of those line up at once, you chain them into an AND. It's also the natural safety interlock - gate a destructive step (an overwrite, a big upscale, an expensive second pass) behind "all my checks passed" so one stray flag can't trigger it alone.

How it works

The inputs are an autogrowing list - inputs, two to ten of them, added with the plus button. On execution the node runs Python's all() over the collected values and returns the single resulting boolean. That's the whole mechanism: no state, no ordering surprises, no caching footguns. It's deterministic and cheap, which is exactly what you want from a gate sitting in the middle of a graph.

A practical detail: every input is required to resolve to a boolean. If you wire a non-boolean in, you're asking for a type mismatch, and the failure mode is usually the downstream node complaining rather than this one - so keep the inputs fed from nodes that actually output BOOLEAN.

The inputs that matter

  • inputs (2–10): the booleans to AND together. Wire from compare nodes, LogicIF outputs, toggle/switch nodes, or any boolean source.

Output is a single BOOLEAN. Wire it into another AND to build a bigger gate, into a LogicIF to decide a branch, or into a switch to conditionally route.

One mental model that helps: AND is "all must pass." If your condition is really "any one of these should pass," you want OR from the same pack, not AND - getting those two mixed up is the single most common logic error in ComfyUI graphs, and it produces exactly the "it works sometimes and I can't tell why" bug.

Install

Part of the ComfyUI-LogicMath pack. Easiest via ComfyUI Manager - search "ComfyUI-LogicMath", Install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-LogicMath

No pip requirements, no model files. The pack uses ComfyUI's newer extension API, so if the nodes don't appear after a restart, update ComfyUI first.

Common issues

  • Gates stay false "randomly" - one input is false; that's the point of AND. Check each input in turn rather than suspecting the node.
  • Type errors from a wired input - you fed it something that isn't a boolean; route a real boolean source into it.

If your workflow is still small, you might not touch this for a while. The moment you build one "conditional branch that only runs when everything else checks out," this is the node you'll be glad exists.

Categoryutils/logic

Inputs (1)

NameTypeDefaultDescription
inputsCOMFY_AUTOGROW_V3

Outputs (1)

NameTypeDescription
BOOLEANBOOLEAN