Latent chaining: killing the flicker between video segments

Your 20-second video looks like two different movies glued together. The first half ends on a close-up of a person standing in a kitchen. The second half starts with that same person, same kitchen, but the light is wrong, the face is subtly different, and for one frame the whole image stutters.

That's not a model failure. That's a seam.

I hit this seam the hard way: I'm building a video pipeline for a current project of mine, and the 15-second cap turned every longer clip into a stitching problem. The fixes below are the ones I actually shipped, in the order they failed.

MiniMax H3 is a great video model with a hard ceiling: it stops at 362 frames, about 15 seconds at 24 fps. Everything longer has to be generated as segments and joined. And the naive way to join them is wrong in a way you can measure.

Why the seam is visible

Every segment starts from fresh noise. Nothing tells segment 2 what segment 1's last frame looked like — the model just invents its own "first frame" from the prompt. So you get two internally consistent halves that disagree at the boundary. The flicker, the color pop, the face morph: that's the disagreement.

Fix one was obvious: decode each segment on its own. Decoding a concatenated latent blob corrupts every frame after the seam — the VAE doesn't like being fed a grid it wasn't trained on. Per-segment decode makes that class of corruption impossible by construction.

Fix two: rebase the storyboard. Each segment's prompt has to be rewritten in segment-local time — timestamps shifted, out-of-range shots dropped, a continuation note injected. A segment left with no shots gets a synthetic continuation shot instead of garbage.

Fix three is the interesting one, and it's called latent chaining.

Stay in the latent space

Instead of feeding the next segment a decoded image of the previous segment's last frame, slice the raw last video-latent frame and inject it directly as the next segment's first-frame keyframe. No decode, no encode, no roundtrip through pixels. The chain stays in distribution, so the seam becomes a continuation instead of a jump.

I tested the obvious alternative — decoded-frame CLIP conditioning — and measured it. Unstable: 2.4 with the raw latent, 5–8 with decoded frames. That's not a small difference, that's the difference between a continuous shot and a morph.

The last fix is boring but it matters: balanced splits. 20 seconds becomes [10, 10], never [15, 5]. Short tails are measurably less stable, and a 5-second tail is where your flicker hides.

What you get

Segments that start on the exact final frame of the previous one, in-distribution, with the audio crossfaded at the seam. The whole thing runs on standard ComfyUI nodes, visible and editable — no black boxes. It's the stitching layer of my current project, and it's the difference between clips and something that feels like one take.

If you're stitching long videos from H3 (or any frame-capped video model), skip the decode-encode roundtrip. Chain the latents.