LayerUtility: Boolean Operator V2
Boolean Operator V2 — compare two values without a scripting node
- a
- b
- output
- string
The logic gate you reach for once your workflow needs to decide something instead of just running top to bottom. Give it two values and an operator, and it hands back true or false - wire that into a switch, an if/else node, or anything else that changes behavior based on a condition. No scripting node required.
The pack's original Boolean Operator does this with two wildcard-typed ports and nothing else. V2 adds a real quality-of-life feature on top: a_value and b_value, plain string fields you can type a literal comparison value directly into on the node itself. Following the usual ComfyUI convention, the optional a/b wildcard ports take priority when something's actually wired into them - so you can either type both sides of a comparison right on the node with nothing connected, or wire in upstream values and let those override the typed defaults. That's a real convenience: you no longer need a Primitive node just to hardcode one side of a comparison.
How it works
Take whatever's on the left (a/a_value) and right (b/b_value), apply the chosen operator, and return the result. Comparisons happen at graph-execution time - nothing here touches an image or a model.
The inputs and outputs that matter
a_value/b_value(STRING, default empty) - type literal values directly here if you're not wiring anything in.- Optional
a/b(wildcard*) - connect a real upstream value and it takes over from the typed default. operator- the actual choice, with twelve options: the comparisons==,!=,>,<,>=,<=; the logic opsand,or,xor,not(a); andmin,maxfor rounding out the set.
Outputs: output (BOOLEAN) - your true/false result, wired straight into whatever consumes it - and string - a text version, handy for debugging or for labeling a saved output with what condition fired.
How to install it
Ships with the ComfyUI Layer Style pack. ComfyUI Manager - search ComfyUI Layer Style, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
then restart. Lives under 😺dzNodes → LayerUtility → Data. No models needed - pure logic.
Common issues & troubleshooting
Comparison gives an unexpected result with numbers. a_value/b_value are strings - if you typed numbers directly into them, make sure they're comparing the way you expect (numeric versus lexicographic ordering matters for >/<). Wiring in real INT/FLOAT values through the a/b ports sidesteps this ambiguity entirely.
Typed value in a_value seems to be ignored. Check whether something's actually connected to the optional a port - a connected link takes priority over the typed field, which is easy to forget if you wired something in during an earlier version of the graph and then changed your mind.
Node isn't in your list at all. Pack import failure, not this node - LayerStyle's dependency chain is long, and a broken transformers/stray-TensorFlow combo is the classic way the whole pack fails to load together. Check the startup console or hit "Try Fix" in Manager. The good news once it does import: there's nothing in a comparison node to break at runtime - if it's there, it works.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| a_value | STRING | — | |
| b_value | STRING | — | |
| operator | COMBO | 12 options: ==, !=, >, <, >=, <=, +6 | |
| aopt | * | — | |
| bopt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | BOOLEAN | — |
| string | STRING | — |