😺NKD AV Latent Extend
Build a long MiniMax H3 take out of short clips, sound staying in sync
- previous
- new_latent
- latent
- overlap_frames
- trim_seconds
Every local video model has a patience problem: it samples a few seconds at a time, and if you want a long take you chain short clips together. The naive way to do that with MiniMax H3 is a masked-extension workflow you have to rebuild by hand every time, with the audio overlap cut on a different clock than the picture. 😺NKD AV Latent Extend is that workflow collapsed into one node - the author credits the masked-extension idea to the community's Ablejones, and this node is essentially that recipe made into a single box.
How it works
You feed it two latents and it plants one inside the other:
previous- the AV latent of the segment to continue, straight off the previous stage's KSampler, before decoding. It needs the latent, not the pixels.new_latent- the empty AV latent of the new segment, fromMiniMax H3 Reference To Video. Its length is what gets rendered; the overlap eats its first chunks.overlap_chunks(default 2) - how much of the previous clip the model sees to continue from. 1 chunk = 5 frames, each extra adds 17, so 2 chunks ≈ 22 frames ≈ 0.9 s. More buys smoother continuity and costs new footage per stage.
The tail of the old clip is planted at the head of the new empty latent and masked as "keep," so the sampler doesn't start a fresh shot - it carries on the motion and the sound that were already there. The seam is deliberately hard: nothing is blended or faded, the model does the mixing itself over the following frames, which is what makes a continuation move like the clip it came from instead of dissolving into it.
The two outputs that are easy to ignore (don't)
latent goes to the KSampler, obviously. But the overlap is regenerated context, so it has to come back off after decoding - that's why the node also hands you:
overlap_frames- feed it toImage Batch Extend With Overlap(side=source,mode=cut) to drop the regenerated head from the picture.trim_seconds- the same overlap measured on the audio latent grid (1/40 s). Feed it toTrim Audio Duration'sstart_index. This is the part people get wrong: cutting the sound at the video-frame time instead drifts a few milliseconds every stage, and those add up across a long chain.
It also refuses rather than guesses - a previous and new_latent of different sizes, a previous clip shorter than the overlap you asked for, or a new latent no longer than the overlap all stop with a message saying which. That's friendlier than a silent seam.
Install and gotchas
Install via ComfyUI Manager (search ComfyUI-NKD-Basic-Tools) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-NKD-Basic-Tools
Restart after. Pack dependencies are onnxruntime and huggingface_hub; neither is needed here. Watch the overlap math - more overlap means smoother continuity but less new footage per stage, so there's a real trade-off to tune, not a "set and forget." And the standing H3 caveat applies: the weights are licence-locked out of the US, EU, UK and South Korea, so check your region before building a pipeline around it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| previous | LATENT | The AV latent of the segment to continue — the previous stage's KSampler output, before decoding. | |
| new_latent | LATENT | The empty AV latent of the new segment, from MiniMax H3 Reference To Video. Its length is the length rendered; the overlap eats its first chunks. | |
| overlap_chunks | INT | 21–16 | How much of the previous clip the model sees to continue from, in latent chunks. 1 chunk = 5 frames, each extra adds 17 (2 = 22 frames, ~0.9 s — the workflow default). More = smoother continuity, less new footage per stage. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | Masked AV latent, ready for the KSampler. |
| overlap_frames | INT | Pixel frames of overlap. Feed Image Batch Extend With Overlap (side=source, mode=cut) to drop the regenerated head after decoding. |
| trim_seconds | FLOAT | The same overlap in seconds, on the AUDIO latent grid (1/40 s) — feed Trim Audio Duration's start_index. Cutting at the video-frame time instead drifts a few ms per stage. |