How Diffusion Models Actually Work (Without the Math)
A plain-English explanation of how Stable Diffusion, Flux, and every other image AI turns a sentence into a picture.
June 18, 2026 ยท 7 min read

Start with the punchline
A diffusion model is a neural network trained to answer one question, over and over: "Given a noisy image, what would a slightly less noisy version look like?"
If you can answer that question well, you can start with pure noise (random static) and iteratively "denoise" it into a real image. That's the whole trick.
The training side
During training, the model is shown millions of real images. Each one has noise added to it in progressive amounts โ a little, a bit more, a lot, and finally pure static. The model learns to predict the noise that was added at each step. If it can predict the noise, it can subtract it.
Under the hood: a U-Net neural network with attention layers, trained to minimize the difference between its noise prediction and the actual noise that was added.
The inference side (what you experience)
When you type "a goat wearing sunglasses":
- Your text is turned into embeddings by a text encoder (CLIP for SDXL, T5 for Flux).
- A random noise image is generated (this is your "seed").
- The U-Net predicts the noise, subtracts a fraction of it. Repeat.
- After 20โ30 steps, no more noise. You have your image.
Why prompt tokens have order
The text embeddings are attended to at every step. Because of how attention works, earlier tokens get more consistent attention across the denoising process. Move a word to the front โ the model weighs it more.
Why more steps โ better
After ~30 steps, most samplers hit diminishing returns. 50 steps rarely looks better than 30. 100 steps almost never does. Save the compute.
Why SDXL is better than SD 1.5
Two U-Nets stacked (base + refiner), a bigger text encoder, and training on 1024ร1024 instead of 512ร512. That's most of it.
Why Flux is different
Flux replaces the U-Net with a transformer architecture and uses T5 (a language model) as its text encoder instead of CLIP. Result: it treats prompts more like sentences than tags. That's why long descriptive Flux prompts work better than long descriptive SDXL prompts.
Related reading
Tech & Deep Dives
What Does AI Image Generation Actually Cost? (2026 Numbers)
The real per-image economics โ GPU minutes, model licenses, storage โ and why credit-based pricing is fairer than image-counts.
Tech & Deep Dives
LoRAs and Fine-Tuning, Explained
What LoRAs are, how they differ from full fine-tuning, and when to reach for each. Includes when to skip both and just use a good prompt.
Tech & Deep Dives
Content Safety in AI Image Generation โ What's Blocked and Why
The categories every major AI image platform blocks, why, and what you can do if you have a legitimate use case that keeps getting flagged.