▶ VAE Encode (Illustrious)
The node that turns on inpainting and regional prompting
- pixels
- vae
- mask
- reference_image
- latent
- encode_info
A plain VAE Encode does one thing: turn pixels into a latent so you can img2img them. This one does that plus the two things people actually build around it in an Illustrious workflow - inpainting and regional prompting - by way of a mode switch instead of three separate nodes.
What it's for
If you've read the pack's own docs, you'll know it draws a hard line between two techniques people constantly mix up: inpainting fixes a masked patch of an existing image, regional prompting puts different prompts in different areas of a fresh generation. This node is where inpainting starts. Set mode to inpaint, feed it a mask, and everything downstream (the sampler) only touches the masked area. Set it to regional and it just forwards your mask for the real work to happen in IllustriousRegionalConditioning - the encode itself doesn't need anything special for that path, which is worth knowing because it's easy to assume "regional" mode does more than it does.
How it works
Standard mode is a normal VAE encode with some Illustrious-flavored preprocessing bolted on: prepare_for_illustrious and enhance_for_anime are light tweaks applied before the encode, both on by default. Inpaint mode adds a mask (white = the area that changes) and an optional reference_image to pre-fill the masked region before sampling starts, instead of leaving it as noise - handy when you want the fix to lean on existing content rather than invent from scratch. mask_blur and mask_dilate feather and grow the mask before it's used: dilate first to cover a little more than you painted, then blur to soften the edge, which is the standard fix for the hard-seam look that untreated masks produce.
Large images get tiled through the VAE (enable_tiling, tile_size, overlap) so you don't blow your VRAM budget encoding a big canvas in one shot - optimization_mode picks a tiling strategy (quality/speed/memory) for you if you don't want to hand-tune tile size yourself.
The inputs and outputs that matter
pixelsandvae- required, exactly what you'd expect.mode-standard/inpaint/regional. This is the one setting that changes what the rest of your graph needs to look like.maskandreference_image- only matter in inpaint mode.mask_blur/mask_dilate- feathering, default 4px blur and 2px dilate. Raise blur if you're seeing a visible ring around the fixed area.
Output is latent (feed your sampler) plus encode_info, a diagnostic string - useful if something's not encoding the way you expect, not something you normally wire anywhere.
Installing it
Through ComfyUI Manager: search "EasyIllustrious," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/regiellis/ComfyUI-EasyIllustrious
pip install -r ComfyUI-EasyIllustrious/requirements.txt
Then restart ComfyUI. No model downloads - this node works with whatever VAE your checkpoint already carries.
Common issues
Leave VAE on standard unless you're actually inpainting. The pack's own docs are explicit about this: regional prompting doesn't need regional mode here at all - that mode exists to forward mask data for a different node's benefit, and using it when you don't need to just adds a variable to debug.
Visible seam around an inpainted patch. Raise mask_blur before you touch anything else - this is the single most common inpainting complaint and it's almost always an under-feathered mask, not a model problem. If the fix still looks tonally off from its surroundings, that's what reference_image is for: pre-fill from something closer to the target look instead of pure noise.
VRAM errors on big images. Make sure enable_tiling is on (it is by default) and drop tile_size before you drop your resolution.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| pixels | IMAGE | Images to encode into latents. | |
| vae | VAE | Variational Autoencoder used to encode images. | |
| modeopt | COMBO | standard | Encoding mode. Inpaint uses a mask and optional reference image; Regional forwards mask for downstream guidance. |
| illustrious_versionopt | COMBO | auto | Auto-detect from image size; choose specific to nudge prep. |
| optimization_modeopt | COMBO | auto | Adjusts tile size and memory strategy. |
| enable_tilingopt | BOOLEAN | true | Enable for large images to avoid VRAM issues. |
| tile_sizeopt | INT | 512256–1024 | Encode tile size in image pixels. |
| overlapopt | INT | 6432–128 | Overlap between tiles to hide seams. |
| prepare_for_illustriousopt | BOOLEAN | true | Apply minor tweaks before encode for Illustrious. |
| enhance_for_animeopt | BOOLEAN | true | Light enhancement that suits anime/illustration. |
| maskopt | MASK | White = region to affect. Will be downscaled to latent size and used as noise mask. | |
| reference_imageopt | IMAGE | Optional reference image to fill masked area prior to sampling (inpaint mode). | |
| mask_bluropt | INT | 40–64 | Feather mask edges (pixels). |
| mask_dilateopt | INT | 20–64 | Grow mask (pixels) before blur. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| encode_info | STRING | — |