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

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

Abstract

OpenAI introduces GLIDE (Guided Language-to-Image Diffusion for Generation and Editing), a 3.5 billion parameter text-guided diffusion model capable of producing highly photorealistic images from natural language prompts. By leveraging "classifier-free guidance," GLIDE significantly outperforms the 12-billion parameter DALL-E model in human evaluations for both image quality and caption alignment, while enabling sophisticated iterative image editing through fine-tuned inpainting capabilities.

Introduction

The synthesis of realistic images from free-form text descriptions remains a central challenge in generative AI. While autoregressive models like DALL-E and various GAN architectures have demonstrated the ability to compose complex scenes, they often struggle to achieve the level of photorealism found in modern diffusion models. Diffusion models have recently set new benchmarks for unconditional and class-conditional generation, but extending this performance to open-domain text prompts requires effective guidance strategies.

A photorealistic generation of the Grand Canyon at sunset, demonstrating GLIDE's high fidelity.

GLIDE bridges this gap by combining the flexibility of text-to-image models with the photorealism of guided diffusion. Beyond one-shot generation, the model is designed for iterative, fine-grained image editing (inpainting), allowing users to modify existing images using natural language.

Methodology

The GLIDE architecture consists of a two-stage diffusion process: a 3.5 billion parameter base model generating images at 64x64 resolution, followed by a 1.5 billion parameter upsampling model that increases resolution to 256x256. A Transformer-based text encoder conditions the denoising process.

Guidance Strategies

A primary focus of this work is the comparison of two techniques for steering the diffusion process toward a text prompt:

  1. CLIP Guidance: This method utilizes gradients from a noise-aware CLIP model to guide the image toward the text embedding during denoising.
  2. Classifier-Free Guidance: During training, the text conditioning is randomly omitted for 20% of the samples. At inference, the model extrapolates between a conditional and an unconditional prediction. This approach requires no external classifier or CLIP model.

Image Inpainting

To enable robust editing, GLIDE was explicitly fine-tuned for inpainting. Unlike standard diffusion models that can perform inpainting by simply replacing pixels, GLIDE is trained with the masked image and a mask channel as additional inputs. This allows the model to generate content that seamlessly integrates with the surrounding context, respecting existing lighting, shadows, and style.

Evaluation and Key Insights

GLIDE was trained on the same large-scale dataset of internet image-text pairs as DALL-E. Evaluation on MS-COCO using zero-shot metrics (FID, Inception Score) showed that GLIDE is highly competitive.

The Divergence of Metrics and Human Preference

A critical finding is that automated metrics like CLIP scores can be misleading. While CLIP guidance achieved higher CLIP scores, human evaluators overwhelmingly preferred images generated with classifier-free guidance. This suggests that CLIP guidance can "game" the metric by finding adversarial-like features that satisfy the CLIP model without improving visual quality or semantic accuracy for humans.

An example of attribute binding: "a corgi wearing a red bowtie and a purple party hat."

Comparison with DALL-E

Despite having fewer parameters (3.5B vs. 12B), GLIDE significantly outperformed DALL-E in human evaluations. Judges preferred GLIDE's outputs 87% of the time for photorealism and 69% of the time for caption similarity. Notably, GLIDE achieves these results in a single sampling run, whereas DALL-E typically requires generating hundreds of candidates and reranking them with CLIP.

Limitations and Safety

Despite its performance, GLIDE faces several challenges:

  • Inference Latency: Sampling a single image takes approximately 15 seconds on an A100 GPU, limiting real-time utility.
  • Physical Reasoning: The model occasionally struggles with highly unusual or counter-intuitive prompts (e.g., "a car with triangular wheels").
  • Safety and Bias: To mitigate risks associated with deepfakes and data bias, the authors released a smaller 300M parameter model trained on a strictly filtered dataset, excluding humans and sensitive content.

Conclusion

GLIDE demonstrates that diffusion models, when paired with effective guidance and scaling, can surpass large-scale autoregressive models in text-to-image synthesis. The addition of explicit inpainting training further transforms these models into powerful tools for interactive creative workflows.

Summary updated

BibTeX
@inproceedings{nichol2022glide,
  author = {Alex 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