AND
The two-input gate that makes conditional workflows click
- BOOLEAN
ComfyUI graphs stop being "type prompt, press go" the moment you wire a condition into them. And the moment you do, you need boolean logic. SL_AND is the gate that says: only proceed when both conditions are true. If you've ever wanted "run the high-res pass only when a face was detected AND the step count is high enough," this is the node you string those together with.
Boolean nodes are the connective tissue of conditional workflows. You get your booleans from comparison nodes (like this pack's SL_CompareInt / SL_CompareFloat), from model loaders that report whether a checkpoint loaded, from mask or image checks, or from nodes that test "did this thing actually happen." AND takes two of those and combines them.
The mechanism is about as direct as it gets: return (a and b,). Both inputs must be True for the output to be True. Any other combination - one true, one false, both false - gives you False. That's the whole logic, no hidden behavior, nothing to configure.
Inputs and outputs:
a(BOOLEAN) - first condition, defaultFalseb(BOOLEAN) - second condition, defaultFalse- Output:
BOOLEAN-Trueonly if both areTrue
Installing it
Part of ComfyUI-SimpleLogics. ComfyUI Manager → Install Custom Nodes → search "SimpleLogics" → install → restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/danipisca07/ComfyUI-SimpleLogics
Restart and find it via Add Node → search "AND" (menu group SimpleLogics/Logic). Zero dependencies, no model files - install is instant either way.
Where it shows up in real workflows
- Guarded upscaling: "only upscale when the batch is done AND the result passed a quality check."
- Multi-condition switches: feeding an
SL_SwitchAnyor similar with a combined condition instead of a single comparison. - Validation: blocking a generation path unless several preconditions all pass.
Gotchas
- Exactly two inputs. This is a fixed two-input gate, not a variadic "any number of conditions" node. With three conditions you chain two AND nodes:
(a AND b) AND c. Packs like Impact Pack have fancier multi-input logic if you outgrow this, but for a couple of conditions this is plenty. - It wants real booleans. Wire an INT into it and you'll get a red link. If you have an integer flag, run it through
SL_IntToBoolfirst - that's the correct conversion, with0 → Falseand anything else →True. - Defaults are
False. An unwired AND silently returnsFalse, which can quietly disable a whole branch. Wire both inputs deliberately.
It's the smallest possible tool for a genuinely common job. If you're building workflows with any decision-making in them, AND is one of the first three nodes you'll use.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| a | BOOLEAN | false | — |
| b | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |