How image generation works

Models, prompts, sampling, and the settings used to generate an image.

Short read6 parts

What this covers

Explanation detail
  1. 1 · Noise and sampling

    Move the slider to see intermediate previews from one text-to-image generation. Each position shows a sampling step.The process starts with random noise. The model's predictions guide a series of updates that produce an image. For Stable Diffusion, this happens in a compressed image representation called a latent, which is decoded into pixels for display. controls the number of sampling steps. Other workflows, such as img2img, can start from a noisy version of an existing image.Switch to Estimated final image to see a prediction of the finished result at each step. Early predictions can change substantially before generation ends.
  2. 2 · Prompt guidance

    The text encoder converts your prompt into numbers the image model can use. This information, called text conditioning, guides generation.Describe the subject and details you care about. The model can miss details, combine them incorrectly, or introduce features you did not specify.Wording and supported can change the result. The effect of word order varies by model; the first words are not always the most influential.For supported models, can reduce unwanted features. Its effect also depends on guidance settings.
  3. 3 · Models and training

    An image contains learned numerical parameters, often called weights. Training adjusts these using examples of images and text.Diffusion training commonly teaches a network to predict information about noise added to images. During generation, those learned patterns help produce an image from your prompt.Models can learn complex patterns, mistakes, and biases. They can also memorise some training examples, so a new generation is not guaranteed to be unique.Models differ because of their architecture, training data, and later fine-tuning. These differences affect subjects, appearance, and supported settings.
  4. 4 · Steps and guidance

    controls the sampling count. Too few steps may leave an incomplete image; extra steps take more time and and can eventually add little. controls prompt guidance. Increasing it may improve prompt agreement, but excessive values can cause harsh contrast or distorted shapes.Use the model's suggestions as a starting point. Models designed for fast generation can need very different values from conventional Stable Diffusion models.The examples compare these settings for particular requests. They do not define universal ranges.
  5. 5 · Seeds and variation

    is a number used to generate the starting noise. Different seeds can produce different images from the same prompt.Keep the seed and other settings fixed to compare one change. Leave it blank to request a random seed, and save it with the settings when you want to return to a result. controls the sampling method. Changing it or the step count can change the image even with the same seed. can use different hardware and software, so matching someone else's settings does not guarantee an identical image.
  6. 6 · First image tutorial

    The first-image tutorial turns these ideas into a : a prompt and settings sent to the Horde.Follow it to choose a model, set the sampling options, and generate an image. You can skip steps you already understand.