KSampler Masked Inpaint ποΈ
Image + Mask In, Fixed Latent Out
- model
- vae
- image
- mask
- positive
- negative
- latent
- summary
The standard ComfyUI inpainting setup is a two-node dance: VAE Encode (for Inpainting) to build a masked latent, then a KSampler to actually sample it. KSampler Masked Inpaint collapses both into one node. You feed it an image, a mask, a model, a VAE, and your positive/negative conditioning - and it encodes and samples in a single call, handing you back the latent. Fewer nodes, fewer wires, one less place to get the mask-growing wrong. It's the pack's "just inpaint it" node, and it's built on the same core math ComfyUI ships, not a reimplementation.
How it works
Inside, it calls ComfyUI's own VAEEncodeForInpaint - which handles the mask-grow and the masked-region normalization correctly rather than this pack re-implementing that fiddly math - then runs a standard KSampler on the result. Two inputs worth understanding:
- grow_mask_by (default 6) - expands the mask by that many pixels before encoding. Same parameter VAE Encode (for Inpainting) exposes, kept here so you don't need a separate node for it. A small grow (4β8px) avoids a visible seam at the mask edge - too small and you get a hard cut, too big and the change bleeds past where you wanted it.
- denoise - the inpainting dial. 1.0 replaces the masked region entirely according to your prompt; lower values (0.3β0.6) preserve more of the original masked content, which is what you want for subtle fixes like adjusting an expression or fixing a color. The classic beginner mistake is cranking denoise to 1.0 for a small fix and watching the whole masked area get regenerated.
The rest are the familiar sampler controls - seed, steps, cfg, sampler_name, scheduler - plus the model, VAE, image, mask, and conditioning inputs. Output is the sampled latent plus a summary text.
Where it fits
Masked inpainting's honest place in 2026: instruction-editing models (Flux Kontext, Qwen-Image-Edit) took over most of the "change this thing" jobs, but the mask still uniquely owns five things - bit-identical unmasked pixels, full-resolution detail on small regions, the denoise continuum, exact placement, and the uncensored stack. If you're fixing a face, removing an object, or compositing one image into another with exact boundaries, masked inpainting is still the tool, and this node is the shortest path to it in ComfyUI. The "only masked" strategy - crop tight around the fix, inpaint at full resolution, paste back - pairs with this node well.
Install and troubleshooting
No extra dependencies - it delegates to ComfyUI's own sampler classes:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart, find it under TensorVizion/Sampling (ComfyUI Manager, search "OmniNodes", also works).
Troubleshooting
- Hard seam at the mask edge - raise
grow_mask_bya bit and/or feather your mask upstream. - The fix regenerates the whole masked area when you only wanted a tweak - lower
denoise. 0.3β0.6 for adjustments, higher only for full replacement. - Color shift in the inpainted region - a classic with VAE encode/decode cycles; make sure the VAE you're feeding matches the checkpoint, and consider lowering denoise so the region leans on the original pixels.
If you're tired of the two-node inpainting ritual, this is the upgrade. One node, correct mask-growing, fewer places to make a mistake - and the results land wherever you already sample.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | β | |
| vae | VAE | β | |
| image | IMAGE | β | |
| mask | MASK | β | |
| positive | CONDITIONING | β | |
| negative | CONDITIONING | β | |
| seed | INT | 00β18446744073709550000 | β |
| steps | INT | 201β10000 | β |
| cfg | FLOAT | 7.00β100 | β |
| sampler_name | STRING | dpmpp_2m | β |
| scheduler | STRING | karras | β |
| denoise | FLOAT | 1.000β1 | β |
| grow_mask_by | INT | 60β64 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | β |
| summary | STRING | β |