AND
All inputs must be true, or the whole thing is false
- inputs
- BOOLEAN
Boolean logic in ComfyUI is less glamorous than the diffusion math around it, but it's what makes workflows conditional instead of fixed. UC_LogicAND returns true only when every connected input is true, and it has one feature that makes it better than the basic versions scattered through other packs: the inputs autogrow. Connect two booleans, three, five - each one shows up as its own socket. That maps exactly to the real-world meaning of AND: every condition has to pass.
You'll use it to gate whole branches. "Only upscale if this is the final pass and the seed isn't a test value and a toggle is on." Any one of them false, and the AND spits out false, which your UC_LogicIF (same pack) can then route to a different branch.
How it works
Under the hood it's one line: all(inputs). Each connected boolean is evaluated, and the result is true if every single one is truthy. The autogrowing input (COMFY_AUTOGROW_V3) is what separates this from a fixed two-input AND - you can daisy-chain conditions by adding sockets instead of nesting AND nodes inside AND nodes, which keeps your graph readable.
One input group (inputs, autogrowing boolean sockets), one output (BOOLEAN).
A real-world chain
The classic pattern in automation-heavy workflows: a mode switch (via a boolean from this pack's UC_LogicIF-driven settings), a "is an image connected" check, and a "batch count > 1" comparison all feed one AND. When it's true, the workflow runs the slow, careful path; when false, it takes the fast path. Because the AND is seeded by booleans, you can drive it from any node that emits a boolean - comparisons, toggle nodes, even the results of other logic nodes.
Install
This is one of five logic primitives (AND, OR, XOR, NOT, IF) in silveroxides/ComfyUI-UtilsCollection, and the pack explicitly replaces the equivalent nodes from the older ComfyUI-LogicMath collection:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
Restart (or ComfyUI Manager → search "ComfyUI-UtilsCollection"). Deps: opencv-python and typing-extensions. Note the pack's README: if you still have the standalone LogicMath (or the SigmoidOffset/PowerShift packs) installed, remove it before accepting ComfyUI's workflow-replacement prompt - the pack registers replacements for those old node IDs so workflows migrate automatically.
The trap to avoid: an empty AND (no inputs connected) is all([]) which is true - a footgun if you disconnect everything while debugging and wonder why the gate is open. Other than that it's exactly as boring and useful as boolean logic should be.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| inputs | COMFY_AUTOGROW_V3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |