← Back to Multimodal Mind Map
⚡Flashcard Drill➔
👁️ MultimodalID: latent-diffusion

Latent Diffusion (LDM)

潜空间扩散 (LDM)
🎯Core Definition
Latent Diffusion Models (LDM) run the DDPM process in a VAE latent space instead of pixel space, then decode back. An image x∈RH×W×3x \in \mathbb{R}^{H \times W \times 3} is compressed by the VAE encoder into z∈Rh×w×cz \in \mathbb{R}^{h \times w \times c}; Stable Diffusion uses 8×8\times spatial downsampling: a 512×512512\times 512 image becomes a 64×64×464\times 64\times 4 latent (c=4c=4). Denoising happens entirely on zz:
📌Overview
zt=αˉt z0+1−αˉt ϵ,L=E[∥ϵ−ϵθ(zt,t,c)∥2]z_t = \sqrt{\bar\alpha_t}\,z_0 + \sqrt{1-\bar\alpha_t}\,\epsilon,\qquad \mathcal{L} = \mathbb{E}\left[\Vert \epsilon - \epsilon_\theta(z_t, t, c)\Vert^2\right]
📌Overview
The condition cc (e.g. CLIP text embeddings) is injected into the U-Net/DiT middle layers via cross-attention; after sampling, z0z_0 is mapped back by VAEdec\mathrm{VAE}_{dec}. The full training loss combines three terms: latent diffusion reconstruction + perceptual loss (LPIPS) + adversarial/GAN loss, with mild KL regularization, balancing pixel fidelity and perceptual quality. Architecture evolution: SD1/2 use U-Net (self-attention + cross-attention + timestep embedding); SD3/Flux use MMDiT (a mixed text-image DiT with patchify and AdaLN-zero for timestep/text conditioning).
💡Use Cases
the backbone of the Stable Diffusion family and most text-to-image/text-to-video models; interview favorites — “why diffuse in latent space instead of pixel space?” and “how much compute does 8× downsampling save?”.
⚡Key Problems Solved
pixel-space diffusion is computationally intractable above 256×256256\times256 — attention and feature maps grow quadratically with resolution; the 8×8\times spatial reduction cuts feature-map area to 1/641/64, lowering training/sampling compute by roughly two orders of magnitude, while the decoder restores visual detail, the encoder absorbs semantic compression, and conditions (text, ControlNet) plug into the latent space uniformly.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Latent Diffusion (LDM).
Use Cases
In production engineering, what are the primary use cases for Latent Diffusion (LDM) and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Why does Stable Diffusion diffuse in VAE latent space instead of pixel space; how much compute does 8× downsampling save?
2
Which terms make up the LDM training loss, and why add perceptual and adversarial losses?
3
How is text conditioning injected into the latent diffusion network; where does cross-attention sit in U-Net/DiT?
4
Key structural differences between SD1/2 U-Net and SD3/Flux MMDiT?
5
Tradeoffs of latent vs pixel-space diffusion in training speed, memory and image quality?
📖 In-depth Guide:📄 diffusion-models →
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Latent Diffusion (LDM)"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
← Previous CardClassifier-Free GuidanceNext Card →Sampler Acceleration (DDIM/DPM-Solver/LCM)

🔗 More Multimodal Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/Multimodal/card/latent-diffusion