Skip to content

Text-to-Image Generation

Creating a new image from a written description, by combining a text encoder that understands the prompt with a generative image model.

Also image generation · prompt to image · DALL-E

Fig. / How it works
PromptPromptText encoderText encoderDenoise in latent spaceDenoise in latent spaceDecode to pixelsDecode to pixels
Domain 06
Generative AI
Role · kind
Using and applyingTechnique
Level
Intermediate

You describe a picture in words, and the computer paints it for you, even something that has never existed, like a cat astronaut on the moon.

Where it fits

+All relationships as a list

See it on the full map

How it works

A text-to-image system has two jobs: understand the prompt, and paint a matching picture.

  1. Understand. A text encoder turns the prompt into embeddings. Early systems used CLIP’s text encoder; newer ones often use larger language models, which follow complex prompts better.
  2. Paint. A generator creates the image while “looking at” those embeddings. Today this is almost always a diffusion model, usually working in a compressed latent space as in Stable Diffusion. Each denoising step attends to the text through cross-attention.

Classifier-free guidance turns the prompt’s influence up or down: higher guidance follows the prompt more literally but reduces variety. You can see exactly this trade-off in the diffusion widget on the diffusion model page.

Everyday use cases

  • Case 01

    Illustration and concept art

    Quick drafts of scenes, products or characters to iterate on.

  • Case 02

    Marketing and presentations

    Custom images instead of stock photos.

  • Case 03

    Photo editing

    Describe a change ("add snow", "remove the car") and fill it in.

Famous examples

Strengths, weaknesses and when to use it

Strengths

  • Turns ideas into images in seconds, no drawing skills needed.

Weaknesses

  • Struggles with exact text, counts and spatial instructions.
  • Copyright, consent and deepfake concerns around training data and outputs.

When to use itFor drafts, illustration and creative exploration; be careful with realistic images of real people.

Compare with

Check yourself

  1. Q01

    How does the prompt steer the image in a diffusion-based generator?

    Show answer

    A: The text embedding conditions every denoising step, usually through cross-attention

Go deeper

Learn first