π 2 Boolean operation
The two-boolean node that covers AND, OR, and equality
- Result
You've got a boolean. You've got another boolean. You want to know whether both are true, or whether either is true, or whether they're the same. ComfyUI ships no stock node for that, which is why FlowNodes exists - it's a little pack of programming-logic nodes, and this is its workhorse.
The "π 2 Boolean operation" node takes two booleans and one operation dropdown and hands you back a single boolean. It's the graph equivalent of Python's and, or, ==, and !=, which is exactly what the code does under the hood - the node literally calls a and b or a == b depending on your pick. Nothing clever, nothing to configure, no models to download.
The inputs that matter
- Operation - the dropdown. Your four choices:
and,or,equal,not equal. "equal" and "not equal" are there because sometimes what you actually want to test is whether two flags match, not combine them. - A and B - the two booleans. Wire these from a Compare node, a
PrimitiveBoolean, a node's converted-to-input widget, or another logic node chained back into itself.
That's the whole thing: Result out, a BOOLEAN, ready to feed a π If condition or a Boolean Switch expression.
Where it earns its keep
The realistic use is gating. Say you only want the hires-fix branch to run when a checkbox is on and the batch count is above one. Wire the checkbox into A, the output of an Int Compare (>) into B, pick and, and the Result becomes the condition for your If node. Stack two of these and you've got multi-condition logic without writing a line of Python - which, if you're coming from automatic1111, is the part of ComfyUI that feels backwards at first: the graph is the program, and logic nodes are your if statements.
One quirk worth knowing: because this is Python's actual and/or and both inputs are booleans, the result stays a clean True/False. That's not true of every "and"-style node in other packs, which can return one of the operands - if you ever see a non-boolean sneaking out of a logic node, that's what happened. This one behaves.
Installing FlowNodes
The whole pack installs at once; there's no way to get just this node. Open ComfyUI Manager and search FlowNodes (by gitmylo), hit install, restart. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/gitmylo/FlowNodes
# restart ComfyUI
There are no Python dependencies - no requirements.txt, no model files - so install is about as painless as a custom node gets. It's also early and WIP, so if something misbehaves, that's an issue for the GitHub repo, not a mystery for you to solve.
Troubleshooting
- Result is always wrong - check that both A and B are actually wired. An unwired
BOOLEANinput evaluates asFalse, and a silentFalseis the classic "why isn't my gate opening" bug. - Want "not A and B"? Chain a β Boolean Not after this node, or pick from the
not equal/equaloptions which already invert the test. - Need three-way logic - chain two of these:
(A and B) and Cis just the output of one feedingAof the next.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Operation | COMBO | 4 options: and, or, equal, not equal | |
| A | BOOLEAN | β | |
| B | BOOLEAN | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Result | BOOLEAN | β |