Vec4BinaryCondition
Check if two 4D vectors match
- a
- b
- BOOL
Same job as CM_Vec3BinaryCondition, one component further: compare two four-component vectors and get true or false back. Vec4BinaryCondition is for graphs that carry a value as four linked numbers - an RGBA color, a quaternion, a homogeneous 3D coordinate - instead of four loose floats.
It's part of ComfyMath, evanspearman's math/logic pack. The README lists full Vec4 arithmetic and functions as part of the pack's feature set, but this equality check is the only Vec4 node covered here - if you need more Vec4 operations, check ComfyUI Manager's node list for the rest of what the pack ships.
How it works
Feed it a and b, both VEC4 (each defaulting to [0, 0, 0, 0]), pick an op - Eq or Neq - and it compares all four components and returns a boolean. Same two operations, same mechanics as the VEC2 and VEC3 versions: exact, component-wise comparison, not a "close enough" match.
That matters more with four components than with two or three - each one carries its own chance of rounding drift if either vector arrived via computation rather than as a literal value. If an Eq check is coming back false for two vectors that print as identical, that's the first thing to suspect, especially if either side went through a Normalize step upstream.
Inputs and outputs
op- Eq or Neq.a(VEC4, default[0, 0, 0, 0]) andb(VEC4, default[0, 0, 0, 0]) - the two vectors being compared.- Output:
BOOL- ComfyMath's own boolean type.
How to install it
Through ComfyUI Manager: search ComfyMath, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/evanspearman/ComfyMath.git
then restart ComfyUI. No dependencies, no models - plain Python, nothing else to set up.
Common issues & troubleshooting
Two "identical-looking" vectors compare as not equal. Almost always floating-point rounding from upstream math on one side or the other, not a bug in this node. Exact equality on computed floats is fragile by nature - if you need a tolerance-based comparison instead of exact equality, you'll need to build that check yourself out of the pack's other float/vector operations, since this node only does exact Eq/Neq.
The BOOL output won't wire into a native switch node. This outputs ComfyMath's own BOOL type, not ComfyUI's built-in BOOLEAN. Route it through logic that accepts BOOL, or reach for one of ComfyMath's BOOLEAN-outputting nodes if a specific downstream target requires the native type.
Missing node error on a shared workflow. Install ComfyMath via Manager as above, then reload.
You expected more Vec4 nodes than this. This article covers just the equality check; ComfyMath's README advertises fuller Vec4 arithmetic in the pack, so browse Manager's node list under this pack if you need addition, scaling, or other Vec4 operations beyond comparison.
The pack looks unmaintained. A 2024 community thread noted the author had stepped back from active development. The Vec3/Vec4 side of ComfyMath is its least-used corner and has had little reason to change, so treat it as small and stable rather than actively developed.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| op | COMBO | 2 options: Eq, Neq | |
| a | VEC4 | 0,0,0,0 | — |
| b | VEC4 | 0,0,0,0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOL | BOOL | — |