Nodes/ComfyUI-Basic-Math/Number Lerp | Basic
ComfyUI Node

Number Lerp | Basic

The smoothness node hiding in a math pack

By akatz-ai·Created about a year ago·Updated 11 months ago· 16
Number Lerp | Basic
  • a
  • b
  • t
  • NUMBER

NumberLerp ("Number Lerp | Basic") computes linear interpolation: a + t * (b - a). It's the math behind every fade, blend, and ease in animation, and once you have it as a node you'll start seeing places to use it everywhere. Give it a start (a), an end (b), and a blend factor (t), and it returns the number t fraction of the way between them.

All three inputs - a, b, t - take the pack's NUMBER union type, so ints and floats mix freely. The default t of 0.5 gives you the midpoint. The output is NUMBER: it comes back as an INT only when all three inputs are integers and the result lands on a whole number; otherwise it's a FLOAT.

The inputs that matter

  • a - the value at t = 0 (default 0).
  • b - the value at t = 1 (default 1).
  • t - where you are between them (default 0.5).

Why you'd reach for it

Three genuinely useful patterns:

  • Smooth transitions. Animate a parameter - denoise, CFG, a strength value - by driving t from a schedule or counter. At t = 0 you get a, at t = 1 you get b, and in between it glides.
  • Easing without the math. If the linear result feels mechanical, don't replace the node - feed t through a curve first (square it for ease-in, etc.) and NumberLerp does the rest.
  • Blending constants. Two presets, one knob: set a and b to two configs and expose t as your single control.

A detail that makes this node friendlier than hand-rolled math: t isn't clamped. Values below 0 or above 1 extrapolate - t = 2 gives you 2b - a, which is sometimes exactly what you want for overshoot effects, and a NumberClamp in front of t restores the plain fade when it isn't.

Installing it

Standard pack install - pure Python, no dependencies:

cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/ComfyUI-Basic-Math

Restart ComfyUI, find it under Basic Math ➕ → Utility as "Number Lerp | Basic". Or use ComfyUI Manager → Install Custom Nodes → search "ComfyUI-Basic-Math".

The gotchas

The output type follows the inputs: feed it three ints and an exact whole-number result, you get an INT; any float input or fractional result and it's a FLOAT. If you're building a timeline and need the result to stay a consistent type, that's worth knowing before the wire reaches a strictly-typed socket. And yes - "Number Lerp | Basic" is the menu name, same | Basic suffix as the rest of this pack.

CategoryBasic Math ➕/Utility

Inputs (3)

NameTypeDefaultDescription
aINT,FLOAT0
bINT,FLOAT1
tINT,FLOAT0.5

Outputs (1)

NameTypeDescription
NUMBERINT,FLOAT