VAE Encode and VAE Encode (for Inpainting) node sa ComfyUI
VAE Encode converts a pixel IMAGE into a LATENT for img2img; VAE Encode (for Inpainting) does the same while blanking the masked area so an inpainting model can repaint it.
Node pack: ComfyUI core
Kategorya: Latent
Hindi pa naisasalin ang pahinang ito, kaya ipinapakita ito sa Ingles.
Ano ang ginagawa ng VAE Encode and VAE Encode (for Inpainting)
To work from an existing picture, the picture has to enter latent space first. VAE Encode takes an IMAGE (from Load Image or an earlier decode) and the VAE and outputs a LATENT that KSampler can continue from with denoise below 1. That is the whole of img2img in ComfyUI.
VAE Encode (for Inpainting) adds a mask input and a grow_mask_by option: the masked pixels are greyed out before encoding and a noise mask is attached, so a dedicated inpainting checkpoint repaints only that region. For inpainting with a normal checkpoint, use VAE Encode followed by Set Latent Noise Mask instead, which keeps the original content under the mask as a starting point.
Mga input
Pangalan | Uri | Ano ito |
|---|---|---|
pixels | IMAGE | The image to encode. Sizes are cropped to multiples of 8. |
vae | VAE | The VAE of the model you will sample with. |
mask (inpaint variant) | MASK | White = area to repaint. |
grow_mask_by (inpaint variant) | INT | Pixels to expand the mask so edges blend; 6-24. |
Mga output
Pangalan | Uri | Ano ito |
|---|---|---|
LATENT | LATENT | The encoded image (with a noise mask in the inpaint variant) for KSampler latent_image. |
AD

Laktawan ang setup: mga ComfyUI workflow na naka-preinstall sa cloud
Pinapatakbo ng BitVector ang mga handang ComfyUI workflow sa sarili nitong mga GPU. Walang install, walang nawawalang node, walang pulang kahon. Buksan ito sa iyong telepono o laptop at gumawa sa loob ng isang minuto.
Paano gamitin ang VAE Encode and VAE Encode (for Inpainting)
- Load Image, then VAE Encode with the checkpoint VAE.
- Connect LATENT to KSampler; set denoise 0.4-0.7 for a variation, 0.2-0.35 for a touch-up.
- For inpainting: open the mask editor on Load Image, paint the area, use VAE Encode (for Inpainting) with an inpainting checkpoint, denoise 1.0.
Mga setting at tip
- Resize the input to the model native size before encoding; a 4000 pixel photo encodes to a huge latent.
- denoise 1.0 on VAE Encode (for Inpainting) is correct: the masked region is meant to be fully regenerated.
- With normal checkpoints prefer VAE Encode + Set Latent Noise Mask and denoise 0.5-0.8 for context-aware fills.
- Image dimensions not divisible by 8 are cropped by a few pixels; pad or resize to avoid shifting.
Pag-aayos ng VAE Encode and VAE Encode (for Inpainting)
The inpainted region ignores the surroundings and looks pasted in
Bakit ito nangyayari
VAE Encode (for Inpainting) was used with a non-inpainting checkpoint, which cannot see the greyed-out area.
Paano ayusin
Use an inpainting checkpoint (or a Fooocus/Flux Fill inpaint model), or switch to VAE Encode + Set Latent Noise Mask with denoise under 0.8.
Hard edges around the repainted area
Bakit ito nangyayari
grow_mask_by is 0 or the mask has no feathering.
Paano ayusin
Set grow_mask_by to 12-24, or blur the mask with a Grow Mask / Feather Mask node before encoding.
Nothing changes in img2img
Bakit ito nangyayari
denoise is very low, or the sampler latent input is still the Empty Latent Image.
Paano ayusin
Wire the encoded LATENT into KSampler and raise denoise to 0.5 to confirm the pipeline.
Error: expected 4 channels but got 16 (or reverse) when encoding
Bakit ito nangyayari
The VAE is from a different family than the model that will sample the latent.
Paano ayusin
Encode with the same VAE the model decodes with.
AD

Patakbuhin ang workflow na ito mula sa iyong telepono
Bawat workflow sa pahinang ito ay naka-preinstall sa BitVector kasama ang mga model at custom node. Pumili ng isa, mag-type ng prompt, tapos. Zero setup, walang ida-download.
Mga tanong tungkol sa VAE Encode and VAE Encode (for Inpainting)
What denoise should I use for img2img?
0.3 keeps most of the picture, 0.5 is a balanced remix, 0.75 and above keeps little more than composition and colours.
Can I inpaint without an inpainting model?
Yes: VAE Encode, then Set Latent Noise Mask with your mask, then KSampler at denoise 0.5-0.8.
Mga kaugnay na node
VAE Decode
ComfyUI core
VAE Decode converts the sampled LATENT into a pixel IMAGE with the VAE; VAE Decode (Tiled) does the same in tiles for very large images.
Load Image
ComfyUI core
Load Image reads a picture from the ComfyUI input folder (or an upload) and outputs an IMAGE tensor plus a MASK taken from the alpha channel, the starting point for img2img, inpainting, ControlNet and IP-Adapter graphs.
Set Latent Noise Mask
ComfyUI core
Set Latent Noise Mask attaches a MASK to a LATENT so the sampler only changes the white area: inpainting and regional regeneration with any normal checkpoint.
KSampler
ComfyUI core
KSampler runs the denoising loop: it takes the model, prompts and a latent and produces the finished latent image, controlled by seed, steps, cfg, sampler, scheduler and denoise.
Load VAE
ComfyUI core
Load VAE (VAELoader) loads a standalone VAE file from models/vae so a checkpoint with a missing or weak VAE decodes clean colours, and so split models like Flux and Wan get their decoder.
AD

Pagod na sa pag-aayos ng mga node? Hayaan ang cloud
Pinapanatili ng BitVector ang daan-daang ComfyUI workflow na naka-install, na-update at nasubok sa mabibilis na cloud GPU. Walang Python, walang CUDA error, walang limitasyon sa VRAM. Gumagana mula sa anumang browser.
Higit pang ComfyUI node
CLIP Text Encode (Prompt)
ComfyUI core
CLIP Text Encode turns a text prompt into CONDITIONING using the model text encoder. One node holds the positive prompt, a second one the negative prompt.
ComfyUI Manager
ComfyUI-Manager
ComfyUI Manager is the extension that installs, updates and fixes custom node packs and models from inside the interface, resolves missing nodes in imported workflows and snapshots your setup.
Load Checkpoint
ComfyUI core
Load Checkpoint (CheckpointLoaderSimple) opens a .safetensors or .ckpt model file and hands out the three parts every workflow needs: the diffusion MODEL, the CLIP text encoder and the VAE.
Save Image
ComfyUI core
Save Image writes the IMAGE tensor to ComfyUI/output as a PNG, with the whole workflow embedded in the file metadata so the picture can be dragged back into ComfyUI to restore the graph.
Empty Latent Image
ComfyUI core
Empty Latent Image creates the blank latent canvas (width, height, batch_size) that text-to-image sampling starts from; dimensions must be multiples of 8 and match the model family.
Load LoRA
ComfyUI core
Load LoRA (LoraLoader) applies a LoRA file to the MODEL and CLIP with separate strengths, so a style, character or concept can be added to any checkpoint without merging.

Model
Trends
.ai
© ModelTrends.ai
|
Gawa sa Japan
|
© 2026