Extensions/ComfyUI-MiniMaxH3-Inpaint
ComfyUI Extension

ComfyUI-MiniMaxH3-Inpaint

A ComfyUI node that seeds MiniMax H3's audio-video NestedTensor latent from a plate video plus a mask, so the sampler inpaints only the masked region (object/character insertion & swap) while preserving the rest of the plate.

By nuvulabs·Created 2 months ago·Updated 2 months ago· 2
nuvulabs/ComfyUI-MiniMaxH3-Inpaint
Nodes1
On cloudLocal install
Categorymodel/latent/minimax
Stars2
Updated2 months ago
Readme

ComfyUI-MiniMaxH3-Inpaint

A single ComfyUI node — MiniMax H3 Inpaint Latent (plate + mask) — that unlocks masked inpainting, object/character insertion and swaps for the MiniMax H3 audio-video model.

Why it exists

H3's sampler consumes an audio-video NestedTensor latent (video [B,24,T,H/16,W/16] plus an audio stream), and the stock MiniMaxH3ReferenceToVideo node only ever emits an empty canvas — so there is no way to seed a real plate for inpainting. This node:

  1. VAE-encodes a plate video into H3's video latent,
  2. packs it with an empty audio stream into a comfy.nested_tensor.NestedTensor, and
  3. attaches a latent-space noise mask so the sampler regenerates only the masked region while preserving the plate everywhere else.

ComfyUI's sampler already supports masked inpainting on nested latents; this node just builds the seeded latent + mask it needs.

Usage

  • vae — the H3 video VAE (minimax_h3_video_vae).
  • plate — the background/plate video frames (e.g. LoadVideo → GetVideoComponents).
  • mask — white = regenerate/insert, black = keep the plate. Accepts a single mask or a per-frame mask batch (e.g. from SAM3_Detect), which is sampled to the latent's temporal length.
  • width / height / length — must match your MiniMaxH3ReferenceToVideo node (length snaps to the 17k+5 frame grid).

Wire the node's LATENT output into SamplerCustomAdvanced's latent_image, and keep MiniMaxH3ReferenceToVideo for the conditioning (reference image(s) + prompt). The masked region regenerates as the reference subject; the rest of the plate is preserved.

Pairs well with SAM 3.1 (SAM3_Detect, native in ComfyUI) to mask a subject by text prompt for a fully automatic character swap.

Installation

Clone into ComfyUI/custom_nodes/ and restart ComfyUI:

git clone https://github.com/nuvulabs/ComfyUI-MiniMaxH3-Inpaint.git

No extra Python dependencies — it uses only ComfyUI's bundled libraries.

License

MIT — see LICENSE.