Nodul VAE Encode and VAE Encode (for Inpainting) în 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.
Pachet de noduri: ComfyUI core
Categorie: Latent
Această pagină nu a fost încă tradusă, așa că este afișată în engleză.
Ce face 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.
Intrări
Nume | Tip | Ce este |
|---|---|---|
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. |
Ieșiri
Nume | Tip | Ce este |
|---|---|---|
LATENT | LATENT | The encoded image (with a noise mask in the inpaint variant) for KSampler latent_image. |
AD

Sari peste configurare: fluxuri ComfyUI preinstalate în cloud
BitVector rulează fluxuri de lucru ComfyUI gata făcute pe propriile GPU-uri. Fără instalare, fără noduri lipsă, fără casete roșii. Deschide-l pe telefon sau laptop și generează într-un minut.
Cum folosești 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.
Setări și sfaturi
- 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.
Depanare VAE Encode and VAE Encode (for Inpainting)
The inpainted region ignores the surroundings and looks pasted in
De ce se întâmplă
VAE Encode (for Inpainting) was used with a non-inpainting checkpoint, which cannot see the greyed-out area.
Cum se repară
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
De ce se întâmplă
grow_mask_by is 0 or the mask has no feathering.
Cum se repară
Set grow_mask_by to 12-24, or blur the mask with a Grow Mask / Feather Mask node before encoding.
Nothing changes in img2img
De ce se întâmplă
denoise is very low, or the sampler latent input is still the Empty Latent Image.
Cum se repară
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
De ce se întâmplă
The VAE is from a different family than the model that will sample the latent.
Cum se repară
Encode with the same VAE the model decodes with.
AD

Rulează acest flux de lucru de pe telefon
Fiecare flux de lucru de pe această pagină este preinstalat pe BitVector cu modelele și nodurile personalizate deja la locul lor. Alege unul, tastează un prompt, gata. Zero configurare, nimic de descărcat.
Întrebări despre 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.
Noduri conexe
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

Sătul să repari noduri? Lasă cloud-ul să o facă
BitVector menține sute de fluxuri ComfyUI instalate, actualizate și testate pe GPU-uri cloud rapide. Fără Python, fără erori CUDA, fără limite de VRAM. Funcționează din orice browser.
Mai multe noduri ComfyUI
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
|
Realizat în Japonia
|
© 2026