Compare
The '10 > 9' node that doesn't sort your text wrong
- value_a
- value_b
- boolean
- comparison_text
Every interesting workflow eventually asks a question: is this value bigger than that one? Did the upscale actually make it wider? Does the filename contain the word "final"? Core ComfyUI can compare numbers, but the moment your values are strings, or text that looks like numbers, the answers get weird. Compare (WAS Compare Any in the node id) is the version that reads both sides sensibly first.
Under WAS Suite/Logic/Boolean, it takes value_a, a comparison from a dropdown, and value_b, and returns a boolean. The smarts are in how the comparison decides to read its inputs. The tests split into two families:
equalsplus the four orderings (greater than,less than, and the or-equal variants) read both sides as numbers wherever they can. So"10"compared to"9"gives 10 greater than 9 = true - the string "10" is read as the number 10. A naive text comparison would sort "10" before "9" because "1" < "9", which is exactly the bug this design exists to prevent.contains,starts with,ends with,matches regexread both sides as text. These are your string-tests, andmatches regexopens the full pattern-matching can of worms for when a plain contains isn't enough.is emptychecks value_a alone and ignores value_b - a text-flavoured cousin of Any Is Empty for when you only care about the one side.
The second output is quietly brilliant
boolean is the headline. comparison_text is the sleeper: it writes the whole test out as readable text - 10 greater than 9 = true - so you can feed it to a text note or a filename and the workflow explains itself. When you're trying to work out why a gate fired or didn't fire, having the actual comparison spelled out in text beats staring at two sockets.
How it plugs into the wider suite
The outputs feed the boolean world directly: Compare → Any Gate (only proceed if this holds), Compare → Boolean Reduce (combine several comparisons into all/any/majority), Compare → Any Input Switch (route A or B based on the result). One Compare feeding one Reduce feeding one Gate is the whole quality-gate stack from a couple of paragraphs of wiring.
The permissive input types mean you can compare almost anything without converter nodes in between: an INT against a FLOAT, a text field that came off a widget against a hardcoded threshold, a value pulled off a bus node against a target. The node sorts out the reading for you - numbers where it can, text where it must.
The thing to keep in mind
The "read as a number where it can" rule is doing a lot of work, and it cuts both ways. A version string like "2.10" reads as the number 2.1, not as a version newer than 2.9 - if you're comparing filenames or version tags with text semantics, pin the comparison to a text-mode test (contains, or an explicit string comparison) rather than an ordering, or you'll get a "correct" answer to the wrong question. When in doubt, glance at comparison_text - it tells you exactly which reading the node chose.
Installing
Part of WAS Node Suite v3 (WASasquatch/was-node-suite-comfyui), WASasquatch's MIT pack - going since 2023, over a million downloads, a long-time fixture of the ecosystem. This node is pure plumbing: no packages, no models, nothing to download beyond the pack itself. It does require ComfyUI 0.14.0+ - v3 is built on ComfyUI's newer node backend.
Install via ComfyUI Manager by searching WAS Node Suite v3, or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
Restart ComfyUI, and Compare shows up under WAS Suite/Logic/Boolean. Missing after a clean install? Update ComfyUI before anything else.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| value_a | STRING,INT,FLOAT,NUMBER,BOOLEAN | Left-hand value. Text, a number or a switch. | |
| comparison | COMBO | equals | The test. `equals` and the four orderings read both sides as numbers where they can: 10 > 9. `contains`, `starts with`, `ends with` and `matches regex` read them as text. `is empty` ignores value_b. |
| value_b | STRING,INT,FLOAT,NUMBER,BOOLEAN | Right-hand value. Ignored by `is empty`. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| boolean | BOOLEAN | true when the test holds. Wire it to any switch's boolean. |
| comparison_text | STRING | The test written out, as `10 greater than 9 = true`. |