Nodes/ComfyUI-ZeroCopy-Continuity/πŸ”„ CUDA Zero-Copy Latent Handoff (Continuity)
ComfyUI Node

πŸ”„ CUDA Zero-Copy Latent Handoff (Continuity)

Hand a Latent from One Shot to the Next, No VAE in Between

By latentforge-devΒ·Created 6 days agoΒ·Updated 4 days agoΒ· 0
πŸ”„ CUDA Zero-Copy Latent Handoff (Continuity)
  • clip
  • vae
  • fallback_first_frame
  • positive
  • latent
β—„promptβ€”β–Ί
β—„width1280β–Ί
β—„height768β–Ί
β—„length192β–Ί
β—„buffer_tagshot_continuityβ–Ί
β—„continuity_modezero_copy_latent_onlyβ–Ί
β—„blend_ratio1.00β–Ί

ZeroCopyLatentHandoff is the same class as CineFluxZeroCopyLatentHandoff - the pack registers both keys against one implementation, because the CineFlux-prefixed names are for the author's own pipeline and these are the "clean, non-namespaced aliases for general community usage." Identical ports, identical behaviour, same entry in the menu under model/conditioning/minimax (yes, you'll see it twice; pick either).

So this article is about what the node does out in the wild, rather than inside CineFlux: how it fits a multi-shot video graph, and where it will and won't buy you anything.

The job it does

Long-form video in ComfyUI is still a chaining problem. Every serious workflow ends up doing the same thing - generate a clip, take its last frame, start the next clip from that frame. The reference implementation in the community is last-frame-to-first-frame I2V (one user's "30 seconds" of anime ran off weeks of a 4090 at 40 minutes per 81 frames), and the fancier 2026 answer is nodes that roll the whole chunk loop into one widget.

This node is a smaller, more surgical trick: keep the previous shot's final latent frame in VRAM, and inject it into the next shot's conditioning without ever decoding to pixels. The previous shot's Store node put the latent in a resident buffer under a tag; this node slices [:, :, -1:, :, :] off it, resamples it if your canvas changed resolution, and attaches it as keyframe 0 of the new shot.

What you actually wire

clip, vae, prompt, width, height, length are required; fallback_first_frame, buffer_tag, continuity_mode, blend_ratio are optional. The outputs are positive (drop it into the KSampler's positive input) and latent (into the KSampler's latent input). You still need a separate negative conditioning - the node returns only the positive side.

Set buffer_tag to whatever the Store node used - shot_continuity is the default on both, so if you leave both alone they match. Then pick a mode:

  • zero_copy_latent_only - the pure path. No VAE encode at all, so shot 2's opening frame is the exact latent shot 1 ended on.
  • blend_with_fallback - mixes that latent with a VAE-encoded fallback_first_frame by blend_ratio (1.0 = all previous shot, 0.0 = all new frame). This is the mode you want when the camera cuts: a hard latent hand-off across a 180Β° turn produces a smear, and 0.5–0.7 keeps colour and grain continuity while letting the new composition in.
  • fallback_only - encode the image and move on. Useful as a control run to see whether the latent path is doing anything at all.

The compatibility catch

Be clear-eyed about this one: the conditioning it produces carries a minimax_keyframes entry, and that's a MiniMax-H3 conditioning key. The node also sizes its empty latent for H3's layout - 24 video channels plus an audio stream [1, 32, 2, T].

The README lists Wan 2.1, HunyuanVideo, FLUX.1 and LTX-Video as supported architectures. The VRAM pin genuinely is model-agnostic, but the hand-off path is not: on a Wan or LTX graph your sampler isn't reading minimax_keyframes, and a 24-channel nested latent isn't the latent those models sample. Practically, on non-H3 models this node is a keyframe-encode helper (fallback_only behaviour), and you'll want your model's own latent node feeding the sampler. LTX at least has native start/end keyframe conditioning since 0.9.5, which is the thing to reach for there.

Install

Manager β†’ ComfyUI-ZeroCopy-Continuity, or:

cd ComfyUI/custom_nodes
git clone https://github.com/latentforge-dev/ComfyUI-ZeroCopy-Continuity

Restart ComfyUI. No model files, no dependencies past torch. (The README's clone URL has a stale latentforge/ org - use the one above.)

Troubleshooting, the short list

Nothing continues on the first run. The buffer is process memory, and it's empty until a Store node has executed in that same ComfyUI session. Queue shot 1, then shot 2.

It silently falls back. A tag typo, or a previous latent with the wrong rank - the tail slice only accepts a 5-dimensional [B, C, T, H, W] video tensor, and image-model latents are 4D, so it logs a warning and bails to the fallback path. Check the console, not the graph.

Your 8-second shot comes back shorter. With H3's helper module absent, the internal latent builder clamps length to 362 frames regardless of the 3600 the widget allows.

Latent-space resizing is bilinear in the shipped code (the README says bicubic). Keep resolutions consistent between shots if softness matters.

Categorymodel/conditioning/minimax

Inputs (10)

NameTypeDefaultDescription
clipCLIPCLIP / Text-Encoder model.
vaeVAEVideo VAE for fallback encoding.
promptSTRINGβ€”
widthINT128032–8192β€”
heightINT76832–8192β€”
lengthINT1925–3600Frame count at 24 fps (192 = 8 seconds).
fallback_first_frameoptIMAGEReference image used for visual tokens or cold start.
buffer_tagoptSTRINGshot_continuityBuffer tag from which the previous shot's tail latent is pulled.
continuity_modeoptCOMBOzero_copy_latent_only'zero_copy_latent_only': Bit-identical latent handoff from prior shot (Zero VAE loss); 'blend_with_fallback': Smooth alpha-blend between prior latent and fallback image; 'fallback_only': Standard keyframe encoding.
blend_ratiooptFLOAT1.000–11.0 = 100% prior shot latent; 0.0 = 100% fallback image.

Outputs (2)

NameTypeDescription
positiveCONDITIONINGβ€”
latentLATENTβ€”