Model
Trends
.ai
Model
Trends
.ai
최고의 오픈 소스 AI 모델

ComfyUI의 VAE Encode and VAE Encode (for Inpainting) 노드

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.
노드 팩: ComfyUI core
카테고리: 잠재 공간
이 페이지는 아직 번역되지 않아 영어로 표시됩니다.

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.

입력

이름
타입
의미
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.

출력

이름
타입
의미
LATENT
LATENT
The encoded image (with a noise mask in the inpaint variant) for KSampler latent_image.
AD
설치는 건너뛰세요: 클라우드에 미리 설치된 ComfyUI 워크플로
BitVector는 완성된 ComfyUI 워크플로를 자체 GPU에서 실행합니다. 설치 없음, 누락 노드 없음, 빨간 박스 없음. 휴대폰이나 노트북에서 열고 1분 안에 생성하세요.

VAE Encode and VAE Encode (for Inpainting) 사용법

  1. Load Image, then VAE Encode with the checkpoint VAE.
  2. Connect LATENT to KSampler; set denoise 0.4-0.7 for a variation, 0.2-0.35 for a touch-up.
  3. For inpainting: open the mask editor on Load Image, paint the area, use VAE Encode (for Inpainting) with an inpainting checkpoint, denoise 1.0.

설정과 팁

  • 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.

VAE Encode and VAE Encode (for Inpainting) 문제 해결

The inpainted region ignores the surroundings and looks pasted in

원인
VAE Encode (for Inpainting) was used with a non-inpainting checkpoint, which cannot see the greyed-out area.

해결 방법
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

원인
grow_mask_by is 0 or the mask has no feathering.

해결 방법
Set grow_mask_by to 12-24, or blur the mask with a Grow Mask / Feather Mask node before encoding.

Nothing changes in img2img

원인
denoise is very low, or the sampler latent input is still the Empty Latent Image.

해결 방법
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

원인
The VAE is from a different family than the model that will sample the latent.

해결 방법
Encode with the same VAE the model decodes with.

AD
이 워크플로를 휴대폰에서 실행하세요
이 페이지의 모든 워크플로는 모델과 커스텀 노드까지 갖춘 채 BitVector에 미리 설치되어 있습니다. 하나 고르고 프롬프트를 입력하면 끝. 설정 제로, 다운로드 없음.

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.

관련 노드

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
노드 고치기에 지치셨나요? 클라우드에 맡기세요
BitVector는 수백 개의 ComfyUI 워크플로를 빠른 클라우드 GPU에 설치하고 업데이트하고 테스트해 둡니다. Python도, CUDA 오류도, VRAM 한계도 없습니다. 어떤 브라우저에서든 됩니다.

더 많은 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.