For the complete documentation index, see llms.txt. This page is also available as Markdown.

Principles of AI art

Learn how AI image generation works, from text prompts and model selection to the key technologies behind text-to-image generation, including text encoders, diffusion models, and VAEs.

The creative workflow: Enter a prompt → Select a model → Adjust generation settings → Generate an image.

How AI generates images: Text prompt → Text encoder → Prompt embeddings → Iterative denoising → VAE decoder → Final image.

How Does AI Image Generation Work?

When you enter a text prompt, a text encoder converts it into numerical representations called embeddings, which help the AI model interpret your description.

At the same time, the generation process starts with random noise in the model's latent space. A diffusion model then gradually refines this noise over multiple denoising steps, guided by your prompt and generation settings, to form an image that matches your description.

In many Stable Diffusion-based models, a U-Net predicts how the latent representation should be updated during denoising, while a sampler determines how these updates are performed. Once denoising is complete, a Variational Autoencoder (VAE) decoder converts the refined latent representation into a visible image.

Several settings can influence the final result:

  • AI model: Determines the model's learned visual patterns, capabilities, and output style.

  • Sampling method: Controls how the denoising process is carried out.

  • Sampling steps: Determines how many denoising steps are performed.

  • Image size: Sets the dimensions of the generated image.

  • Seed: Controls the random initialization, helping you reproduce or explore different results.

Understanding these basics can help you make more informed choices when generating images and refining your prompts.

Last updated