Logic Compare Numbers
The if/else your graphs have been missing
- number_a
- number_b
- boolean
- comparison_text
Logic Compare Numbers is exactly what the name says: feed it two numbers, tell it which test to run, and it answers true or false - the raw material every conditional workflow is built from. Type the numbers, or wire them from a counter, a batch size, a Mask Statistics measurement, anything that emits a number. The boolean output plugs straight into a gate or switch so your graph makes decisions instead of you babysitting it.
It's one node in WAS Node Suite's logic family (menu WAS Suite/Logic/Boolean), which pairs with the suite's typed switches, condition chains, and For/While loops to give ComfyUI something it genuinely lacks on its own: control flow.
How it works
Two number inputs and a dropdown. number_a and number_b both accept FLOAT, INT, or NUMBER - type them or wire them, and the comparison dropdown spells out the test using a and b, so a > b is true while number_a is the larger of the two. That's the whole input surface, which is the point: there's nothing to configure, so it never gets in the way.
Two details make it more trustworthy than doing the same test in a math node:
- Equality has tolerance. Floats computed from different paths rarely land exactly on the same bits, so
a == ballows a millionth of a millionth either way. A comparison that would fail on raw float equality passes here, which is what you actually want. - You get the test back in words. The
comparison_textoutput is a STRING like3 > 2 is true- surprisingly handy for a readout, a console print, or baking into a filename so the run is self-documenting.
Where it fits
The textbook wiring is into a loop: feed index >= limit from a For Loop into a While Loop Close, and the loop ends on a count instead of running blind. The same boolean drives Any Gate to skip an expensive node, or a Model Switch / image switch to pick a branch. If you've got a Mask Statistics is_empty or a coverage figure on a wire, comparing it against a minimum is how you say "if less than a quarter of the frame is masked, don't bother inpainting."
The outputs worth knowing: boolean (BOOLEAN) for gates and switches, and comparison_text (STRING) when you want the human-readable version. There are no optional inputs and no surprises - it's a deliberately boring node, and boring is what you want in the middle of a control-flow graph.
Installing it
It ships with WAS Node Suite v3. Easiest via ComfyUI Manager (search "WAS Node Suite v3"), or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
restart ComfyUI. Needs ComfyUI 0.14.0+ and Python 3.10+, and the suite installs no pip packages of its own. A note on bloat: installing the suite adds hundreds of nodes to your Add Node menu; v3's config.yaml lets you disable whole groups if the menu crowd bothers you.
Where people get burned
The main trap is comparison direction - it's easy to wire number_a and number_b in reverse and then wonder why a "denoise if strength < 0.6" gate fires at strength 0.8. Check the comparison_text output once and the direction is spelled out for you. Second, remember the tolerance only applies to equality: greater-than/less-than are exact, so a float that should equal another won't trip a > b just because they're a hair apart - test the case you mean.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| number_a | FLOAT,INT,NUMBER | 0-1000000000000000000–1000000000000000000 | The number on the left of the test; FLOAT, INT or NUMBER. Type it, or wire it from a counter or a measurement. |
| number_b | FLOAT,INT,NUMBER | 0-1000000000000000000–1000000000000000000 | The number on the right of the test; FLOAT, INT or NUMBER. Type it, or wire it from a counter or a measurement. |
| comparison | COMBO | Which test to apply; COMBO. 'a' is number_a and 'b' is number_b, so 'a > b' is true while number_a is the larger of the two. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| boolean | BOOLEAN | Whether the test holds; BOOLEAN. Equality allows a millionth of a millionth either way, so a computed float still matches. |
| comparison_text | STRING | The test and its outcome in words; STRING, such as '3 > 2 is true'. For a readout or a filename. |