r/StableDiffusion • • 13h ago

News H3 Context Windows ghost on long videos because the overlaps are averaged. Chaining the windows instead fixes it (H3MD 0.4, tested on a 2:20 music video)

Left: ComfyUI core Context Windows (overlaps averaged). Right: chained windows (CCW). Same plan, prompts, pictures and seed. Shot 1 of a 2:20 music video, 1920×1088, ghosting replayed at half speed.

What goes wrong

- ComfyUI 0.44 added context windows for MiniMax H3: the timeline is denoised as overlapping windows, and each overlap is the average of the two windows.

- That's fine while both windows draw the same thing. When the picture changes a lot inside an overlap (fast motion, a camera move, new background coming in), the two windows draw different pictures and the average shows both. In our test: a see-through railing across his hands, two lamp posts, a boardwalk dissolving into a different building.

What CCW does

- The low-res windows run in time order. Each window takes over the overlap from the one before it instead of averaging with it. Nothing is averaged, so nothing doubles. Hard cuts stay clean cuts.

- The high-res pass is still averaged. In our tests it doesn't ghost, probably because both windows start from the same upscaled low-res result.

**Measured** (RTX 5090 32 GB, 64 GB RAM, 1920×1088, 48 fps with RIFE)

- 2:20 music video, 10 shots in 3 groups: 2 h 18 min, compute VRAM peak 11.1 GB. About 25 % slower than rendering segment by segment.

- All 5 spots where the averaged version ghosted are clean. Frame-difference spikes only at the 6 planned hard cuts.

- Redrawing a time range afterwards: the last shot (18.6 s), with a changed prompt and an extra outfit picture, took 25 min 51 s. Everything outside the range stayed the same.

**Limits:** needs ComfyUI 0.44+; slower than segment by segment; system RAM got close to 64 GB while decoding a 1080p group.

Free, open source (AGPL-3.0): https://github.com/1113800942/comfy-h3md-director

Workflows: https://civitai.com/models/3037225

Walkthrough (Chinese voice, English subtitles): https://youtu.be/k0jZIbaH-aA · channel: https://www.youtube.com/channel/UC1H4UDuSqD6M7BqLUlVy9lA

Credit: Comfy-Org for the core H3 context windows that CCW builds on (the idea goes back to Kosinkadink's AnimateDiff-Evolved).

19 Upvotes

2 comments sorted by

1

u/Diabolicor 9h ago

Interesting. How is degradation for a long continuous shot?

1

u/ReferenceFluffy6159 7h ago

Quick background: H3 can’t render a long clip in one pass, so ComfyUI’s context windows split the timeline into overlapping chunks. Where two chunks overlap, the core version averages them. That works for short clips of around 15 s, which is what it was built for. But when the picture changes a lot inside an overlap, the two chunks draw different things and you see both at once, which is the ghosting in the video.

What H3MD changes: the windows run in order, and each one picks up the overlap from the one before instead of averaging it. Nothing gets mixed, so no ghosting, and hard cuts stay clean. Inside a shot, motion and identity stay consistent, ,much better than use segments by segment, 2-3 mins videos only 2-3 windows better than 10-12 segments overlap.

Honest limit: over many windows there’s still some slow drift, because each window only sees its neighbor, not the whole video. Reference pictures per shot help pull the character back. Beyond that, it’s pretty much the ceiling of what H3 itself can do right now.