Greater than
Let Greater than make the call
- first
- second
- result
Greater than is the comparison node you'll reach for constantly, even though it does nothing cleverer than the > you learned in grade school. Two numbers in, one boolean out: true when the first is bigger, false otherwise. In a toolchain where "if the image is wider than tall, do the landscape thing" is a daily thought, that's a genuinely useful primitive - and it's what makes conditional workflows tick.
It comes from marco-zanella's ComfyUI-BooleanExpression pack, a pure-Python logic-node collection with zero dependencies. The arithmetic comparisons all share the same shape, and Greater than is probably the most common one you'll chain into a Conditional Branch.
The inputs that matter
Only two inputs, both accepting INT or FLOAT:
first- the first number (default 0)second- the second number (default 0)
The output is result, a BOOLEAN: first > second. That's the whole mechanism. Wire it into a Conditional Branch's condition input and you've got branching without touching a single mute button.
A classic example straight from the pack's own demo workflow: compare an image's width and height, and when the width is greater than the height, branch to the landscape prompt and the landscape-friendly settings. Same idea scales to steps, batch sizes, CFG values - any two numbers you want to threshold against each other.
Installing it
Nothing to download beyond the folder itself. The pack has no Python dependencies (its requirements.txt is empty) and no model files, so install is just getting the code in place - ComfyUI Manager, searching ComfyUI-BooleanExpression, or the manual clone:
cd ComfyUI/custom_nodes
git clone https://github.com/marco-zanella/ComfyUI-BooleanExpression.git
Restart ComfyUI and you'll find it under Boolean Expressions → Arithmetic Comparisons. One heads-up: the internal class name is BooleanExpression.ArithmenticComparison.GreaterThan - "Arithmentic" with an extra n (a typo of "Arithmetic"). The author shipped it that way, and it's baked into every class name in this subfolder. Harmless in the UI, mildly annoying in code.
Gotchas
- Both branches still compute. A comparison node feeding a Conditional Branch just picks which value travels on; ComfyUI runs both input chains regardless. Fine for cheap nodes, wasteful if a branch is a whole sampler chain.
- INT vs FLOAT doesn't matter here. The input accepts either, and Python's
>handles int-vs-float comparison cleanly, so you can compare an integer batch size to a float threshold without conversion drama. - If the node won't appear, restart ComfyUI after install, and confirm you cloned into
custom_nodes, not your home directory. This pack is tiny and installs clean, so 99% of "where is it" problems are just a missing restart.
If you're doing more than one kind of comparison, you might also glance at Binary Comparison from the same pack - it folds all six operators into a single dropdown. But for the most common check, plain Greater than is the one you'll actually reach for.
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 | — |