AnimateDiff Keyframe ππ π
Changing how strong the motion is partway through your clip
- prev_ad_keyframes
- scale_multival
- effect_multival
- per_block_replace
- AD_KEYFRAMES
A motion model applied without this node runs at one fixed strength for your whole clip. ADE_AnimateDiffKeyframe is how you change that over time - ramp motion up partway through, dial it back for a calmer ending, or swap which U-Net blocks the model influences at different points. It's the README's "AnimateDiff Keyframes to change Scale and Effect at different points in the sampling process," and it's a required building block the moment you want anything other than flat, uniform motion.
You chain these: each keyframe declares a start_percent (how far into sampling it kicks in) and whatever values it wants to change from that point on, then feeds prev_ad_keyframes into the next one, building up a full timeline before the whole chain goes into a motion model's ad_keyframes input on an Apply node.
How it works
Each keyframe is a checkpoint in the sampling timeline: from start_percent onward, its scale_multival/effect_multival values take over (if you set them), until the next keyframe in the chain takes over in turn. inherit_missing decides what happens to a value you didn't set on this keyframe - true (the default) means it keeps whatever the previous keyframe had, so you only need to specify what's actually changing. guarantee_steps protects a keyframe from being skipped entirely if another one's start_percent would otherwise crowd it out before it gets a chance to run.
The inputs and outputs that matter
Required: start_percent (default 0, range 0β1) - where in the sampling process this keyframe activates.
Optional: prev_ad_keyframes (type AD_KEYFRAMES) - chain the previous keyframe's output here to build a timeline rather than a single isolated point; scale_multival/effect_multival (type MULTIVAL) - the actual values you're scheduling, built with ADE_MultivalDynamic or a plain float; per_block_replace (type PER_BLOCK) for swapping which U-Net blocks the motion model influences at this point in time; inherit_missing (default true); and guarantee_steps (default 1). Output is AD_KEYFRAMES, which fits either the next keyframe's prev_ad_keyframes slot or a motion model's ad_keyframes slot on an Apply node.
How to install it
Standard for the pack - ComfyUI Manager, search AnimateDiff Evolved by Kosinkadink, or:
cd ComfyUI/custom_nodes && git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved
No model download for this node specifically - it schedules behavior on top of whatever motion module you've already loaded.
Common issues & troubleshooting
Built a chain of keyframes and only the last one seems to matter. Check start_percent ordering - if two keyframes have start_percent values close together, or out of the order you intended, the later one in sampling-time wins from that point forward regardless of chain order. Sort your keyframes by start_percent, not by the order you happened to place the nodes.
Set a value on one keyframe and it silently applies to an earlier one too, or vice versa. That's inherit_missing doing exactly what it's for - it's on by default, so an unset field on a later keyframe keeps the earlier keyframe's value rather than resetting to some default. If you want a keyframe to explicitly reset a value rather than inherit it, set that field yourself instead of leaving it blank.
A keyframe you placed close to another one never seems to take effect. Raise its guarantee_steps. Without it, a keyframe scheduled too close to the next one's start_percent can get squeezed out before it ever really runs.
Not sure whether you need this at all. If flat, constant motion strength for the whole clip is fine for what you're making, you don't - a motion model's own scale_multival/effect_multival on the Apply node covers that case with no keyframing required. Reach for this specifically when the strength needs to change over the clip.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| start_percent | FLOAT | 0.0000β1 | β |
| prev_ad_keyframesopt | AD_KEYFRAMES | β | |
| scale_multivalopt | MULTIVAL | β | |
| effect_multivalopt | MULTIVAL | β | |
| per_block_replaceopt | PER_BLOCK | β | |
| inherit_missingopt | BOOLEAN | true | β |
| guarantee_stepsopt | INT | 10β9007199254740991 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| AD_KEYFRAMES | AD_KEYFRAMES | β |