Less than or equal to
Less than or equal to (and why that space is in its name)
- first
- second
- result
Less than or equal to is the inclusive cousin of Less than: first <= second, true when the first number is smaller or exactly equal. It's the "at most this much" comparison, the one you reach for when a boundary value should count - "steps at most 30," "resolution up to 1024," "batch no larger than 8." The name is a mouthful, but it's the honest one: strict < would silently drop the equal case.
It's part of marco-zanella's ComfyUI-BooleanExpression pack, a dependency-free logic collection where every arithmetic comparison shares the same two-numbers-in, boolean-out shape. This one is the mirror of Greater than or equal to, and it deserves the same respect for boundary correctness.
The inputs
Two required inputs, both INT or FLOAT:
first- the first number (default 0)second- the second number (default 0)
Output is result, a BOOLEAN: first <= second. Under the hood it's a plain Python comparison - one line, no hidden logic. The classic use: "if this value is at most that threshold, take the cheap path." Feed it a resolution, a step count, a CFG - and pipe result into a Conditional Branch's condition.
About that space in the name
Here's the little quirk that will confuse you exactly once: in the pack's code, the display name for this node is literally " Less than or equal to" - with a leading space, a typo that survived into the shipped source. In the ComfyUI node menu it typically renders as "Less than or equal to" either way, but if you're searching, matching, or writing a workflow JSON by hand, the space is there. It's the sort of detail that only matters when it bites you mid-script, so now you know. (The class name, BooleanExpression.ArithmenticComparison.LessThanOrEqualTo, also carries the pack's "Arithmentic" misspelling - same energy, same author.)
Installing it
Same story across the pack: no models, no dependencies, pure Python - requirements.txt is empty. ComfyUI Manager, search ComfyUI-BooleanExpression, or:
cd ComfyUI/custom_nodes
git clone https://github.com/marco-zanella/ComfyUI-BooleanExpression.git
Restart ComfyUI, and it's under Boolean Expressions → Arithmetic Comparisons.
Gotchas
- Boundary values count here. If your rule is "strictly under," you meant Less than.
<=includes the equal case - that's the whole point, and the most common mix-up. - Both branches downstream still compute. A comparison just selects a value; the unselected input chain of any Conditional Branch it feeds runs anyway. Negligible for numbers, good pattern to know.
- Fresh nodes read "0 <= 0 → true" until you wire real values in, because both inputs default to 0. Not a bug, just a "why is this always true" moment to be ready for.
When the two numbers are constants you'll tweak repeatedly, Binary Comparison in the same pack puts all six operators in one dropdown. But for a single stable "at most this" rule, this dedicated node is the clearest choice to leave in a workflow you share.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| first | INT,FLOAT | 0 | The first number. |
| second | INT,FLOAT | 0 | The second number. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | BOOLEAN | — |