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

ContextRef Keyframes From List πŸŽ­πŸ…πŸ…“

Batch-generate a ContextRef schedule

By KosinkadinkΒ·Created 3 years agoΒ·Updated 8 days agoΒ· 3,519
ContextRef Keyframes From List πŸŽ­πŸ…πŸ…“
  • prev_kf
  • mult_multival
  • mode_replace
  • tune_replace
  • CONTEXTREF_KF
β—„mults_float-1.000β–Ί
β—„start_percent0.000β–Ί
β—„end_percent1.000β–Ί
β—„inherit_missingtrueβ–Ί
β—„print_keyframesfalseβ–Ί

Placing ContextRef keyframes one at a time with the single Keyframe node is fine for two or three points. If you want a schedule with a dozen distinct values across the render, this is the node that builds the whole chain in one shot instead.

What it does

mults_float is where the list goes in - feed it a connected list of multiplier values, one per keyframe you want generated, rather than typing a single number; the scalar default shown on the node (-1) is just the placeholder for when nothing's connected. start_percent and end_percent (0 and 1 by default) bound the span of the sampling process the generated keyframes get spread across. inherit_missing (default true) controls whether each generated keyframe falls back to the parent ContextRef node's mode and tune when mode_replace/tune_replace aren't set. print_keyframes (default false) is worth turning on the first time you use this node - flip it to true and it dumps the generated schedule to the console, so you can actually see the start_percent/mult pairs it built before committing GPU time to a render based on them.

prev_kf lets you chain this generated block onto an existing hand-built keyframe chain from the single Keyframe node, and mult_multival lets a mask or per-frame list drive strength on top of the list you fed in. Output is CONTEXTREF_KF, same as the single Keyframe node, feeding into ContextRef's contextref_kf input.

When to reach for this instead of the single Keyframe node

Anytime you're thinking in terms of "I have a set of values I already computed or want to sweep through" rather than "I want to place two or three deliberate points by hand." It trades precision over each point's exact position for speed building the whole schedule.

What actually feeds mults_float

In practice this means wiring in something like a Float list primitive, or the output of another node that produces a batch of numbers - the widget's own -1 default is only ever what you see when the input is left disconnected. If you're not sure what upstream node to use, the simplest starting point is a small primitive list you type by hand, one value per keyframe you want; get that working before reaching for anything more automated.

Installing it

ComfyUI Manager: search AnimateDiff Evolved, author Kosinkadink, install, restart. Or clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved into custom_nodes manually and restart.

Common issues

Given how obscure this specific feature is in the community - there's essentially no public discussion of ContextRef to lean on - the safest habit is exactly what print_keyframes is for: turn it on, check the printed schedule matches what you expected, then turn it back off once you trust the setup. It's a small step that saves you from discovering a malformed list only after a long context-window render finishes looking wrong.

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

Inputs (9)

NameTypeDefaultDescription
mults_floatFLOAT-1.000β€”
start_percentFLOAT0.0000–1β€”
end_percentFLOAT1.0000–1β€”
inherit_missingBOOLEANtrueβ€”
print_keyframesBOOLEANfalseβ€”
prev_kfoptCONTEXTREF_KEYFRAMEβ€”
mult_multivaloptMULTIVALβ€”
mode_replaceoptCONTEXTREF_MODEβ€”
tune_replaceoptCONTEXTREF_TUNEβ€”

Outputs (1)

NameTypeDescription
CONTEXTREF_KFCONTEXTREF_KEYFRAMEβ€”