Generate
Tools
Templates
Learn
Use cases
Pricing
Sign in Start creating

From noise to picture: How diffusion models work

An in-depth, plain-language explainer on how diffusion models generate images from noise.

On this page

Understanding how diffusion models actually build images helps you write better prompts, make sense of the settings you see, and have realistic expectations about what these tools can and cannot do.

Quick answer

A diffusion model generates an image by starting with pure random noise - A picture of static - And repeatedly removing small amounts of that noise while adding structure, step by step, until a recognizable image appears. During training, the model learned this skill by watching the reverse process: real images being gradually destroyed by adding noise until nothing was left. Generation runs that learned process backward. Your text prompt guides which direction the steps go.

The training process: learning to reverse destruction

To understand how generation works, it helps to start with training, because the two are mirror images of each other.

During training, the model is shown real images from a large dataset and then watches those images get progressively noisier in a series of steps. At each step, a small amount of Gaussian noise - Statistically random variation - Is added to the image. After enough steps, the original picture is completely unrecognizable. It looks like static.

At each of those steps, the model is trained to predict exactly what noise was added. If it can predict the noise, it can subtract it - Which means it can reverse the process. Given a slightly noisy image, predict the noise component, remove it, and you are left with a slightly less noisy image. Run that enough times from pure noise and you arrive at a real-looking image.

This is why the process is called diffusion. The noise diffuses into the image during training in a controlled, predictable way, and the model learns to undo that diffusion.

The generation process step by step

When you click generate, the process runs in the following order:

  1. The model starts with an image of pure random noise - Nothing recognizable at all
  2. Your text prompt is converted to a numerical representation (an embedding) by a text encoder
  3. The diffusion model takes the noise and the text embedding and predicts what noise to remove
  4. A slightly cleaner image emerges after that step
  5. Steps 3 and 4 repeat - Typically 20 to 50 times depending on settings
  6. Each step moves the image further from random noise and closer to a coherent picture
  7. At the final step, the result is decoded into the image you see

No single step produces anything recognizable. The image emerges gradually, the way a photograph develops in a darkroom. The text embedding acts as a compass that keeps each step oriented toward a result that matches your description.

Latent diffusion: why it is practical

Running this process directly on full-size images at every pixel would be extremely slow and computationally expensive. Most modern image generators use a variation called latent diffusion, which moves the noising and denoising process into a compressed mathematical space.

Before training, images are encoded by a separate model (a variational autoencoder) into a much smaller representation called a latent. The diffusion process operates in this compressed latent space rather than on raw pixels. Only at the final step is the latent decoded back into a full image.

This is why generation is fast enough to be practical in a web browser. The core computation happens on a fraction of the data that raw pixel-level diffusion would require. It also means the model learns patterns at a higher level of abstraction than individual pixels, which contributes to the coherence of the results.

What sampling steps control

The number of denoising steps - Sometimes called sampling steps - Is one of the settings you may see exposed in a generator. More steps generally produces higher-quality results, up to a point, because each step refines the image further. Beyond a certain number of steps, additional passes produce diminishing returns.

Fewer steps produce results faster but can leave the image less refined, with some of the randomness from the starting noise still visible in the texture or composition. Most tools choose a default that balances speed and quality for typical use. If you are trying to get a quick rough draft, fewer steps is fine. For a final output, the default or higher is appropriate.

A related setting is the sampler, which is the specific mathematical method used to take each denoising step. Different samplers reach good results in different numbers of steps and can produce slightly different visual characteristics. This is a more advanced setting worth ignoring until you are comfortable with basic generation.

How text guides the process

Without any guidance, a diffusion model starting from noise would produce a random coherent-looking image - The model has learned what "real images" look like, but has no direction. The text embedding provides that direction.

At each denoising step, the model considers both the current state of the image and the text embedding, and makes predictions that move the image toward matching the description. This is called classifier-free guidance, and the strength of its influence is sometimes exposed as a guidance scale or cfg scale setting.

A higher guidance scale makes the output stick more closely to your prompt but can produce images that look over-processed or unnatural. A lower scale gives the model more freedom, which sometimes produces more interesting results but may wander from your description. The default is usually set to a value that works well across a broad range of prompts.

For more on what the text encoder part of this pipeline does, see how CLIP and diffusion models work together.

Why the same prompt gives different results each time

The starting noise is random. Each time you run a generation, the model starts from a different point in noise-space and takes a different path through the denoising steps, even with the same prompt and settings. The text embedding keeps each path oriented in the same general direction, but the specifics of where you end up - The exact composition, small details, the particular way light falls - Vary because the starting point varies.

This is also why you can run the same prompt a few times and compare results rather than expecting one perfect output on the first try. Generating several versions and choosing the best one is a normal part of the workflow. The text to image guide covers this iteration process and when to adjust prompts versus simply running again.

What this explains about limitations

Understanding the denoising process makes some known limitations easier to interpret:

  • Text inside images is unreliable because the model generates letter-shaped noise patterns that look approximately correct but lack the structural accuracy of real typography
  • Consistent characters are hard because each generation starts fresh from different noise, with no memory of a previous result
  • Exact counts are difficult because the model learns statistical patterns, not arithmetic
  • Unusual compositions sometimes fail because the training data contained fewer examples of them to learn from

None of these are fundamental barriers forever, but they reflect genuine challenges in the denoising approach rather than bugs. Knowing them in advance helps you work around them - See negative prompts for one practical technique.

Checklist

  • Understand that each generation starts from different random noise, so variation is expected
  • Use a higher step count for final outputs; lower is fine for quick drafts
  • Let the default guidance scale stand unless you have a specific reason to change it
  • Run several versions of the same prompt to find the best result
  • Add text to your images in a design tool after generating, not through the prompt

FAQ

How many steps does a typical generation use?

Most tools default to somewhere between 20 and 50 steps. This is enough to produce a clean result for most prompts. Running more than 50 steps rarely produces visible improvement for standard use.

What is the difference between different samplers?

Different samplers use different mathematical approaches to take each denoising step. Some are faster but need more steps; others reach a good result in fewer steps but take more computation per step. For most users, the default sampler the tool chooses is appropriate. Experimenting with samplers is worth trying once you have basic generation working well.

Why do some images look oversaturated or unnatural?

This is often a symptom of a high guidance scale pushing the model to follow the prompt too rigidly. Lowering the guidance scale slightly can produce a more natural-looking result. Some prompt styles also push models toward vivid, stylized outputs - Adjusting the style words in the prompt can help.

Can I control which starting noise point is used?

Yes. Most tools expose this as a seed value. Setting the same seed with the same prompt and settings produces the same (or very similar) result each time, which is useful for reproducibility. Changing only the seed while keeping everything else the same shows how much variation comes purely from the starting point.

Does this same process work for image-to-image generation?

Yes. In image-to-image generation, instead of starting from pure random noise, the process starts from your input image that has had some noise added to it. The denoising proceeds from that point, guided by your text prompt. Starting closer to the real image preserves more of its structure; adding more noise and denoising from there allows more change.

This guide is general information to help you create better images. For rights and commercial questions, read the copyright and image rights notes.

Frequently asked questions

How many steps does a typical generation use?
Most tools default to somewhere between 20 and 50 steps. This is enough to produce a clean result for most prompts. Running more than 50 steps rarely produces visible improvement for standard use.
What is the difference between different samplers?
Different samplers use different mathematical approaches to take each denoising step. Some are faster but need more steps; others reach a good result in fewer steps but take more computation per step. For most users, the default sampler the tool chooses is appropriate. Experimenting with samplers is worth trying once you have basic generation working well.
Why do some images look oversaturated or unnatural?
This is often a symptom of a high guidance scale pushing the model to follow the prompt too rigidly. Lowering the guidance scale slightly can produce a more natural-looking result. Some prompt styles also push models toward vivid, stylized outputs - Adjusting the style words in the prompt can help.
Can I control which starting noise point is used?
Yes. Most tools expose this as a seed value. Setting the same seed with the same prompt and settings produces the same (or very similar) result each time, which is useful for reproducibility. Changing only the seed while keeping everything else the same shows how much variation comes purely from the starting point.
Does this same process work for image-to-image generation?
Yes. In [image-to-image generation](/learn/image-to-image-guide), instead of starting from pure random noise, the process starts from your input image that has had some noise added to it. The denoising proceeds from that point, guided by your text prompt. Starting closer to the real image preserves more of its structure; adding more noise and denoising from there allows more change.