Evaluate Curve At T
The bridge between curves and actual numbers
- curve
- FLOAT
- INT
Every keyframed parameter has to leave the curve world eventually. A curve is a function; a KSampler wants a number. KfEvaluateCurveAtT is the node that crosses that gap: give it a curve and a time t, and it hands back the value of the curve at that time - as both a float and an int, because downstream nodes want different kinds of numbers. It's the workhorse of this whole pack, and it's deceptively simple.
The pack's premise is that you build parameter curves as actual graph objects - an easing ramp here, a sine there - instead of typing notation into a prompt. Every one of those curves eventually needs to be sampled at a specific frame, and this is the node that does it. Wire a curve in, set t to your current frame (drive it from a frame counter or an animation loop), and the float output is the parameter value for that frame.
Why you'd reach for it
Three classic uses. Ramp a CFG or denoise value across an animation by sampling an easing curve per frame. Drive a LoRA strength or a ControlNet weight from a sine. Or just read what a curve evaluates to at a given time when you're debugging - it pairs beautifully with the KfDebug_Float node to watch values change as t advances. The README's "Simple Curved Parameter" example is basically this node feeding a value into a sampler.
The inputs that matter
curve- aKEYFRAMED_CURVE, force-input from any curve-constructing node (Curve From String,Curve From YAML, a sinusoidal, an entangled set, a constant).t- the time to evaluate at, anINTdefaulting to0. In an AnimateDiff-era workflow this is your frame index.
The two outputs matter more than you'd think:
FLOAT- the true interpolated value att. If your curve is a linear ramp from 0 to 1 over 24 frames, att=12you get0.5. This is the one you feed into float-parameter inputs.INT- the same value truncated withint(). Handy when the consumer wants an integer (steps, batch counts) and you don't care about the fractional part.
How it works
Under the hood it's one line: the curve is a callable keyframed object, so curve[t] evaluates it at t, interpolating between keyframes according to the interpolation method of the previous keyframe (linear, eased, stepped - whatever the keyframe says). The float is that result; the int is int() of it. Note the truncation isn't rounding - 0.9 becomes 0 - so if that matters, use the float and round upstream.
Installing it
Part of ComfyUI-Keyframed (dmarx's pack wrapping his keyframed library). ComfyUI Manager: search "Keyframed". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/dmarx/ComfyUI-Keyframed
Restart ComfyUI. The pack auto-installs keyframed and toolz on first load; no model downloads.
Troubleshooting
The classic mistake is evaluating outside your curve's domain. Query a curve at t=100 when its keyframes only span 0–24 and you're asking the curve to extrapolate, which can give you wild values - the README's curves default to loop: false and bounce: false, so past the end you're beyond anything defined. Check your t against the curve's actual duration. And remember the pack's own warning: curve division is unreliable, so if the curve you're sampling was built with a divide, treat the output with suspicion.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| curve | KEYFRAMED_CURVE | — | |
| t | INT | 0 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |
| INT | INT | — |