Nodes/PromptStudio_Video/Prompt Studio H3 Motion Context
ComfyUI Node

Prompt Studio H3 Motion Context

The context-splicing node

By tiko13·Created 27 days ago·Updated a day ago· 6
Prompt Studio H3 Motion Context
  • conditioning
  • latent
  • video_vae
  • audio_vae
  • conditioning
  • latent
  • trim_frames
context_latent_path
context_video
context_frames39

Video models like MiniMax H3 generate in one finite burst, and "make it longer" has historically meant re-rolling the whole clip or bolting on a hack that only sort of matches the previous frames. The PromptStudio_Video pack's answer is its own native continuation path - no third-party motion-context node pack, no runtime patch - and Prompt Studio H3 Motion Context (PSV_H3MotionContext) is the node that does the actual splicing. Its job: take the exact tail of a finished H3 render, graft it onto the front of a new extension render as protected context, and hand back conditioning plus a latent the sampler can extend from.

If that sounds like magic, it's mostly careful bookkeeping. MiniMax H3 latents carry two streams at once - a video latent and a separate audio latent - that share a clock but tick at different rates (audio latent runs at 40 Hz against 24 fps video). H3's temporal grid maps pixel frames to latent steps unevenly, in a repeating 1, 4, 4, 4, 4 pattern, which is why the pack's context lengths are only ever 5, 22, 39, or 56 frames - the counts that land cleanly on that grid. The default (and, for this node, the only value that works) is 39 frames, which is exactly 12 video latent steps and 65 audio steps. That's the standard "Soft AV" handoff length this pack uses for every continuation.

How it works

It reads the parent's saved latent tail (or, if none exists, falls back to decoding the tail of a source video through the video and audio VAEs), then:

  • copies the exact 39-frame video tail and 65-step audio tail into the front of the new target latent;
  • builds nested denoise masks that fully protect the picture prefix and the first 57 audio steps, then release only the final 8 audio steps with a half-cosine ramp, so the model can generate a smooth transition into new sound instead of a hard cut;
  • drops any native MiniMax guide keyframes that would sit inside the protected prefix and adds its own continuation guide at frame zero.

It checks at runtime that your ComfyUI actually has native H3 nested-mask support (require_native_masks()), and refuses to run otherwise - that's a feature, not a bug, because silently running on a build without the masks would produce garbage.

The inputs that matter

You connect conditioning and latent from a Director node - they're the new extension's target - plus video_vae and audio_vae, which are only really needed for the fallback path. context_latent_path is the safetensors path produced by the pack's Save H3 Context node; context_video is the parent video path used when no saved latent exists. context_frames defaults to 39 and must stay there (the 5–56 widget range comes from the shared grid helper; actual continuation is hard-coded to 39).

Outputs: a conditioning that feeds the guider, a latent that feeds the sampler's latent_image, and trim_frames - the 39-frame count the pack's Trim H3 Context node needs so the decoded output can drop the repeated head.

What you'll actually do

Realistically, you won't hand-wire this. Video Studio's Continue video feature - both Quick generate and the full extension builder - injects this node between the Director and the guider/sampler automatically, and it's the keystone of the whole flow. When it fails, it's almost always one of three things: an outdated ComfyUI (update to get native H3 masks), a parent and extension at different resolutions or with mismatched streams, or a latent that isn't batch-1 H3 output. All three raise clear errors rather than failing silently. For the beginner the takeaway is simpler: this is the node that lets your H3 project keep telling a story past a single clip's limit, and it's why the pack saves every render as a branchable parent instead of overwriting it.

CategoryPrompt Studio/Video

Inputs (7)

NameTypeDefaultDescription
conditioningCONDITIONING
latentLATENT
video_vaeVAE
audio_vaeVAE
context_latent_pathSTRING
context_videoSTRING
context_framesINT395–56

Outputs (3)

NameTypeDescription
conditioningCONDITIONING
latentLATENT
trim_framesINT