🎨 How AI Generates Images
From pure noise to a finished picture, one denoising step at a time.
What you’ll learn
- Understand how a text prompt is encoded and how diffusion models represent and learn images.Prompts become CLIP embeddings; models work in compressed latent space and are trained to reverse noise using a U-Net engine.
- Trace the step-by-step generation that turns noise into a finished, prompt-faithful image.Repeated denoising steps, classifier-free guidance, and VAE decoding combine with a random seed to synthesize unique images.
Questions this course answers
What does a text encoder like CLIP produce from your prompt?
CLIP turns each token into a high-dimensional vector (768 numbers in SD 1.x) that encodes meaning, giving the generator a mathematical description to follow.
Why do modern models generate images in 'latent space'?
A VAE compresses images roughly eightfold per side into a small latent grid, so the model can do its work efficiently before decoding back to full resolution.
What core task are diffusion models trained to perform?
Models learn by reversing a process that adds noise to real images; mastering noise removal lets them turn pure static into coherent new images.
Why is the U-Net run roughly fifty times for one image?
Each iteration strips away a slice of noise; early steps set composition and later steps add detail, gradually revealing the final image.
What does classifier-free guidance do?
It makes a prompted and an unprompted prediction each step and pushes harder toward the prompt, with guidance scale controlling how tightly the image follows your words.
Why does the same prompt produce different images each time?
Generation begins from random noise; a different seed yields a different result, while fixing the seed reproduces the same image exactly.
Grounded in trusted sources
- Hugging Face, 'Stable Diffusion with Diffusers' (huggingface.co/blog/stable_diffusion)
- Stable Diffusion, Wikipedia (en.wikipedia.org/wiki/Stable_Diffusion)
- Stable Diffusion Art, 'How does Stable Diffusion work?' (stable-diffusion-art.com/how-stable-diffusion-work)
- NICD, 'Text-to-image: latent diffusion models' (nicd.org.uk/knowledge-hub/image-to-text-latent-diffusion-models)
- Rombauts, K., 'An Introduction to Quantum Computing' series on diffusion and CLIP (mkdyasserh.github.io/blog/2025/stable-diffusion)
Every Wunder lesson is built from real, reputable sources — never invented.
Related Science courses
Wunder is a personalized learn-anything platform — tell it any topic and it builds a beautiful, fact-checked course in minutes, with narration, a knowledge check, and a college-style University track.
Browse more Science courses · All topics · Home
© 2026 Wunder Learning LLC · Terms & Privacy