Vec2BinaryCondition
Check if two 2D vectors match
- a
- b
- BOOL
Once a workflow starts passing around paired X/Y values - a size, an offset, a 2D position - you eventually need to compare two of them: did this coordinate come back to where it started, does this computed size match that target size. Vec2BinaryCondition takes two VEC2 values and tells you whether they're equal or not.
It's one of the vector nodes in ComfyMath, evanspearman's math/logic utility pack. Compared to the scalar comparison nodes in the same pack (CM_IntBinaryCondition, CM_NumberBinaryCondition), this is the least commonly needed corner of ComfyMath - most people never touch Vec2 nodes at all - but it earns its keep in graphs that do coordinate or offset math, tiling logic, or anything treating width/height (or X/Y) as a single paired value instead of two separate floats.
How it works
Feed it a and b, both VEC2 (each defaulting to [0, 0]), pick an op - Eq or Neq - and it compares the two vectors component-wise and returns a boolean. Only two operations here, and they're exactly what they sound like: equal or not-equal.
One thing worth knowing generally about vector (and float) equality: it's an exact comparison. If either vector arrived via some chain of floating-point math rather than as a literal value you typed in, tiny rounding differences can make two vectors that are "basically the same" register as not equal. If you're seeing an unexpected false from an Eq check, that's the first thing to suspect before assuming the node is broken.
Inputs and outputs
op- Eq or Neq.a(VEC2, default[0, 0]) andb(VEC2, default[0, 0]) - the two vectors being compared.- Output:
BOOL- ComfyMath's own boolean type.
How to install it
Via ComfyUI Manager: search ComfyMath, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/evanspearman/ComfyMath.git
then restart. No dependencies, no models - plain Python.
Common issues & troubleshooting
Two vectors that "look" identical still compare false. As above - check whether either input passed through any floating-point arithmetic upstream. A distance/normalize/scale chain can introduce tiny rounding errors that break exact equality even when the values print identically.
The BOOL output won't connect to a switch node elsewhere. This node outputs ComfyMath's own BOOL type, not core ComfyUI's BOOLEAN. If a downstream node insists on the native type, you'll need to route through logic that accepts BOOL, or restructure to use one of ComfyMath's BOOLEAN-outputting nodes (CM_IntToBool, CM_FloatUnaryCondition) instead where that fits your case.
Missing node error on workflow load. Install ComfyMath through Manager as above, then reload.
The pack is quiet on updates. A 2024 community thread noted the author had moved on from active development. That's a minor point for the Vec2/Vec3 corner of the pack specifically - it's the least-used part of ComfyMath and has had the least reason to change, so treat it as a small, stable utility.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| op | COMBO | 2 options: Eq, Neq | |
| a | VEC2 | 0,0 | — |
| b | VEC2 | 0,0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOL | BOOL | — |