π Inpaint Conditioning
The classic masked-inpaint setup, as one node
- positive
- negative
- vae
- pixels
- mask
- positive
- negative
- latent
Every ComfyUI inpainting workflow hides the same plumbing: blank out the masked pixels, VAE-encode them, stuff a concat latent and a mask into the conditioning, and hand the sampler a latent with a noise mask so it only touches the region you care about. You can assemble that from five stock nodes - or you can use this one, which is that assembly in a box. If you want the masked pixels left untouched and only the mask regenerated, this is the honest, predictable path.
The pack also ships a Kontext-flavored variant (InpaintFluxKontextConditioning) that adds a reference-image channel. This node is the plain version: no reference latents, no Kontext assumptions - which makes it the right one for Flux Fill-style inpainting and most GGUF inpaint setups where you just want masked regeneration to work.
How it works
The mechanism is the standard masked-inpaint conditioning:
- It blanks the masked region of the input image - pixels under the mask get flattened toward neutral (it subtracts 0.5, multiplies by the inverted mask, adds 0.5 back, per channel).
- That masked image is VAE-encoded and attached to both positive and negative conditioning as
concat_latent_image, with the mask alongside asconcat_mask. The model reads these as "here's the fixed context, here's where to regenerate." - It also VAE-encodes the original image and returns it as the latent, with a
noise_maskattached whennoise_maskis on - so denoising happens only inside the mask.
Resolution is rounded down to a multiple of 8 before encoding, which keeps latent-size errors away. Outputs are positive, negative, and latent.
The one input that matters
noise_mask (default on). The author's own tooltip is worth quoting in full: "Add a noise mask to the latent so sampling will only happen within the mask. Might improve results or completely break things depending on the model." That's the whole history of mask-based inpainting in one sentence. Some models love a hard noise mask; others (a few Flux and SDXL fine-tunes) fight it and you get seams or whole-image bleeding. When the result looks wrong, flipping this off is the first thing to try.
Everything else is straightforward: positive/negative conditioning, vae (the model's own), pixels (the image), mask (white = regenerate here).
Install
ComfyUI Manager (search "YarvixPA") or
cd ComfyUI/custom_nodes
git clone https://github.com/YarvixPA/ComfyUI-YarvixPA
restart. It lives under ComfyUI-YarvixPA/Conditioning/Inpaint. No extra models to fetch.
Where it fits
Classic mask-based inpainting still earns its keep when you need the unmasked pixels bit-identical - an edit model rewrites everything, this does not. Use it with a proper inpaint-compatible checkpoint (Flux Fill is the modern default; SDXL fine-tunes if that's your stack). Pair it with the denoise dial: 0.3β0.6 for subtle fixes, higher for full region regeneration. And if a Kontext/Fill-style model isn't holding scene context, that's the signal to reach for the pack's Kontext variant instead of this one.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | β | |
| negative | CONDITIONING | β | |
| vae | VAE | β | |
| pixels | IMAGE | β | |
| mask | MASK | β | |
| noise_mask | BOOLEAN | true | Add a noise mask to the latent so sampling will only happen within the mask. Might improve results or completely break things depending on the model. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | β |
| negative | CONDITIONING | β |
| latent | LATENT | β |