How Does Imagen Generate Images from Text?

Updated

Imagen is a text-to-image diffusion model from Google Research's Brain Team that turns a written prompt into a photorealistic image. It works by pairing a large pretrained language model (such as T5) that encodes your text with a diffusion model that generates the image. The key finding behind its quality: scaling up the language model improves both image fidelity and image-text alignment more than scaling up the image diffusion model.

The Two-Stage Pipeline

Imagen separates understanding text from generating pixels.

Stage 1: Text encoding with a large language model

  • A generic large language model pretrained only on text (for example T5) reads your prompt and converts it into a numerical representation.
  • This model was never trained on images, yet the research found it is "surprisingly effective at encoding text for image synthesis."
  • Because it captures deep language structure, it handles prompts with unusual combinations and relationships between objects.

Stage 2: Diffusion-based image generation

  • A diffusion model takes that text representation and generates a high-fidelity image.
  • Diffusion models work by starting from noise and iteratively refining it into a coherent picture, which is where Imagen's photorealism comes from.

Why the Language Model Matters Most

The central discovery is about where to invest scale:

Scaling choice Effect on sample fidelity Effect on image-text alignment
Increase language model size Improves Improves
Increase image diffusion model size Improves less Improves less

In other words, a stronger text encoder does more for overall quality than a bigger image generator. This is why Imagen "builds on the power of large transformer language models in understanding text."

Evidence of Quality

  • Imagen achieved a state-of-the-art FID score of 7.27 on the COCO dataset without ever training on COCO.
  • Human raters found Imagen samples on par with the COCO data itself in image-text alignment.
  • On DrawBench, a benchmark introduced alongside Imagen, human raters preferred Imagen over VQ-GAN+CLIP, Latent Diffusion Models, and DALL-E 2 in side-by-side comparisons, for both sample quality and image-text alignment.

What Kind of Prompts It Handles

The model is designed for detailed, compositional prompts. Examples shown on the site include:

  • "A brain riding a rocketship heading towards the moon."
  • "A dragon fruit wearing karate belt in the snow."
  • "A small cactus wearing a straw hat and neon sunglasses in the Sahara desert."
  • "A photo of a Corgi dog riding a bike in Times Square. It is wearing sunglasses and a beach hat."
  • "Teddy bears swimming at the Olympics 400m Butterfly event."
  • "A transparent sculpture of a duck made out of glass. The sculpture is in front of a painting of a landscape."

These illustrate the combination of photorealism and deep language understanding the model targets.

Related Models in the Imagen Family

The same research direction extends to:

  • Imagen Video — video generation
  • Imagen Editor — image editing

Bottom Line

Imagen generates images by letting a large text-only language model interpret your prompt and a diffusion model render it. Its advantage comes from the discovery that scaling the language model boosts fidelity and alignment more than scaling the image model, which is how it reached leading FID and human-preference results without training on COCO.