MiniMax H3 Masking · Grid Preview
Your H3 inpaint mask is lying to you — snap it to the real grid
- image
- mask
- snapped_mask
- grid_preview
- grid_info
MiniMax H3 doesn't denoise at your mask's resolution. Its video VAE downsamples the canvas into 32×32 source-pixel cells, and the mask you carefully painted freehand gets reduced through that latent stack - which doesn't always mean the pixels you intended get regenerated. This node is the one that shows you exactly what H3 will actually treat as "generate" and lets you snap your mask to it. If you've ever had an H3 inpaint silently regenerate a strip you painted as preserved (or the reverse), this is why, and this is the fix.
What it does
MiniMaxH3ContexMaskGridPreview takes your exact H3 canvas (the resized image whose width and height are divisible by 32) and your mask, then snaps the mask to H3's effective causal 32×32 cell grid. The snapped_mask output is what you feed into Apply Target Mask so the "regenerate here" region you see on screen is the region that actually regenerates.
You get three knobs that matter:
- cell_selection -
runtime exact (latent max)matches H3's actual latent reduction. The coverage modes (any pixel,50%,full) are deliberate conservative/strict alternatives for when you want to be sure a cell regenerates only if it's really inside your paint. - cell_adjust - grows or shrinks the region by whole 32×32 cells, from −8 to +8. Handy when H3's latent math eats the thin edges of your stroke.
- mask_meaning -
white = generateorwhite = preserve. Use the same convention here as on Apply Target Mask, or you'll chase ghosts.
The rest is inspection: preview_frame picks which frame the overlay shows (the snapped MASK output still carries the whole batch), overlay_opacity controls the orange overlay, and show_grid / show_source_outline draw the cell grid and the outline of your original unsnapped mask so you can see the difference. grid_info is a text summary of frame, grid dimensions, and coverage.
Where it fits
This is a prep node for the pack's masked-editing path. In a Masked Video Inpaint workflow you'll see the chain Loop Mask Slice → this grid preview → Apply Target Mask → sample. Paint your mask, wire the canvas in, check the overlay, adjust with cell_adjust if the snap ate anything, and hand the snapped mask downstream. It's purely a transformation plus a preview - nothing here touches the latent itself, so you can preview and iterate without burning a sample.
Install and gotchas
Same as the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ethanfel/ComfyUI-MiniMaxH3-Contex-Loop.git
Restart ComfyUI. You can also use ComfyUI Manager and search "MiniMax H3 Contex Loop". There's no pip step - the pack rides on ComfyUI's own environment, but it needs a current ComfyUI build with the native "Add Guide for MiniMax H3" support (ComfyUI PR #15439), and ffmpeg on PATH is preferred. Models aren't bundled: you bring the MiniMax H3 weights yourself, which means checking the MiniMax H3 Community License - it excludes the US, EU, UK and South Korea from the local-weights path.
The one trap: the image input must be the exact resized H3 canvas, not your original source file. Feed it whatever resolution the video VAE is actually working at, and make sure both dimensions are divisible by 32 - the node will tell you if you're off.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Exact resized H3 canvas used by the video VAE. Width and height must be divisible by 32. | |
| mask | MASK | Static or tracked ComfyUI mask interpreted using mask_meaning. | |
| cell_selection | COMBO | runtime exact (latent max) | Runtime exact matches H3 latent reduction. Coverage modes provide deliberate conservative or strict alternatives. |
| cell_adjust | INT | 0-8–8 | Grow or shrink by complete 32x32 H3 cells. |
| preview_frame | INT | 00–10000 | Frame displayed by grid_preview. The snapped MASK output still contains the complete batch. |
| overlay_opacity | FLOAT | 0.380–1 | Opacity of the orange snapped-generation overlay in grid_preview. |
| show_grid | BOOLEAN | true | Draw the effective 32x32 H3 source-pixel cell grid over the preview. |
| show_source_outline | BOOLEAN | true | Outline the original unsnapped mask so its difference from the effective mask is visible. |
| mask_meaningopt | COMBO | white = generate | Use the same white-pixel convention here and on Apply Target Mask. The overlay always shows the effective generation region. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| snapped_mask | MASK | Complete mask batch snapped to H3's effective causal 32x32 source-pixel cells, using the selected white-pixel convention. |
| grid_preview | IMAGE | Selected source frame with the snapped mask and optional grid or source outline overlaid. |
| grid_info | STRING | Summary of the selected frame, grid dimensions, and snapped-mask coverage. |