Skip to content

Latent Operations ​

Encode and decode images in latent space.

VAEEncode ​

Converts image to latent representation.

Inputs ​

InputTypeDescription
pixelsimageImage to encode
vaevaeVAE model

Outputs ​

OutputTypeDescription
LATENTlatentEncoded latent

Usage ​

LoadImage → VAEEncode → KSampler
              ↑
         VAE (from checkpoint)

VAEDecode ​

Converts latent to visible image.

Inputs ​

InputTypeDescription
sampleslatentLatent to decode
vaevaeVAE model

Outputs ​

OutputTypeDescription
IMAGEimageDecoded image

Usage ​

KSampler → VAEDecode → SaveImage
              ↑
         VAE (from checkpoint)

EmptyLatentImage ​

Creates initial noise for generation.

Inputs ​

InputTypeDescription
(none)--

Parameters ​

ParameterTypeDescription
widthintImage width
heightintImage height
batch_sizeintNumber to generate

Outputs ​

OutputTypeDescription
LATENTlatentEmpty latent noise

Common Sizes ​

SizeUse Case
512x512Standard
768x768Higher quality
1024x1024SDXL native

LatentUpscale ​

Upscale latent image before decoding.

Inputs ​

InputTypeDescription
sampleslatentLatent to upscale
methoddropdownUpscale method

Parameters ​

MethodDescription
nearestFast, lower quality
bilinearMedium
lanczosGood quality
areaBest quality

Inpainting Nodes ​

VAEEncode (Inpainting) ​

Uses mask to encode only unmasked areas.

Mask Handling ​

LoadImage (RGBA) → VAEEncode
                       ↓
                  Mask preserved for KSampler

Tips ​

  1. Match resolution: Ensure latent size matches desired output
  2. Batch generation: Use batch_size for multiple images
  3. Inpainting: Use masked encoding for area editing

Next Steps ​