GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models

Alexander Quinn Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, Mark Chen

TL;DR

GLIDE (Guided Language-to-Image Diffusion for Generation and Editing) is a 3.5 billion parameter diffusion model that sets a new standard for photorealistic text-to-image synthesis. By leveraging a technique called "classifier-free guidance," GLIDE produces images that human evaluators overwhelmingly prefer over the original DALL-E. Furthermore, it enables seamless, text-driven image editing through native inpainting capabilities.

The Challenge of Text-to-Image Synthesis

While earlier models like the original DALL-E proved that AI could generate creative images from text, they frequently struggled to achieve true photorealism or maintain fine-grained alignment with complex prompts.

A photorealistic generation of a hedgehog using a calculator, demonstrating GLIDE's ability to blend concepts.

The core obstacle in text-to-image generation is balancing fidelity (how realistic the image appears) with diversity (how accurately it reflects the prompt). Previous approaches often relied on a computationally expensive "reranking" process—generating hundreds of candidate images and using a separate model like CLIP to select the best one. Unfortunately, this brute-force method does not consistently yield the most realistic outputs. The creators of GLIDE sought to solve this by baking "guidance" directly into the generative process, achieving superior results with far fewer samples.

Methods: How GLIDE Works

GLIDE is built upon Diffusion Models, a class of generative AI that creates images by starting with pure noise and iteratively "denoising" it until a coherent picture emerges. The architecture introduces three primary components:

  1. Text Conditioning: The model utilizes a Transformer-based text encoder. The resulting text embeddings are fed directly into the diffusion model (a U-Net architecture), allowing the text prompt to actively "steer" the denoising process at every single step.
  2. Classifier-Free Guidance (CFG): This is the paper's breakthrough technique. Instead of relying on a separate classifier to guide the model, GLIDE is trained to perform both conditional (text-prompted) and unconditional generation. During the sampling phase, the model's output is mathematically pushed toward the conditional prediction and away from the unconditional one. The authors discovered this significantly outperforms CLIP Guidance, which relies on a separate CLIP model to provide gradients during denoising.
  3. Upsampling Stack: To keep computational costs manageable, GLIDE first generates a base image at 64x64 resolution. It then employs a specialized 1.5 billion parameter upsampling diffusion model to enhance the resolution to a crisp 256x256.

Datasets and Training

  • Training: GLIDE was trained on a massive, proprietary dataset consisting of hundreds of millions of image-text pairs—the same foundational dataset used for DALL-E.
  • Evaluation: The researchers used the MS-COCO validation set to measure the Fréchet Inception Distance (FID), a standard industry metric for evaluating image quality.
  • Safety Filtered Dataset: To mitigate potential misuse for the publicly released version of the model, the authors curated a smaller, filtered dataset that removed images containing people, violence, and hate symbols.

Key Insights

  • Guidance is King: The most surprising revelation was the superiority of classifier-free guidance over CLIP guidance. While CLIP guidance excels at matching the literal prompt, it often "games" the system by generating adversarial textures that satisfy the CLIP model but look entirely unrealistic to human eyes. CFG, conversely, taps into the generative model's own internal representation of realism.
  • Inpainting as a Native Skill: By fine-tuning the model to process masked images, GLIDE doubles as a powerful image editor. Users can erase a portion of an existing photo and describe what should fill the space (e.g., "add a corgi on the couch"). Rather than just pasting an object, GLIDE intelligently integrates it, matching the lighting, shadows, and reflections of the surrounding environment.
  • Human Preference vs. Automated Metrics: The research highlights a growing disconnect in AI evaluation: automated metrics like FID or CLIP scores frequently fail to align with actual human judgment. In tests, humans overwhelmingly preferred GLIDE’s outputs even when automated scores suggested a different model was better.

Key Results: Beating DALL-E

In head-to-head human evaluations, GLIDE (despite having only 3.5B parameters) decisively beat the original DALL-E (12B parameters). Evaluators preferred GLIDE 87% of the time for photorealism and 69% of the time for caption similarity.

A highly detailed image of a corgi wearing a party hat and bow tie, showcasing GLIDE's photorealism.

Additionally, GLIDE achieved a zero-shot FID of 12.24 on the MS-COCO dataset, representing a massive leap in quality over DALL-E’s score of ~28. It achieves this high quality efficiently, without the need to generate and rerank hundreds of samples.

Limitations and Future Work

Despite its impressive capabilities, GLIDE has notable limitations:

  • Sampling Speed: Image generation takes approximately 15 seconds on an NVIDIA A100 GPU. While faster than some reranking methods, it remains significantly slower than Generative Adversarial Networks (GANs), posing a hurdle for real-time applications.
  • Compositional Logic: The model can still stumble on highly unusual or "out-of-distribution" prompts, struggling with complex physical logic like "a bicycle with continuous tracks instead of wheels" or "a cat with eight legs."
  • Societal Bias: Because it is trained on uncurated internet data, GLIDE inherits human biases. For instance, prompting for "a religious place" heavily defaults to Western-style churches. The authors note that their safety filtering is only a preliminary step in addressing these deep-rooted bias issues.

Summary updated

BibTeX
@inproceedings{nichol2022glide,
  author = {Alexander Quinn Nichol and Prafulla Dhariwal and Aditya Ramesh and Pranav Shyam and Pamela Mishkin and Bob McGrew and Ilya Sutskever and Mark Chen},
  title = {{GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
}
Figure