Nodes/MiniMax H3 Inpaint Tools/MiniMax H3 Partial Denoise Mask
ComfyUI Node

MiniMax H3 Partial Denoise Mask

Fix one spot in a finished MiniMax H3 clip without regenerating the rest

By panghea·Created 4 days ago·Updated 3 days ago· 6
MiniMax H3 Partial Denoise Mask
  • samples
  • samples
trackaudio only
strength1.00
t_start_pct0.0
t_end_pct100.0
t_feather_pct4.0
x_pct0.0
y_pct0.0
w_pct100.0
h_pct100.0
feather_pct6.0

The extra glyph in the logo, the typo in the closing card, the bit of sky you want gone - with MiniMax H3 you used to have two choices: regenerate and hope the rest of the clip survives, or live with it. This node is the third way, and it's the reason the whole pack exists. It pins most of a finished H3 latent and resamples only the part you point at - one track, one time span, one rectangle. The name is a lie in the best way: it doesn't call an API, needs no key, and touches none of the denoising math itself.

Why this works at all

H3 doesn't return a normal latent. It packs [video, audio] into a comfy.nested_tensor.NestedTensor, and ComfyUI's sampler already knows how to handle a nested denoise mask:

out = out * denoise_mask + latent_image * (1 - denoise_mask)

Where the mask is 0, the region is pinned to the latent you fed in - at every step, not stitched back on as a composite when sampling finishes. That's the detail that makes the result bit-identical instead of just similar: the sampler attends to the untouched footage the whole way through, so a rewritten mouth lands on the lip movements already on screen and a re-shot time span sees the frames on both sides of it. The author measured a video-held, audio-only re-roll at 360 s against 845 s for a full generation, with the picture coming back at 40 dB PSNR - indistinguishable to the eye.

This node just builds the mask - it can't get the mechanism wrong because it doesn't implement it.

The inputs that matter

A lot of widgets, but only three groups:

  • track - audio only (default), video only, or both. Because video and audio live as separate tensors inside the NestedTensor, you can hold the picture completely still and resample just the soundtrack, or vice versa.
  • strength - how free the selected region is. 1.0 fully resamples it; lower values keep pulling it back toward the original. For a genuine re-roll you want 1.0.
  • The selection - t_start_pct/t_end_pct/t_feather_pct pick a time span (leave 0–100 for the whole clip), and x_pct/y_pct/w_pct/h_pct/feather_pct pick a rectangle on the video track. Feathering is not optional decoration: without it the seam shows. Defaults of 4% in time and 6% across the frame are sane starting points.

Everything is in percentages because the mask lives on the latent, whose time axis is coarse - roughly one latent frame per 3.3 rendered frames (107 frames became T = 32). That's the finest slice a mask can address, so don't expect to rewrite a single frame.

Wire it like this:

finished latent ──► Partial Denoise Mask ──► SamplerCustomAdvanced.latent_image
RandomNoise(new seed) ────────────────────► SamplerCustomAdvanced.noise

The single output, samples, is your original latent carrying a noise_mask - feed it to the sampler as latent_image and run a fresh seeded pass over the same model.

Install

Through ComfyUI Manager, search MiniMax H3 Inpaint Tools. By hand:

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

Use the Python that runs ComfyUI for that last line, then restart. The nodes land under MiniMax H3/latent. The pack itself downloads nothing - no model files - but it needs ComfyUI built with H3 support (the nodes import comfy.nested_tensor) plus the minimax-h3-latent-core library, which requirements.txt pulls in. That library is under PolyForm Small Business rather than the pack's GPL, so companies over 100 people or $1M revenue should read the terms before running.

Where people get burned

  • A masked pass needs real noise. DisableNoise collapses the inpaint term and the region comes back as colored blocks. That also rules out the two-phase PDD warmup whose second phase runs on DisableNoise by design.
  • PDD doesn't do fine detail here. A shortened schedule (BasicScheduler with denoise < 1) lands off the trained grid and raises not a trained PDD block boundary; on a text repair the distilled pass came back worse than the plain model at the same step count.
  • More steps aren't better. The author found 25 steps came back worse than 8.
  • Don't stretch the audio. The audio latent is 4-D, same rank as an image latent, so anything that "resizes whatever is 4-D or 5-D" mangles the soundtrack. Touch only the 5-D video tensor - this pack's own spatial resize node exists because core LatentUpscale dies on the NestedTensor.

One honest caveat that has nothing to do with the pack: H3's own weights are under the MiniMax H3 Community License, which doesn't grant rights to run them in the US, EU, UK or Korea. This node makes the same clip editable, not the licence more permissive.

CategoryMiniMax H3/latent

Inputs (11)

NameTypeDefaultDescription
samplesLATENT
trackCOMBOaudio only3 options: audio only, video only, both
strengthFLOAT1.000–1How free the selected region is. 1.0 = fully resampled; lower values keep pulling it back toward the original.
t_start_pctFLOAT0.00–100Start of the rewritten span, % of the clip. Leave 0-100 to rewrite the whole thing.
t_end_pctFLOAT100.00–100
t_feather_pctFLOAT4.00–50Soft edge in time. Without it the seam shows.
x_pctFLOAT0.00–100Rectangle for the video track only.
y_pctFLOAT0.00–100
w_pctFLOAT100.00–100
h_pctFLOAT100.00–100
feather_pctFLOAT6.00–50

Outputs (1)

NameTypeDescription
samplesLATENT