Type “a lighthouse at sunset in the style of Van Gogh” and seconds later, an image appears — one that never existed before. Stable Diffusion conjures pictures from words, and the mechanism behind it is one of the most elegant ideas in modern AI: start with pure noise, then gradually remove it, guided by your text, until an image emerges.
It’s the reverse of what you’d expect. Instead of painting an image, the system sculpts one out of static — like Michelangelo freeing David from marble, except the marble is random noise and the chisel is a neural network. Let me explain how, without the heavy math. For the broader context, see my guide on what is Stable Diffusion.
In This Guide
- The Core Idea: Learning to Remove Noise
- Step 1: Your Text Becomes Guidance
- Step 2: Starting from Pure Noise
- Step 3: Denoising, Step by Step
- The Latent Space Trick (Why It’s Fast)
- Where the “Knowledge” Lives: Training
- Why It’s Called “Stable” Diffusion
- What the Model Can and Can’t Do
- Frequently Asked Questions

The Core Idea: Learning to Remove Noise
The genius insight behind diffusion models: it’s easier to learn to remove noise than to learn to create images directly.
Here’s the training setup. Take a real image. Gradually add noise to it — a little, then more, then more — until it’s pure static. Do this thousands of times across millions of images. Now train a neural network on the reverse task: given a noisy image (and knowing how noisy it is), predict the noise, so you can subtract it and get closer to the original.
After enough training, the network becomes extraordinarily good at one thing: looking at noise and seeing what image is hiding inside it. Run that process iteratively — start from pure noise, remove a little noise, repeat 20–50 times — and an image materializes from nothing.
It’s like training someone by showing them increasingly blurry photos and asking “what’s getting clearer?” — until they can look at pure static and hallucinate the photo it could become. Except the “hallucination” is guided by your text prompt.
Step 1: Your Text Becomes Guidance
Before any image exists, your prompt is processed:
- Tokenization. Your text is broken into tokens (the same concept as in language models — see what a large language model is).
- Text encoding. A text encoder (CLIP, in the original Stable Diffusion) converts those tokens into a numerical representation — an embedding that captures the prompt’s meaning as numbers the image model can use.
- Guidance signal. This embedding steers every denoising step. At each iteration, the model asks: “given this noise level and this text meaning, what should the slightly-less-noisy version look like?”
Why prompt wording matters so much: the text embedding is the only information about what you want. Vague prompts (“a nice picture”) give weak guidance; specific prompts (“a lighthouse at sunset, Van Gogh style, dramatic clouds, oil painting texture”) give strong, detailed guidance. Prompt engineering for image models is the art of giving the denoiser precise directions.
Negative prompts work the same way in reverse — “blurry, watermark, deformed hands” creates a guidance signal pushing away from those features. You’re sculpting by both adding and removing.
Step 2: Starting from Pure Noise
Image generation begins with a tensor of pure random noise — literally random numbers, no structure whatsoever. This is important: the model doesn’t start from a template or retrieve an existing image. Every generation starts from randomness, which is why the same prompt produces different images each time (unless you fix the random seed).
The noise lives not in pixel space but in latent space — a compressed representation (more on this below). Think of it as noise with the potential for image-ness, structured so the denoising network can work with it efficiently.
The seed: the random starting noise is determined by a seed number. Same seed + same prompt + same settings = same image, reproducibly. Different seed = different image. This is how artists “explore variations” — same prompt, new seeds, pick the best.
Step 3: Denoising, Step by Step
Now the magic loop — typically 20 to 50 iterations:
- The model looks at the current noisy latent and your text embedding
- It predicts the noise present in the image (what doesn’t belong)
- It subtracts a portion of that predicted noise (not all at once — gradual is key)
- Repeat — each step reveals slightly more structure
What you’d see if you watched: the first steps establish rough composition — blobs that will become the lighthouse, the horizon line, the sky region. Middle steps refine shapes and add detail. Final steps add texture, lighting, fine features. It’s coarse-to-fine, like an artist blocking in big shapes before details.
The scheduler controls how much noise to remove each step. Different schedulers (DDIM, Euler, DPM++) produce slightly different aesthetics and speeds — one of the many knobs enthusiasts tune.
Why gradual works: each small denoising step is an easy prediction problem (slightly less noise than now). Trying to go from noise to image in one leap would be impossibly hard. Fifty easy steps compose into one miraculous result — the same principle behind all iterative refinement.

The Latent Space Trick (Why It’s Fast)
Here’s why it’s called Latent Diffusion: the model doesn’t work with full-resolution pixels. Instead:
- An encoder compresses images into a smaller “latent” representation (typically 8x smaller in each dimension — 64x fewer values than the pixels)
- Diffusion happens in this compressed space — vastly less computation
- A decoder expands the final latent back into a full-resolution image
Why this matters: working in latent space makes Stable Diffusion fast enough to run on consumer GPUs — even laptops. Pixel-space diffusion (like some earlier models) required datacenter hardware. The latent trick is a big part of why Stable Diffusion democratized AI image generation instead of keeping it in corporate labs.
The trade-off: compression loses some fine detail, which the decoder must reconstruct. This is partly why AI images sometimes have slightly “off” fine details — the latent representation is an approximation, and approximations show at the margins.
Where the “Knowledge” Lives: Training
The denoising network learned everything from training data — billions of image-text pairs (the original used LAION datasets). During training, it saw images with captions, learned to denoise them, and absorbed:
- Visual concepts: what lighthouses, sunsets, Van Gogh brushstrokes look like
- Composition: how elements arrange in pleasing images
- Style: the difference between photorealistic, anime, oil painting, cyberpunk
- Text-image associations: which visual patterns correspond to which words
The controversies live here too: training on copyrighted images scraped from the web raised legal and ethical questions still being litigated. The model’s “knowledge” of Van Gogh’s style came from actual Van Gogh paintings (and countless imitations) in the training data. Whether that’s learning or copying is the defining legal question of generative AI art.
What it can’t know: anything not in training data. New visual concepts, very recent events, your specific face (unless fine-tuned on it) — the model can only denoise toward patterns it learned.
Why It’s Called “Stable” Diffusion
The name has a specific technical origin: it builds on the Latent Diffusion Model architecture from a 2022 paper by Robin Rombach and colleagues, and “Stable” comes from Stability AI, the company that funded and released it.
But there’s a poetic accuracy too: the diffusion process is stable — the gradual denoising converges reliably rather than diverging chaotically. Earlier generative approaches (like some GANs) were notoriously unstable in training. Diffusion’s step-by-step refinement is robust by design.
The release mattered as much as the tech: Stability AI released the model weights openly, letting anyone run, modify, and build on it. That openness — versus competitors’ closed APIs — is why Stable Diffusion became the foundation of an enormous ecosystem: custom models, fine-tunes, tools, and communities.
What the Model Can and Can’t Do
Remarkably good at: – Photorealistic scenes from detailed prompts – Artistic styles (given style keywords it learned) – Concept combination (“an astronaut riding a horse” — things never photographed together) – Variations and exploration (same prompt, different seeds)
Notoriously bad at: – Hands and fingers — the classic tell. Fine anatomical detail in latent space is hard; extra fingers and melted hands are the signature artifact (improving with newer versions) – Text in images — rendering legible text requires precision diffusion struggles with (much better in recent versions) – Exact replication — it generates, not retrieves; ask for a specific real photo and you’ll get a plausible imitation – Counting — “three apples” might yield two or four; precise quantities are weak – Complex spatial relations — “the red cube to the left of the blue sphere behind the…” degrades quickly
The pattern: the model excels at plausible imagery and struggles with precise imagery — the visual equivalent of language models’ fluency-vs-accuracy trade-off. Beautiful, convincing, and wrong in the details.
Stable Diffusion works by learning to remove noise — trained on millions of images progressively noised and denoised — then running that process in reverse from pure randomness, guided by your text, in a compressed latent space for efficiency. Noise in, image out, with your words as the sculptor’s intention. It’s one of those ideas that’s obvious in retrospect and revolutionary in practice.

Frequently Asked Questions
It starts with pure random noise and gradually removes it over 20-50 steps, guided by your text prompt. A neural network trained to reverse noise predicts what to remove at each step. This happens in compressed “latent space” for speed, then decoded to a full image.
A generative AI model that learns by reversing a noise-adding process. During training, noise is gradually added to real images; the model learns to predict and remove that noise. To generate, it starts from pure noise and denoises step-by-step into a coherent image.
“Diffusion” refers to the noise diffusion process; “Stable” comes from Stability AI, the company that funded and released it. The name also fits technically — the gradual denoising process converges reliably, unlike some earlier unstable generative methods.
It generates new images from noise rather than retrieving stored ones, but it learned visual patterns (including artists’ styles) from billions of training images. Whether this constitutes copying is the subject of ongoing lawsuits — the defining legal question for generative AI art.
Hands have complex fine detail that’s hard to represent in the compressed latent space where diffusion operates. The model approximates, producing extra fingers or melted shapes. Newer versions and specialized fine-tunes have improved this significantly, but it remains a known weakness.




