Compare
Compare two values and output a boolean result.
What it does
Compare asks a yes/no question about two values: is A greater than B, equal to B, and so on. The result is a boolean, ready to drive a Conditional, a Filter or any switch further down the graph.
Setting Compare To to Previous Frame replaces the second value: A is compared against its own value from the frame before. A second output, Edge, is true for exactly one frame whenever the comparison result flips.
When to use it
Branching the graph on a condition, feeding Result into Conditional or Filter
Detecting a value crossing a threshold, such as a driver ramping past 0.5 or an audio level exceeding a limit: Compare To set to Previous Frame
A one-frame trigger rather than a held boolean: the Edge output
Comparing numbers, colours, vectors or images. Compare accepts most value types and reduces them to a single true/false
| Parameter | Type | Default |
|---|---|---|
a | Any | — |
b | Any | — |
compare_to | String | "Input" |
operation | String | ">" |
tolerance | Number | 0.000 |
Gotchas
For == and !=, exact equality on floating-point values is unreliable. Tolerance sets how close two values must be to count as equal. Raise it if a comparison that should read as equal keeps flickering to false.
Compare To has two modes. In Input mode, B is wired in and compared against A. In Previous Frame mode, B is hidden entirely and has no effect until the mode is switched back.
Tolerance is clamped to a 0–1 range. When comparing large numbers such as pixel counts, frame numbers or big Expression outputs, a tolerance of 1 may be too tight to treat near-equal values as equal. Normalise or scale the values before comparing.
Worked example
Add a Compare node. Wire a number or colour into A, and another into B.
Set Operation to
>(or whichever comparison is needed) and leave Compare To as Input.Wire Result into a Conditional or Filter node to branch the graph on the outcome.
To catch a threshold crossing instead, switch Compare To to Previous Frame and use the Edge output. It pulses true only on the frame the comparison changes.
See also
logic.conditional · Logic · Filter · Numbers, signals & audio