Latent Keyframe Interp. ππ π π
Ramp ControlNet strength across a batch of frames
- prev_latent_kf
- LATENT_KF
If Timestep Keyframes control ControlNet strength over time (across sampling steps), Latent Keyframes control it per latent - which matters a lot once you're generating a batch of frames for AnimateDiff or any other multi-latent workflow. LatentKeyframeTiming is the node for that: instead of placing a strength on one specific frame, it interpolates a strength curve across a whole range of them in one node. It's officially called "Latent Keyframe Interpolation" in the pack's own docs - the class name is just the more literal one.
How it works
You give it a batch_index range and a strength range, and it fills in one Latent Keyframe per index in between, interpolating from strength_from at the start of the range to strength_to at the end. So on a 16-frame AnimateDiff batch you could ramp ControlNet influence from 0.2 at frame 0 up to 1.0 at frame 15 - a fade-in across the clip - in a single node instead of chaining sixteen individual Latent Keyframe nodes by hand.
The result feeds into a Timestep Keyframe's latent_keyframe input (or the latent_kf_override on Apply Advanced ControlNet, which - per the pack's own docs - applies to every timestep regardless of what other latent keyframes exist, so only use the override if you genuinely want one static per-frame schedule for the whole sample). Any latent whose batch index falls outside every keyframe you've defined just doesn't get a special-cased strength; it falls back to whatever null_latent_kf_strength is set on the enclosing Timestep Keyframe.
The inputs and outputs that matter
batch_index_fromandbatch_index_to_excl- the range of frames this covers. The_exclis not decorative: it's a Python-style exclusive upper bound, so to cover frames 0 through 15 you setbatch_index_to_exclto 16, not 15. Get this off by one and your last frame silently keeps the default strength instead of the one you intended.strength_from/strength_to- the strength at the start and end of the range (0β10, though realistically you'll stay in 0β1.5).interpolation- a dropdown for the curve shape between those two values.prev_latent_kf- chains to a previous Latent Keyframe(-type) node so you can stack multiple ranges (a ramp-up followed by a ramp-down, for instance).print_keyframes(optional, off by default) - dumps the generated keyframes to the console. Genuinely useful here: once you're chaining several of these plus manual Latent Keyframe nodes, it's easy to lose track of which index ended up with which strength, and this is the fastest way to check.
Output is LATENT_KF, same type every other Latent Keyframe node produces, so it composes freely with the rest of the family (Latent Keyframe, Latent Keyframe Group, Latent Keyframe From List).
How to install it
Through ComfyUI Manager: search "ComfyUI-Advanced-ControlNet", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet
then restart. No models to download and nothing heavy in requirements - it's scheduling math, not a network of its own.
Common issues & troubleshooting
A frame at the edge of your range isn't behaving. Almost always the exclusive-upper-bound trap above - double check batch_index_to_excl is one higher than the last index you actually want covered.
It has no effect on a single-image generation. This node is about per-latent variation, so on a batch of 1 there's nothing to differentiate - you'll only see it do anything once you're sampling a real batch (an AnimateDiff clip, a multi-image batch, sliding-context video). For a single image, a Timestep Keyframe's own strength schedule is the one that matters.
Overlapping ranges from two chained nodes. If you stack two LatentKeyframeTiming nodes whose ranges overlap, whatever's already in prev_latent_kf wins for the shared indices - the pack's stated rule for every Latent-Keyframe-type node is that the keyframes coming in through prev_latent_kf take priority over the current node's own values, not the other way around. Worth checking with print_keyframes if a result looks off.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| batch_index_from | INT | 0-9007199254740991β9007199254740991 | β |
| batch_index_to_excl | INT | 0-9007199254740991β9007199254740991 | β |
| strength_from | FLOAT | 1.0000β10 | β |
| strength_to | FLOAT | 1.0000β10 | β |
| interpolation | COMBO | 4 options: linear, ease-in, ease-out, ease-in-out | |
| prev_latent_kfopt | LATENT_KEYFRAME | β | |
| print_keyframesopt | BOOLEAN | false | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT_KF | LATENT_KEYFRAME | β |