AI image generators use diffusion models trained to remove noise from pictures. To make a new image, the model starts from random static and strips noise away in many small steps, steered by a text prompt that an encoder converts into numbers, until a clear picture remains.
Table of contents 7 sections
- A diffusion model is trained to predict and remove noise that was added to real images.
- To create a picture, it starts from pure static and cleans it step by step, steered by your text prompt.
- Latent diffusion runs the process in a compressed space, which made Stable Diffusion cheap enough for consumer hardware.
- Models can occasionally reproduce near-copies of training images, and the legal status of training data is still contested.
- In the United States, prompts alone do not make you the author of the output under the Copyright Office's January 2025 conclusion.
How AI image generators work comes down to one trick: they learn to clean noise out of a picture. A diffusion model, trained on millions of images that were deliberately buried in random static, gets so good at undoing the damage that it can start from pure static and, guided by your text prompt, end up with a picture that never existed.
Why does an image generator start from static?
The idea comes from physics. In 2015, a group of researchers proposed building a generative model by running diffusion in reverse: destroy the structure in data with noise, step by step, then train a network to rebuild it. Five years later, Jonathan Ho, Ajay Jain and Pieter Abbeel showed in Denoising Diffusion Probabilistic Models that the method could produce high-quality images, and the field moved quickly from there.
The destructive half is simple. Take a photograph, add a small amount of random noise, and repeat. After enough steps, 1,000 of them in the original paper, nothing of the photograph survives and only static remains. This forward process needs no learning at all.
What does the network learn during training?
Training turns that forward process into a teaching exercise. Pick a training image, pick a random noise level, add that much noise, and ask the network to predict the noise that was added. Compare the guess with the truth, nudge the network's weights to shrink the error, and repeat across a very large dataset.
The network doing this is called the denoiser. In early systems it was a U-Net, a convolutional design that looks at an image at several scales. Some newer models replace it with a transformer, the architecture behind large language models, which treats the image as a grid of patches.
The denoiser mostly learns regularities rather than a catalogue of pictures: skies are smooth, eyes come in pairs, shadows fall away from the light. That is why it can draw scenes nobody photographed.
How AI image generators work from prompt to picture
Generating an image runs the process backwards, in five stages.
- Encode the prompt. A text encoder turns your words into numbers. Stable Diffusion's first public versions used the text encoder from OpenAI's CLIP, a model trained on 400 million image-text pairs so that pictures and their captions land close together in one numerical space.
- Draw random noise. The starting point is a field of static. A random seed fixes which static, which is why reusing a seed and settings tends to reproduce an image.
- Predict and subtract noise. At each step the denoiser estimates the noise left in the image, consults the prompt numbers through a mechanism called cross-attention, and removes a slice of it.
- Repeat. The original research used 1,000 steps; faster samplers reach good results in a few dozen.
- Decode. A decoder turns the finished result into ordinary pixels.
One more ingredient sets how closely the image follows your words. In classifier-free guidance, introduced by Jonathan Ho and Tim Salimans in 2022, the model makes two predictions at every step, one with the prompt and one without, and pushes the result further in the direction of the difference. A higher guidance setting follows the prompt more literally, usually at the cost of variety.
Why is latent diffusion cheaper than working on pixels?
Denoising a full-resolution image pixel by pixel is expensive; the authors of the latent diffusion paper noted that training such models often takes hundreds of GPU days. Their fix was to run diffusion inside a compressed space. An autoencoder first shrinks each image into a much smaller grid of numbers called a latent. The denoiser works on that grid, and the decoder expands the finished latent back into pixels.
Stable Diffusion shrinks each side of the image by a factor of 8, so a 512-by-512 picture becomes a 64-by-64 latent. Its denoiser has about 860 million parameters, and the first release ran on a single consumer graphics card with at least 10 GB of video memory. That made running the model at home practical.
Do diffusion models copy the images they were trained on?
Mostly they do not, but sometimes they do. Stable Diffusion's early versions were trained on subsets of LAION-5B, an open dataset of 5.85 billion image-text pairs collected from the web. In 2023, researchers from Google, DeepMind and several universities showed that such models can memorize and reproduce individual training images, extracting over a hundred near-identical copies from Stable Diffusion and Imagen. Images that appear many times in the data are more likely to be memorized.
Whether training on copyrighted images is lawful is still contested and varies by country. Ownership of the output is a separate question. In January 2025 the US Copyright Office concluded in its report on copyrightability that prompts alone do not give a user enough control to count as the author, while a person's own creative selection, arrangement or modification can be protected. Europe regulates AI systems differently, as our explainer on the EU AI Act sets out.
Where do AI images still go wrong?
- Plausible is not true. The model is trained to produce images that look like its data, not to check facts, so a realistic scene can show something that never happened.
- Prompts are suggestions. Exact counts, readable text and which object sits where are places errors often appear, although newer models do better.
- Training data leaves fingerprints. Gaps and biases in the web images a model learned from shape what it draws by default.
- Compute costs energy. Each image takes many passes through a large network. How that adds up is the subject of our piece on data center energy demand.
How should you use and judge AI-generated images?
Treat a generated image as a draft, not as evidence. A few habits help.
- Read the tool's terms on commercial use and ownership before you publish, because they differ between services.
- Look for provenance labels. The C2PA standard, branded Content Credentials, attaches a signed edit history to a file, but a missing label proves nothing because metadata can be removed.
- Describe subject, setting, lighting and style in your prompt, then iterate. Our guide to writing better AI prompts covers habits that carry over.
- Disclose AI use where your audience expects a real photograph, such as news, documentary or product images.
Frequently asked
- Denoising Diffusion Probabilistic Models — arXiv
- High-Resolution Image Synthesis with Latent Diffusion Models — arXiv
- Stable Diffusion: a latent text-to-image diffusion model (README) — CompVis, GitHub
- Copyright and Artificial Intelligence, Part 2: Copyrightability — U.S. Copyright Office
0 comments
No comments yet — be the first.