Nodes/ComfyUI-Easy-Media/Easy MiniMax H3 Context Swap Pure Drift-Control AV
ComfyUI Node

Easy MiniMax H3 Context Swap Pure Drift-Control AV

The hidden drift-control node

By yolain·Created 4 months ago·Updated about 23 hours ago· 184
Easy MiniMax H3 Context Swap Pure Drift-Control AV
  • model
  • latent
  • context_latent
  • sigmas
  • model
  • latent
  • trim_frames
context_length22
seed0
continue_audiotrue
freeze_audiofalse

The full name - "Easy MiniMax H3 Context Swap Pure Drift-Control AV" - is a mouthful hiding a simple fact: you almost never add this node yourself. It's an internal dev-only helper injected into the graph by easy multitrackProject whenever a segment's continuity mode is set to Character Swap Context (context_swap). See it in an expanded graph and you're looking at the machinery that lets MiniMax H3 replace who is in a shot while keeping what they were doing - and the sound of it.

The problem it solves

MiniMax H3 generates video with native audio, which is great until you want continuity across a long, multi-segment timeline. The pack's plain Context mode copies the previous segment's audio/video tail into the next one so motion and sound flow across the join. But that cuts both ways: if the next segment asks for a different character doing the same motion, the old appearance in the copied tail fights your prompt. The classic workaround was dumping tapered noise over the copied context so the model could re-draw the character - at the cost of wrecking some of the motion you were trying to keep.

That's the trap this node escapes. The v1.3.1 changelog is blunt: the noise-based swap became drive_control, adapted from ethanfel's ComfyUI-MiniMaxH3-Context-Loop. Testing showed it's more stable and preserves more motion detail. The trade-off is honest too - slightly reduced sharpness versus the noise scheme, because the model never re-details the copied region.

How it works

Instead of adding noise to the previous result, the node's apply_context_swap_drift_control does four things:

  1. Copies the tail of the previous delivered segment (context_latent) straight into the front of the current segment's starting latent - the "disposable target prefix." The saved predecessor is never modified, so later segments don't inherit noise-polluted context.
  2. Patches a clone of the model with a dynamic denoise mask that tracks the actual sigma schedule. Early in sampling the copied video prefix is held in place (denoise masked); as sigmas descend, the mask releases it over a short 4-frame taper, the release ratio matched to next_sigma / current_sigma. Motion survives cleanly while the model draws the new character into the freed frames.
  3. On the audio side (default) it copies the previous audio tail and lets go with an 8-tick half-cosine soft release at the seam - no click, no sudden voice change.
  4. Hands back a trim_frames count so the pipeline chops the repeated context prefix off the decoded result before saving.

Inputs and outputs that matter

Most inputs you'll never touch - the project node fills them in for you. The two you'd actually think about:

  • context_length (combo, default 22) - frames of the previous segment's tail copied as the join. 22 is the pack's standard and matches H3's temporal grid; 5/39/56 are the other legal options.
  • continue_audio (bool, default on) - carry the previous audio tail across the seam with that soft release; turn it off if the new segment shouldn't inherit sound.

Worth knowing: seed is a lie. Its tooltip says it exists only "for graph compatibility with older context_swap patches" - Pure Drift-Control ignores it. And freeze_audio (default off) serves a hi-res path the default project patch doesn't use - it prefers ordinary hi-res refine.

Outputs: model (the patched model you sample with), latent (your starting latent with the copied prefix and masks baked in), and trim_frames (an INT feeding the trim step). Hand-building around this node: model → SamplerCustomAdvanced.model, latent → ...latent_image, and feed trim_frames wherever you crop the front of the output.

Installing and prerequisites

This node ships inside the wider pack, so install is one step: ComfyUI Manager → search ComfyUI-Easy-Media, or

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Media

then restart ComfyUI. The README strongly recommends FFmpeg on the system, and you need a current ComfyUI - context continuity relies on native H3 audio/video keyframe support (0.34.0+), and drift-control needs its dynamic denoise-mask and apply-model-wrapper support. No extra Python deps ship with the pack, but you do need the H3 weights plus its video and audio VAEs. One real gotcha: the MiniMax H3 Community License excludes the US, EU, UK and South Korea from running the local weights - in those regions only the hosted Hailuo API path is licensed.

Common issues

  • Don't delete the dev nodes. In the project's expanded graph they look like noise; removing easy MiniMaxH3ContextSwap silently breaks the swap.
  • Context needs saved latents, not just an MP4. Change an earlier segment's dimensions, scale, or version and you must regenerate the context latents before resuming - later segments aren't auto-fixed.
  • Expect a hair less sharpness at the seam. That's the design trade-off, not a bug; it's the price of motion that doesn't jitter.

To actually run it, set a segment's continuity mode to Character Swap Context in the MultiTrack editor and let this node do its quiet job underneath.

CategoryEasyUse/MiniMax

Inputs (8)

NameTypeDefaultDescription
modelMODEL
latentLATENT
context_latentLATENT
sigmasSIGMAS
context_lengthCOMBO224 options: 22, 5, 39, 56
seedINT00–18446744073709550000Retained only for graph compatibility with older context_swap patches. Pure Drift-Control ignores this value.
continue_audioBOOLEANtrueCopy the previous audio-latent tail and use an 8-tick half-cosine soft release at the seam.
freeze_audioBOOLEANfalseKeep the current audio latent fully frozen. This is used only when explicitly calling the node for hi-res video-prefix continuity, but the default project patch uses ordinary hi-res refine.

Outputs (3)

NameTypeDescription
modelMODEL
latentLATENT
trim_framesINT