Nodes/ComfyUI-MiniMaxH3-Contex-Loop/MiniMax H3 Masking · Loop Source AV Target
ComfyUI Node

MiniMax H3 Masking · Loop Source AV Target

Copy the real source-video interval into H3's joint target — frame-locked, sound included

By ethanfel·Created 17 days ago·Updated about 19 hours ago· 315
MiniMax H3 Masking · Loop Source AV Target
  • state
  • latent
  • vae
  • audio_vae
  • source_frames
  • source_audio
  • source_target
  • scene_frames
  • scene_audio
  • status
source_fps24.000
cropcenter

Loop Source AV Target is where a masked-editing production stops treating the source as a reference and starts treating it as the canvas. You feed it the current scene's interval from a source video, and it copies frame-locked video and audio encodes into the stock H3 joint target - so H3 regenerates inside the existing footage rather than alongside it. This is the video-editing version of "inpaint, don't generate": everything you don't touch stays exactly as shot, motion and camera and sound included.

The pack's own docs put it plainly: "Do not feed the source movie into Ref2VA again merely to label it. The source movie is already the clean target latent and supplies protected pixels, motion, camera, and synchronized audio. A picture reference should supply only the replacement appearance." That sentence is the whole philosophy. Source = protected canvas. Reference = what the new thing should look like.

What it needs

  • state - current state from H3 Chain Current Shot, which tells the node which scene interval to select.
  • latent - the current stock H3 joint target, normally the latent output from Chain Context. This is what gets replaced.
  • vae and audio_vae - the H3 video VAE and the H3 audio VAE, respectively. Both, always; it's an AV joint target.
  • source_frames - the complete decoded source-video timeline.
  • source_audio - audio from that same source video.
  • source_fps - the actual FPS of source_frames (connect the FPS output from Get Video Components - don't guess).
  • crop - resize policy: center preserves aspect ratio and center-crops overflow; disabled stretches to the target canvas. Center is the default and the right one for most footage.

What you get out

source_target - the stock H3 target with the exact source-video and source-audio scene interval encoded into it, ready for Apply Target Mask. Plus scene_frames (the resized 24 fps source frames for the current scene), scene_audio (the synchronized audio interval), and status (selected range, target grid, and any audio tail padding).

The node picks the interval using generation_start_frame and the joint target's grid, which is the frame-exactness that makes a tracked mask or a fixed-region inpaint land where you expect it. And because it uses the authoritative stock joint target, it slots into the normal H3 graph without the multiple VAE-encode + SetLatentNoiseMask + concat dance that the Ablejones/MaskVidExperiments-style workaround needs - the pack's docs literally map that older workflow's three nodes onto this one plus Apply Target Mask.

Install

From ComfyUI-MiniMaxH3-Contex-Loop. ComfyUI Manager → search the pack, or:

cd ComfyUI/custom_nodes
git clone https://github.com/ethanfel/ComfyUI-MiniMaxH3-Contex-Loop.git

Restart. No pip deps. The masked path needs current ComfyUI with native Add Guide (PR #15439) plus native per-token H3 AV masks (PR #15375). H3 weights aren't bundled and are geofenced out of the US/EU/UK/South Korea.

Gotchas

The VAE mismatch is the classic killer: audio VAE where the video VAE belongs produces a target that's silently wrong. And don't wire a picture reference into Ref2VA as a stand-in for the source - that's the exact mistake the docs warn about, and it replaces your protected canvas with a vibes-based approximation. Keep the source in this node and the new appearance in the reference line, and the two never fight.

Categoryconditioning/minimax/contex_loop/masking

Inputs (8)

NameTypeDefaultDescription
stateH3_CHAIN_STATECurrent state from H3 Chain Current Shot.
latentLATENTCurrent stock H3 joint target, normally the latent output from Chain Context.
vaeVAEMiniMax H3 video VAE.
audio_vaeVAEMiniMax H3 audio VAE.
source_framesIMAGEComplete decoded source-video timeline.
source_audioAUDIOAudio from the same source video.
source_fpsFLOAT24.0000.001–1000Actual FPS of source_frames. Connect the FPS output from Get Video Components.
cropCOMBOcenterResize policy for the selected source-video interval: disabled stretches to the target canvas; center preserves aspect ratio and center-crops.

Outputs (4)

NameTypeDescription
source_targetLATENTCurrent stock H3 target with the exact source-video and source-audio scene interval encoded into it.
scene_framesIMAGEThe resized 24 fps source frames selected for the current scene.
scene_audioAUDIOThe synchronized source-audio interval selected for the current scene.
statusSTRINGSummary of the selected timeline range, target grid, and any audio tail padding.