ComfyUI Node

exp

Your cheapest exponential curve builder

By StableLlama·Created about a year ago·Updated 4 days ago· 48
exp
  • value
  • FLOAT

exp(x) is math shorthand for "raise Euler's number to the power of x" - e^x. It's the function behind every smooth growth and decay curve worth having, and the exp node from Basic data handling is the two-widget version of it. Give it a number, get back the exponential.

Where does that matter in ComfyUI? Mostly scheduling. Exponential curves are everywhere once you start automating: noise ramps that ease in, denoise values that fall off smoothly across a batch, animation parameters that decay per frame. Linear feels mechanical; exponential feels natural, because real-world falloff is exponential. If you've been fighting a per-step schedule that looks steppy, exp (or its cousin log, the inverse) is usually the fix.

How it works

The node calls math.exp() under the hood, so the math is worth knowing because it explains the outputs:

  • exp(0) = 1. Any curve passing through this point does so at 1.
  • exp(1)2.718 - that's e itself, so this node is also a sneaky way to get the constant if you want it as a computed value.
  • exp(negative) gives values between 0 and 1 - this is the decay half of the curve.
  • exp(positive) grows fast. exp(10) is already past 22,000.

No domain errors here, which is a point in its favor: exp accepts any real number, positive or negative, and always returns a positive FLOAT. You can't feed it something that makes it explode with an exception.

The inputs that matter

Just one, in practice:

  • value - the exponent, a FLOAT or INT (default 0). Wire in a step counter or schedule value here and you've got a curve generator.

Output is a single FLOAT, which you can feed into anything that takes a number - CFG schedulers, weights, masks that need scaling, you name it.

Getting an exponential down-ramp

The classic pattern: you want a number that starts high and decays smoothly over N steps. Wire a decreasing counter into value, or run value through a negated step count so exp returns something between 0 and 1 for most of the run. Multiply the output by your maximum and you've got an ease-out curve with no keyframes and no formulas to hand-type.

Installing it

Basic data handling is a no-dependency pack - no models, no pip requirements, which is a genuine relief given how many custom nodes ship with a novel's worth of requirements. Install via ComfyUI Manager (search "Basic data handling"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling

Restart ComfyUI. You'll find exp under Basic/maths, right next to log and sqrt.

Watch out

The only trap is scale. Exponential output grows fast, so a value of 5+ will produce numbers you probably don't want feeding a normalizer. When in doubt, keep value small or negative and scale the result afterward. The math isn't wrong - it's just impatient.

CategoryBasic/maths

Inputs (1)

NameTypeDefaultDescription
valueFLOAT,INT0

Outputs (1)

NameTypeDescription
FLOATFLOAT