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

ParameterTypeDefault
aAny
bAny
compare_toString"Input"
operationString">"
toleranceNumber0.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

  1. Add a Compare node. Wire a number or colour into A, and another into B.

  2. Set Operation to > (or whichever comparison is needed) and leave Compare To as Input.

  3. Wire Result into a Conditional or Filter node to branch the graph on the outcome.

  4. 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