π§ Simple Comparison
Simple Comparison β compare two values, get a true/false back
- a
- b
- BOOLEAN
The building block for "do this only ifβ¦" in a ComfyUI graph. Simple Comparison takes two values, compares them with an operator you pick, and outputs a boolean - true or false. On its own it doesn't do much; wired into a switch or a Simple Math Condition, it's how a workflow makes decisions based on its own data.
What it does
Three inputs, one output:
- a and b - the two values to compare, both typed
*(wildcard), so you can throw numbers, and it'll do the sensible thing. - comparison - the operator:
==,!=,<,<=,>,>=. Equal, not-equal, and the four inequalities. Standard stuff.
Output is a single BOOLEAN: the result of a <comparison> b. So a=5, b=3, comparison=">" gives true.
That's the entire node, and its simplicity is the point - it's one clean, labeled comparison you can read at a glance on the canvas.
Why you'd reach for it
Because interesting workflows adapt to their inputs. A few things this unlocks:
- Size-based branching. Compare an image's width to its height and use the boolean to decide portrait vs landscape handling downstream.
- Threshold gates. "If batch count > 8, do the cheaper path." Feed a Batch Count into
a, your threshold intob. - Conditional values. Its boolean output is exactly what Simple Math Condition wants for its
evaluateinput - compare here, then emit one number or another over there.
This is the pack's logic family working together: Simple Comparison decides, Simple Math Condition acts, Simple Math Boolean supplies constants. Between them you can build genuinely conditional graphs without dropping into a Python node. The relatively strong search interest in this node (people actually click through to it) tracks that - it's the one you look up when you first hit the "I need an if statement" wall.
Installing it
Part of ComfyUI Essentials by cubiq - Matteo Spinelli, the developer behind ComfyUI_IPAdapter_plus:
- ComfyUI Manager: search "ComfyUI Essentials" β Install β restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_essentials, installrequirements.txt, restart.
Recognise it by the π§ wrench and the + (SimpleComparison+).
Gotchas
Comparing mismatched types is where surprises live. Since a and b are wildcards, you can feed them different kinds of values, but comparing a number against a string won't mean what you hope. Keep both sides the same type - number vs number - and you're fine. Drop a Display Any on the output while you're building to confirm it's evaluating the way you expect.
Watch floating-point equality. == on two floats that "should" be equal can come back false because of tiny rounding differences. If you're testing floats for equality, a </> threshold is usually safer than an exact ==.
Pack-level caveat: cubiq set ComfyUI Essentials to maintenance-only in April 2025. Something this simple is unlikely to break, and the community consensus is the nodes still work fine - but if it ever shows up red as "missing" after a ComfyUI update, the pack didn't load; check the startup log and reinstall via Manager, or roll ComfyUI back. No fixes are coming from upstream.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | * | 0 | β |
| b | * | 0 | β |
| comparison | COMBO | 6 options: ==, !=, <, <=, >, >= |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | β |