MiniMax H3 Masking · Apply Target Mask
Attach H3's causal video/audio denoise mask to a real AV target — the heart of inpainting
- target_latent
- mask
- audio_mask
- masked_target
- mask_info
Apply Target Mask is the node that turns "H3, edit this video" from a vague hope into a precise contract. It takes a real source AV target - the joint video/audio latent from Loop Source AV Target - and attaches the composed H3 video and audio denoise masks that tell the model exactly which latent regions to regenerate and which to leave frozen. This is the general, manual-mask form of the pack's masked continuation modes, and it's the node you reach for when you want inpainting and temporal edits under your own control rather than the chain's automatic prefix mask.
The mental model is one line: 0 = preserve the source latent, 1 = regenerate this row. Everything else in this node is about mapping your human-space mask onto H3's actual latent geometry without botching it.
The inputs that matter
- target_latent - the joint source video/audio latent used as the actual H3 target. Known regions are preserved from this latent. The tooltip adds the discipline: don't also feed the same source as a video reference - the source is already the target and supplies the protected pixels.
- mask - static or per-frame video-space mask. This is mapped to H3's causal video-latent frames and 2×2 latent-token cells.
- mask_meaning - the convention switch: white = generate or white = preserve. The default is white = generate. Getting this backwards is the single most common way to regenerate the thing you wanted to keep.
- audio_mode - four choices: preserve all source audio, generate all audio, follow the video mask mapped onto time, or use an optional custom
audio_mask(where white time regions generate, black stay protected). Thefollow video maskoption is the one that keeps AV edits feeling unified.
The optional mask_conversion is the sharp edge: H3 exact (causal/token max) maps pixel masks with the video VAE's causal 1/4/4/4/4 frame groups and 2×2 latent-token max coverage - that's the current, correct behavior. legacy trilinear is the older interpolated conversion, kept for workflow comparison. The tooltip says it plainly: changing this changes generation, so update the Plan's generation fingerprint before resuming if you switch.
Outputs: masked_target (a copy of the target latent carrying the composed H3 video and audio denoise mask) and mask_info (a summary of latent dimensions and generated percentages per stream - genuinely useful for sanity-checking whether you're about to regenerate 90% of the frame).
Where it sits
In the maintained masked workflows it comes after Loop Source AV Target: Source AV Target builds the real interval into the joint target, Apply Target Mask attaches the mask, and the result feeds the H3 sampler. For ordinary AV extension you don't need a user mask at all - that's the automatic prefix path. This node is for when you want to decide yourself what gets regenerated.
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 not bundled and geofenced out of the US/EU/UK/South Korea under the Community License.
Gotchas
Mask convention first: confirm white = generate matches your intention before queueing a 20-minute render. Second, the fingerprint: if you change mask_conversion (or the mask path generally changes how generation behaves) on a run you intend to resume, update generation_fingerprint or resume will rightly reject the mismatch. And don't double-feed the source as a reference - the target already carries it, and a redundant reference fights the mask for control of the protected region.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| target_latent | LATENT | Joint source video/audio latent used as the actual H3 target. Known regions are preserved from this latent; do not add the same source again merely as a video reference. | |
| mask | MASK | Static or per-frame video-space mask. It is mapped to H3's causal video-latent frames and 2x2 latent-token cells. Exact mode accepts one static mask or one mask per source frame. | |
| mask_meaning | COMBO | white = generate | Choose whether white pixels regenerate or remain protected. |
| audio_mode | COMBO | preserve source audio | Preserve or generate all source audio, map the video mask onto time, or use the optional custom audio mask. |
| audio_maskopt | MASK | Used only by custom audio mask. Spatial dimensions are reduced; white time regions generate and black regions remain protected. | |
| mask_conversionopt | COMBO | H3 exact (causal/token max) | H3 exact maps pixel masks with the video VAE's causal 1/4/4/4/4 frame groups and 2x2 latent-token max coverage. Legacy trilinear retains the older interpolated conversion for workflow comparison. Changing this changes generation; update the Plan's generation fingerprint before resuming. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| masked_target | LATENT | Copy of target_latent carrying the composed H3 video and audio denoise mask. |
| mask_info | STRING | Summary of the latent dimensions and generated percentages for each stream. |