LayerUtility: Boolean Operator
Boolean Operator (Layer Style)
- a
- b
- output
Boolean Operator is the little logic gate you reach for when you want a workflow to make a decision. Feed it two values, pick a comparison, and it hands back true or false - which you then wire into a switch, an if/else node, or anything that changes behavior based on a condition. It's the "is this bigger than that?" node, and once you start building workflows with branches you'll want one.
The mechanism is exactly what it looks like: take input a, input b, apply the chosen operator, return a single boolean. No image processing, no model, just a comparison happening at graph-execution time.
The inputs that matter are all three of them, because there are only three. a and b are wildcard ports (typed *), so they'll accept ints, floats, strings - whatever you throw at them, as long as the operator makes sense for the pair. The operator dropdown is where the actual choice lives, with twelve options:
- Comparisons -
==,!=,>,<,>=,<=. The bread and butter. "Is the width over 1024?" "Are these two strings equal?" - Logic -
and,or,xor,not(a). For combining booleans you've already computed upstream. min/max- rounding out the set.
The output is a single BOOLEAN called output. That's your whole yield. It goes straight into whatever consumes a boolean: a conditional switch, a gate, a "skip this branch" toggle. Pair it with the pack's Number Calculator or String Condition and you can build genuinely conditional graphs without a single scripting node.
Where you'd actually use it: gating an upscale so it only runs when the input is below a target size, choosing between two model paths based on an aspect ratio, or flipping a downstream toggle when a filename contains a keyword. Small node, but it's the kind of thing that turns a linear workflow into one that reacts.
Installing it comes with the whole ComfyUI Layer Style pack - you don't install this node on its own. The clean route is ComfyUI Manager: open it, search "ComfyUI Layer Style" (or just "LayerStyle"), install, restart. The manual route, if you prefer git: cd ComfyUI/custom_nodes && git clone https://github.com/chflame163/ComfyUI_LayerStyle, then pip install -r requirements.txt into your ComfyUI Python environment and restart. Nothing to download for this node specifically - it's pure logic, no models involved.
The one gotcha isn't about this node, it's about the pack. Layer Style is huge and pulls in a long list of Python dependencies (transformers, opencv, scipy, and friends), and by far the most common complaint you'll see is the whole pack showing "import failed" in the Manager. When that happens none of its nodes appear - Boolean Operator included - because a single dependency version clash (transformers is the usual culprit) takes the entire pack down at import time. If this node just isn't in your node list, that's almost always what's going on. The fix is to reinstall the pack or hit "Try Fix" in the Manager, and if that doesn't clear it, reinstall the requirements manually into the same environment ComfyUI actually runs on. Once the pack imports cleanly, Boolean Operator is about as reliable as a node gets - there's nothing in it to break.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | * | — | |
| b | * | — | |
| operator | COMBO | 12 options: ==, !=, >, <, >=, <=, +6 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | BOOLEAN | — |