Redistribute Keyframe Percents ๐
The fix for the single most annoying temporal masking bug
- timestep_keyframes
- timestep_kf
- info
This node exists because of a specific, reproducible, infuriating behavior: you build a nice multi-keyframe schedule, and every single keyframe lands at start_percent = 0.0 - meaning they're all active from the very first step, the temporal idea collapses, and you spend an evening convinced the whole approach is broken. This node is the fix. It takes your keyframes and redistributes their start_percent values evenly across the timeline, preserving everything else - curves, strengths, masks, images - so a pile of keyframes all stuck at 0% becomes a proper 0%, 25%, 50%, 75%, 100% sequence.
How it works
You feed it a timestep_keyframes group and it rewrites the timing: start_percent and end_percent define the range to distribute across (default the full 0โ1), and distribution picks how the spacing is packed - linear for even spacing (the recommended default), ease_in to cluster keyframes early, ease_out to cluster them late. Under the hood it clones the keyframes and only touches their start_percent values, which is why the curves and mask data survive untouched. It even wraps Advanced ControlNet's keyframe containers in a compatible interface so it works regardless of which version of the dependency you're on.
Outputs are timestep_kf (the fixed keyframes, back into the pipeline) and info (a before/after summary). print_schedule dumps the redistribution to the console when you want to verify.
Where it sits in the workflow
Dead center of the temporal masking pipeline, right after the scheduler that generates the keyframes:
Multi-Mask Combiner (Batch) โ Advanced Curved ControlNet Scheduler
โ Redistribute Keyframe Percents โ Batch Images to Timestep Keyframes
โ Apply CN Extras Masks โ Apply Advanced ControlNet
The README's own troubleshooting for "keyframes not switching during generation" leads here - it's not a workaround, it's the intended step.
Installing it
Same pack:
cd ComfyUI/custom_nodes
git clone https://github.com/diffussy69/comfyui-curved_weight_schedule
pip install matplotlib pillow numpy torch scipy
It needs Advanced ControlNet present (the TimestepKeyframe import), and for full temporal masking the modified fork with per-keyframe image support.
Where people get burned
The temptation is to skip it because it feels like plumbing. Don't - it's the difference between "masks change over time" and "every mask fights for the whole generation." Two setup notes: if your scheduler already produces sensible staggered percentages (some do), running this through will re-space them, so only use it when keyframes actually arrive clumped at 0%. And if the Could not import TimestepKeyframe error shows up, that's the missing Advanced ControlNet dependency, not this node's doing.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| timestep_keyframes | TIMESTEP_KEYFRAME | โ | |
| start_percent | FLOAT | 0.000โ1 | โ |
| end_percent | FLOAT | 1.000โ1 | โ |
| distributionopt | COMBO | linear | 3 options: linear, ease_in, ease_out |
| print_scheduleopt | BOOLEAN | true | โ |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| timestep_kf | TIMESTEP_KEYFRAME | โ |
| info | STRING | โ |