What Is Latent Space in AI Image Generation?
Modern image generators are latent diffusion models: they denoise a compressed representation instead of raw pixels. That compressed space is latent space.
How compressed
For SD 1.5 and SDXL, the VAE downsamples images by 8x in each dimension into 4 channels: a 1024 x 1024 image becomes a 128 x 128 x 4 latent. Newer models such as FLUX-family models use latents with more channels (16) for finer detail.
Why it matters
- Speed and memory: working on latents is far cheaper than on pixels.
- Dimensions: image sizes must divide evenly by the downsampling factor, which is why resolutions are multiples of 8 (and often 64).
- Compatibility: latents from one model family cannot be decoded by another family’s VAE.
Latent operations
- Latent upscaling in hires fix enlarges latents before re-sampling.
- Latent blending and noise injection are used in advanced workflows.
- Empty latent image nodes in ComfyUI set the canvas size.
See hires fix and the SDXL and FLUX resolution calculator.
Related
More terms: ControlNet · Denoising strength · FP8 · IP-Adapter · Sampler · Scheduler · Full glossary