Icy VAEEncodeForInpaint
Icy VAEEncodeForInpaint, decoded
- pixels
- vae
- mask
- LATENT
Icy VAEEncodeForInpaint is the starting node for classic mask-based inpainting, and - like every "Icy" node - it's not a new invention. The IcyHider pack wraps ComfyUI's entire core node library at startup, so this is VAEEncodeForInpaint with a prefix and a category (IcyHider Comfy Core). Same internals, same output, just re-registered by a pack whose real job is hiding image previews.
So what makes it different from plain VAEEncode? The mask. This is the node that turns "regenerate this region" into something the sampler actually respects. Where plain encode just produces a latent, this one encodes your pixels and tucks the mask away as a noise_mask inside the latent object. When that latent hits a KSampler, the sampler only denoises the masked region and leaves everything outside it alone - that's the whole trick behind mask-based inpainting, and it's still the thing masked workflows uniquely own. The KB's inpainting essay makes the case: an edit model regenerates the whole frame, but masked inpainting keeps unmasked pixels bit-identical, which is why people still prefer it for face fixes, object removal, and anything where the rest of the image has to stay put.
Inputs that matter:
pixels- the IMAGE you're inpainting into.vae- the matching VAE for that image (same architecture, or you'll get color-shifted garbage).mask- a MASK, from any mask source: a brush-painted mask, a segmentor like BiRefNet or Segment Anything, a lamapreprocessor, whatever. White = region to regenerate.grow_mask_by(default 6) - how many pixels the mask is expanded before encoding. This gives the sampler context around the edit so the seam softens instead of carving a hard outline.
Output: LATENT → KSampler. From there, the denoise setting is your second lever: high (0.8–1.0) fully regenerates the masked area, lower values just nudge the existing pixels. Too high and you lose the original texture in the mask; too low and the fix doesn't take. Typical value lands around 0.8 for "fix this" work.
Installing this pack is the only thing you need to do to get the node, and it's dependency-free:
cd ComfyUI/custom_nodes
git clone https://github.com/icekiub-ai/ComfyUI-IcyHider.git
or ComfyUI Manager → search "IcyHider" → Install. Restart, hard-refresh the tab (it's a JS extension), done.
Gotchas, grounded in the real failure modes of this family: a missing mask connection errors the node immediately - the mask isn't optional. A grow_mask_by of 0 gives you hard seams unless your mask is already feathered; the KB's inpainting doc flags 4–12px of blur as the typical seam-fix range, and grow_mask_by is doing that job for you. And if the inpainted region comes back grey or washed out, that's a VAE mismatch, not a mask problem. One more IcyHider-specific trap: Avalanche mode defaults to ON, so after install your whole canvas hides until you click nodes - disable it under Settings → IcyHider if you don't want the peek-a-boo workflow. If you'd rather skip the pack entirely, swap in core VAEEncodeForInpaint - identical behavior, just no snowflake.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| pixels | IMAGE | — | |
| vae | VAE | — | |
| mask | MASK | — | |
| grow_mask_by | INT | 60–64 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |