Nodes/AnimateDiff Evolved/ContextRef Keyframes Interp. πŸŽ­πŸ…πŸ…“
ComfyUI Node Runs on cloud

ContextRef Keyframes Interp. πŸŽ­πŸ…πŸ…“

Ramp ContextRef's strength on a curve

By KosinkadinkΒ·Created 3 years agoΒ·Updated 8 days agoΒ· 3,520
ContextRef Keyframes Interp. πŸŽ­πŸ…πŸ…“
  • prev_kf
  • mult_multival
  • mode_replace
  • tune_replace
  • CONTEXTREF_KF
β—„start_percent0.000β–Ί
β—„end_percent1.000β–Ί
β—„mult_start1.000β–Ί
β—„mult_end1.000β–Ί
β—„interpolationβ–Ύβ–Ί
β—„intervals50β–Ί
β—„inherit_missingtrueβ–Ί
β—„print_keyframesfalseβ–Ί

Where Keyframes From List wants you to already have a list of values, this node wants just two: a starting strength and an ending strength, plus how many steps to interpolate between them. It's the smooth-ramp version of a ContextRef schedule.

What it does

mult_start and mult_end (both default 1, range 0–1) are the two endpoints of the ramp. start_percent and end_percent (0 and 1) bound where in the denoising process the ramp happens. interpolation is a dropdown for the curve shape - a straight linear ramp versus an eased one that starts or ends more gently rather than moving at a constant rate. intervals (default 50, range 2–100) is how many discrete keyframes get generated along that curve - more intervals means a smoother, more granular ramp; fewer means bigger visible steps between values. print_keyframes (default false) dumps the generated schedule to console, same as the From List node - genuinely useful for confirming the curve did what you expected before running a long render on it.

prev_kf chains onto an existing keyframe chain, mult_multival lets a mask or per-frame list modulate strength on top of the curve, and mode_replace/tune_replace (governed by inherit_missing, default true) let the whole ramp use a different mode or tune than the parent ContextRef node if you want. Output is CONTEXTREF_KF.

Why you'd want a ramp instead of a flat value

Two common shapes: fade ContextRef in gradually so the first few frames aren't overly locked to a reference that hasn't stabilized yet, or fade it out toward the end of a render so the model has more room to introduce natural variation as the animation progresses, rather than staying rigidly anchored to frame one's look the whole way through.

Picking an intervals count

More intervals means a finer curve, but it also means more keyframe objects get built and evaluated during sampling - a real, if small, overhead on every render. For most schedules, something in the 10-20 range is already smoother than a human would notice frame to frame; save the higher end of the range for renders where you specifically need very fine control over exactly where the strength sits at each step.

Installing it

ComfyUI Manager: search AnimateDiff Evolved (author Kosinkadink), install, restart - or clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved into custom_nodes by hand and restart.

Common issues

There's no meaningful community troubleshooting thread to point you to for this one specifically - it's a niche corner of an already niche feature. The practical habit that actually helps: start with a small intervals count and print_keyframes on while you're dialing in mult_start/mult_end, so you're reading the actual numbers the ramp produces rather than guessing from the UI sliders alone.

CategoryAnimate Diff πŸŽ­πŸ…πŸ…“/context opts/context extras/contextref

Inputs (12)

NameTypeDefaultDescription
start_percentFLOAT0.0000–1β€”
end_percentFLOAT1.0000–1β€”
mult_startFLOAT1.0000–1β€”
mult_endFLOAT1.0000–1β€”
interpolationCOMBO4 options: linear, ease_in, ease_out, ease_in_out
intervalsINT502–100β€”
inherit_missingBOOLEANtrueβ€”
print_keyframesBOOLEANfalseβ€”
prev_kfoptCONTEXTREF_KEYFRAMEβ€”
mult_multivaloptMULTIVALβ€”
mode_replaceoptCONTEXTREF_MODEβ€”
tune_replaceoptCONTEXTREF_TUNEβ€”

Outputs (1)

NameTypeDescription
CONTEXTREF_KFCONTEXTREF_KEYFRAMEβ€”