MiniMax H3 • Video Inpaint
Inpainting inside H3's video latent, not on the pixels
- av_latent
- mask
- av_latent
Inpainting a video usually means masking pixels and hoping the model re-renders the region consistently frame after frame. H3 does it one level deeper: the mask maps onto the video latent grid, and the model decides how hard to regenerate each region inside the latent itself. MiniMaxH3LatentLabVideoInpaint is the node that bridges your ComfyUI MASK into that grid.
The rule, from the node's own description: white in the mask uses denoise_inside, black uses denoise_outside - and audio is controlled separately, because H3 treats picture and sound as one latent.
av_latent(LATENT) in,av_latentout.mask(MASK) - any mask you can produce in ComfyUI: segment anything, a tracked region, hand-painted.denoise_inside(default 1.0) - how hard the masked region gets regenerated.denoise_outside(default 0.0) - how hard the unmasked region gets regenerated.audio_denoise(default 0.0) - the audio stream's denoise strength, independent of the picture.merge_mode-replace,multiply,minimum,maximum- how this mask combines with any mask already on the latent.
What you can actually do with it
The classic move is "regenerate the center, keep the edges": denoise_inside = 1, denoise_outside = 0. An object in the middle of the frame gets fully re-rolled while the composition around it stays pinned. Flip it, and you get "keep the subject, redo the background" - which is a very handy trick for cleaning up an environment without touching the character.
Under the hood it's simpler than it sounds: the pixel mask gets resampled onto the latent grid, the video denoise map becomes outside + mask * (inside - outside), and everything rides the stock noise-mask path the sampler already reads. No exotic conditioning, no extra models - just a spatial control on top of H3's joint latent.
audio_denoise is where H3 earns its keep. Because the audio stream lives in the same latent, you can lock the soundtrack (audio_denoise = 0) while the video region regenerates - or let the model re-synthesize sound in the masked area, which matters if the inpainted action changes the acoustics. Leave it at 0 unless you're deliberately resampling audio.
Install
One pack, no extra pip deps:
cd ComfyUI/custom_nodes
git clone https://github.com/vizart-vj/ComfyUI-MiniMax-H3-LongMedia
Restart ComfyUI, or ComfyUI Manager → "MiniMax H3 LongMedia". H3 checkpoint and VAEs live in ComfyUI's model folders.
Gotchas
- The mask is spatial, not per-frame-arbitrary - it maps onto the latent grid, so a detailed mask will be softened by the VAE's downsampling. Don't expect pixel-perfect region edges.
- Values must stay in [0, 1]; the node validates and raises on out-of-range inputs.
- If a downstream node uses
replacemerge mode, it can wipe this mask - keep merge modes in mind when chaining. - Pack-wide caveat: H3 weights are excluded from the US, EU, UK and South Korea.
Think of it as ComfyUI's SetLatentNoiseMask, but for a joint AV latent with a separate audio dial. Once you've inpainted a video region while the soundtrack held perfectly still, you won't want to go back to pixel-level guesswork.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| av_latent | LATENT | — | |
| mask | MASK | — | |
| denoise_inside | FLOAT | 1.000–1 | — |
| denoise_outside | FLOAT | 0.000–1 | — |
| audio_denoise | FLOAT | 0.000–1 | — |
| merge_mode | COMBO | 4 options: replace, multiply, minimum, maximum |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| av_latent | LATENT | — |