Normalize Video Latent Start
Fix the weird first frames of a generated video before you sample
- latent
- LATENT
Video models have a tic: the first few frames of a generated clip often look off - a brightness jump, a color cast, a statistical "bump" that the rest of the video doesn't have. It shows up in two-pass video pipelines and in image-to-video setups where the latent start region doesn't match what follows. Normalize Video Latent Start is a surgical fix for exactly that: it reshapes the statistics of the opening latent frames so they match the frames that come after, before the sampler ever sees them.
What it is
A latent-space utility node - you wire it in after VAE encoding (or after whatever produces your video latent) and before the sampler. Inputs:
- latent - the video latent to process. It's specifically a 5D (video) latent; a single-frame latent passes through unchanged.
- enabled - toggle to disable without removing the node from the graph (default on).
- start_frame_count - how many latent frames from the start get normalized (default 4).
- reference_frame_count - how many frames immediately after the start region are used as the reference for what "normal" should look like (default 5).
Output: the processed LATENT, ready for your sampler.
How it works
The mechanism is the kind of thing that reads scary and is actually simple. For each of the first start_frame_count latent frames it computes the per-frame mean and standard deviation, then rescales those frames so their mean and std match the reference frames that follow - the classic mean/std normalization, done frame-wise in latent space.
The smart touch is the clamping: the reference statistics are clamped to a window around the source frame's own stats, so the node won't slam your first frames into some extreme value if the reference happens to be wild. It's a conservative adjustment - it nudges the opening frames toward statistical continuity rather than imposing a hard target. Disabled, or on a single-frame latent, it's a pure passthrough.
When you'd reach for it
- Two-pass / chained video generation, where the seam between passes lands at the start of a segment and the first frames come out discolored.
- I2V workflows where the latent's start region doesn't match the conditioning's statistics, producing a visible "pop" at frame one.
- Any video latent where the opening frames look statistically detached from the body of the clip.
It won't fix bad conditioning or a bad model - this is a continuity tool, not a cure-all. But when the symptom is specifically "the beginning looks different," it's the right hammer.
Installing it
Part of the Nifty Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Stibo/comfyui-nifty-nodes
or search "Nifty Nodes" in ComfyUI Manager, then restart. No model downloads, no extra dependencies.
Gotchas
Defaults are sane - 4 start frames referenced against 5 - but if your video is long and the issue crawls further in, raise start_frame_count. If the fix overshoots and the opening frames start to look flat, lower it. And remember it only makes sense on real video latents; pipe an image latent through and it just passes it through. As with the whole pack, it targets the newer ComfyUI V3 API - update ComfyUI if the node doesn't appear after install.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | Video latent to normalise. Must be a 5D latent (video). Passed through unchanged if only 1 frame. | |
| enabled | BOOLEAN | true | When disabled, the latent is passed through unchanged. |
| start_frame_count | INT | 41–16384 | Number of latent frames to normalize, counted from the start. |
| reference_frame_count | INT | 51–16384 | Number of latent frames immediately after the start frames to use as the normalization reference. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |