==
Is this the same as that? The == node for any two values in your graph
- value1
- value2
- result
Every workflow that makes decisions needs a "does A equal B?" at some point, and ComfyUI doesn't hand you a general-purpose one for free. That's what == (Basic data handling: Equal) is: two inputs of any type, one boolean out. True if they're equal, False otherwise.
The inputs are value1 and value2, both ANY - so this works on numbers, strings, booleans, and the pack's DICT/LIST/SET containers alike. The output is a single BOOLEAN named result, and it's the thing you wire into this pack's if/else, switch, or FlowSelect to make your graph branch.
How "equal" actually works here
The mechanism is literally Python's == operator: value1 == value2. That sounds trivial until you think about what it buys you:
- Structural equality. Compare two dicts or two lists and they're equal if they have the same contents, not the same identity. A dict with
{"a": 1}equals another dict with{"a": 1}even though they're separate objects. That's usually what you want in a workflow, and it's what "structural equality is tested" in the description means. - Type-tolerant number comparison. Python considers
3 == 3.0True - an int and a float can match. Handy when one side of your graph produces INTs and the other FLOATs.
The trap to keep in mind is the flip side of that generosity: 1 == "1" is False, because a number and its string representation are different things to Python. If your graph keeps crossing string/number boundaries, cast first (this pack has cast nodes for exactly that) before comparing.
Why you'd reach for it
Tying comparison results to flow control is the whole game. Compare a loaded config value against an expected one and route through FlowSelect; compare two seeds to detect a change; check whether a dict value matches a sentinel to know whether it was set. It's a boring node that unlocks every interesting one downstream of it.
Installing it
This node ships in the Basic data handling pack by StableLlama. In ComfyUI Manager, search "Basic data handling", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
then restart. Zero dependencies, no requirements.txt, no model downloads.
Troubleshooting
If == keeps returning False when you're sure things match, the usual culprit is a type mismatch - check that you're not comparing "2" to 2. And if you're comparing floats for exact equality, remember floating-point math isn't exact: 0.1 + 0.2 == 0.3 is False in Python. For that case you want a tolerance-based check (this pack's NumberInRange or a formula node) rather than a raw ==.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| value1 | * | — | |
| value2 | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | BOOLEAN | — |