MiniMax H3 Latent Composite
Swapping audio or patching a region across two finished H3 clips
- base
- overlay
- samples
Sometimes the clean solution isn't available, and that's when MiniMaxH3LatentComposite earns its place. Its sibling, Partial Denoise Mask, is the pack's preferred way to rewrite part of a clip - but a denoise mask only works when you're re-sampling a latent you're still holding. If you've already generated two finished clips and want to stitch parts of them together, the mask is no help. This node blends latents after the fact: take the audio from one run, or a rectangle-and-time-span of the picture from another, and hand the result to a decoder.
How it works
H3's latent is a NestedTensor holding two independent tensors:
- video:
(B, 24, T, H, W)- an ordinary grid, so a rectangle of it can be replaced and feathered. - audio:
(B, 32, 2, L)- a separate tensor whose length doesn't scale with resolution.
Because they're separate, the audio from a different run entirely slots straight in with nothing to resize - a cheap 0.4 MP pass produces an audio latent with the identical shape to the one from a finished 1.5 MP clip. Two things this buys you:
- Audio re-roll. Sample a cheap small pass with a new seed, keep only its audio, put it on the finished big clip's video. The picture is untouched and the audio is a fresh take.
- Partial rewrite. Sample the same shot twice - different seeds or an edited prompt - then keep clip B only inside a rectangle and/or time span. Everything the two runs share stays bit-identical, so the seam has little to hide.
Honest framing, though: this is a post-sampling composite. Both clips were fully generated, so it's more expensive than masking would have been, and the mask is the pack's preferred route whenever you can still re-sample. The source even explains why the mask can't always do the audio job - the mask gets broadcast onto the audio tensor too and the shapes don't match. Composite exists for the cases the mask can't reach.
The inputs that matter
base- the clip you're keeping ("The clip you are keeping", per the tooltip).overlay- the clip you're taking from.audio-keep base,take overlay, ormix. Formix,audio_mixis the crossfade:0= base,1= overlay.video-keep base,take overlay, orregion. Inregionmode thex_pct/y_pct/w_pct/h_pctrectangle (feathered byfeather_pct) and thet_start_pct–t_end_pctspan (feathered byt_feather_pct) are lifted from the overlay and dropped into the base.
The rectangle and time-span percentage inputs work exactly like the Partial Denoise Mask's - you can feed them from the Region Picker and Time Range nodes.
Errors you'll meet
Both inputs must carry a video latent, and if you choose take overlay the two video tensors have to match shape exactly - it raises video latents differ in shape otherwise. If your two runs don't match resolution, resize one to the other first with the pack's Latent Spatial Resize, which knows to leave the audio alone.
Install
ComfyUI Manager, search MiniMax H3 Inpaint Tools, or:
cd ComfyUI/custom_nodes
git clone https://github.com/panghea/ComfyUI-MiniMax-H3-Inpaint-Tools
cd ComfyUI-MiniMax-H3-Inpaint-Tools && pip install -r requirements.txt
Restart and it sits under MiniMax H3/latent, fed by a Load Latent on each side.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| base | LATENT | The clip you are keeping. | |
| overlay | LATENT | The clip you are taking from. | |
| audio | COMBO | keep base | 3 options: keep base, take overlay, mix |
| audio_mix | FLOAT | 0.500–1 | 0 = base, 1 = overlay. Only used for "mix". |
| video | COMBO | keep base | 3 options: keep base, take overlay, region |
| x_pct | FLOAT | 0.00–100 | Left edge of the rewritten rectangle, %. |
| y_pct | FLOAT | 0.00–100 | — |
| w_pct | FLOAT | 100.00–100 | — |
| h_pct | FLOAT | 100.00–100 | — |
| feather_pct | FLOAT | 6.00–50 | Soft edge on the rectangle, % of frame. |
| t_start_pct | FLOAT | 0.00–100 | Start of the rewritten span, % of the clip. |
| t_end_pct | FLOAT | 100.00–100 | — |
| t_feather_pct | FLOAT | 4.00–50 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| samples | LATENT | — |