!=
The 'is this different' check for value switches
- value1
- value2
- result
Sometimes the most useful boolean in a workflow is "did this change?" - a seed rolled over, a prompt got swapped, a config value differs from what you expected. The NotEqual node from Basic data handling computes exactly that: feed it two values, get back True if they're different, False if they're the same.
It's the natural companion to the pack's Equal node (the name is a lie only in the obvious way - this one is !=, not ==), and together they're the backbone of value-based conditionals: comparing settings, detecting changes, and routing a workflow when an input drifts from a reference value.
What makes this one different
Most comparison nodes in ComfyUI only handle numbers, because the type system makes "compare two arbitrary things" awkward. NotEqual doesn't care. Both inputs are typed as * (any type), and the node accepts whatever you throw at it - numbers, strings, booleans, even structured objects. For complex values it tests structural inequality: two lists with the same contents compare as equal even if they're different objects, and different contents compare as unequal. That's the behavior you actually want from "is this different," rather than a reference-identity comparison that says two identical-looking things differ.
Under the hood it's Python's != operator, which ComfyUI passes through unchanged. The inputs:
value1- anything.value2- anything.
Output is a single BOOLEAN named result, ready to feed a switch, an if/else routing node, or any boolean socket.
Where you'd use it
- Detecting a change - compare a current value to a stored reference; the boolean flips exactly when the value changes.
- Input validation / guards - "only do the expensive thing if this isn't the default."
- Routing - combined with a control-flow node,
!=becomes a "different from expected → take this branch" test.
A small warning: because it accepts any type, the comparison obeys Python's rules - a number 1 and the string "1" compare as not equal, which is probably what you want, but it can surprise you if a node silently casts types somewhere upstream. If a != check keeps returning True when it shouldn't, check that both sides are the same type before suspecting the node.
Installing it
Basic data handling is dependency-free with no model downloads - install is one step everywhere in the pack. ComfyUI Manager, search "Basic data handling", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart, and != lives under Basic/comparison.
The take
For a node that's just an operator in a box, the any-type acceptance is genuinely useful - most "comparison" packs will refuse to wire strings or lists into their equals-check. If you're doing anything with dynamic data, this is the version that actually works.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| value1 | * | — | |
| value2 | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | BOOLEAN | — |