arXiv(opens in a new tab)Computer ScienceMay 2022Cited by 15 papers on PaperVantage

Manuscript Offprint

arXiv:2205.11487

Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding

Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L. Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. S. Mahdavi, Raphael Gontijo Lopes, Tim Salimans, Jonathan Ho, David J. Fleet, Mohammad Norouzi

Abstract

We present Imagen, a text-to-image diffusion model with an unprecedented degree of photorealism and a deep level of language understanding. Imagen builds on the power of large transformer language models in understanding text and hinges on the strength of diffusion models in high-fidelity image generation. Our key discovery is that generic large language models (e.g. T5), pretrained on text-only corpora, are surprisingly effective at encoding text for image synthesis: increasing the size of the language model in Imagen boosts both sample fidelity and image-text alignment much more than increasing the size of the image diffusion model. Imagen achieves a new state-of-the-art FID score of 7.27 on the COCO dataset, without ever training on COCO, and human raters find Imagen samples to be on par with the COCO data itself in image-text alignment. To assess text-to-image models in greater depth, we introduce DrawBench, a comprehensive and challenging benchmark for text-to-image models. With DrawBench, we compare Imagen with recent methods including VQ-GAN+CLIP, Latent Diffusion Models, GLIDE and DALL-E 2, and find that human raters prefer Imagen over other models in side-by-side comparisons, both in terms of sample quality and image-text alignment. See imagen.research.google for an overview of the results.

1 Introduction

Multimodal learning has come into prominence recently, with text-to-image synthesis [ramesh-dalle, crowson2022vqgan, rombach-cvpr-2022] and image-text contrastive learning [radford-icml-2021, jia2021scaling, weston2011wsabie] at the forefront. These models have transformed the research community and captured widespread public attention with creative image generation [gafni2022make, ramesh-dalle2] and editing applications [fu2021language, nichol-glide, kim2021diffusionclip]. To pursue this research direction further, we introduce Imagen, a text-to-image diffusion model that combines the power of transformer language models (LMs) [devlin-naacl-2019, raffel-jmlr-2020] with high-fidelity diffusion models [ho2020denoising, ho2021cascaded, dhariwal2021diffusion, nichol-glide] to deliver an unprecedented degree of photorealism and a deep level of language understanding in text-to-image synthesis. In contrast to prior work that uses only image-text data for model training [ramesh-dalle, nichol-glide, e.g.,], the key finding behind Imagen is that text embeddings from large LMs [raffel-jmlr-2020, devlin-naacl-2019], pretrained on text-only corpora, are remarkably effective for text-to-image synthesis. See Fig. 1 for select samples.

Figure

(a) Sprouts in the shape of text ‘Imagen’ coming out of a fairytale book.

Figure

(b) A photo of a Shiba Inu dog with a backpack riding a bike. It is wearing sunglasses and a beach hat.

Figure

(c) A high contrast portrait of a very happy fuzzy panda dressed as a chef in a high end kitchen making dough. There is a painting of flowers on the wall behind him.

Figure

(d) Teddy bears swimming at the Olympics 400m Butterfly event.

Figure

(e) A cute corgi lives in a house made out of sushi.

Figure

(f) A cute sloth holding a small treasure chest. A bright golden glow is coming from the chest.

Figure

(g) A brain riding a rocketship heading towards the moon.

Figure

(h) A dragon fruit wearing karate belt in the snow.

Figure

(i) A strawberry mug filled with white sesame seeds. The mug is floating in a dark chocolate sea.

Figure 1: Select 1024×10241024\times 1024 Imagen samples for various text inputs. We only include photorealistic images in this figure and leave artistic content to the Appendix, since generating photorealistic images is more challenging from a technical point of view. , and show more samples.

Imagen comprises a frozen T5-XXL [raffel-jmlr-2020] encoder to map input text into a sequence of embeddings and a 64 ⁣× ⁣6464\!\times\!64 image diffusion model, followed by two super-resolution diffusion models for generating 256 ⁣× ⁣256256\!\times\!256 and 1024 ⁣× ⁣10241024\!\times\!1024 images (see ). All diffusion models are conditioned on the text embedding sequence and use classifier-free guidance [ho2021classifierfree]. Imagen relies on new sampling techniques to allow usage of large guidance weights without sample quality degradation observed in prior work, resulting in images with higher fidelity and better image-text alignment than previously possible.

While conceptually simple and easy to train, Imagen yields surprisingly strong results. Imagen outperforms other methods on COCO [lin-eccv-2014] with zero-shot FID-30K of 7.27, significantly outperforming prior work such as GLIDE [nichol-glide] (at 12.4) and the concurrent work of DALL-E 2 [ramesh-dalle2] (at 10.4). Our zero-shot FID score is also better than state-of-the-art models trained on COCO, e.g., Make-A-Scene [gafni2022make] (at 7.6). Additionally, human raters indicate that generated samples from Imagen are on-par in image-text alignment to the reference images on COCO captions.

We introduce DrawBench, a new structured suite of text prompts for text-to-image evaluation. DrawBench enables deeper insights through a multi-dimensional evaluation of text-to-image models, with text prompts designed to probe different semantic properties of models. These include compositionality, cardinality, spatial relations, the ability to handle complex text prompts or prompts with rare words, and they include creative prompts that push the limits of models’ ability to generate highly implausible scenes well beyond the scope of the training data. With DrawBench, extensive human evaluation shows that Imagen outperforms other recent methods [rombach-cvpr-2022, crowson2022vqgan, ramesh-dalle2] by a significant margin. We further demonstrate some of the clear advantages of the use of large pre-trained language models [raffel-jmlr-2020] over multi-modal embeddings such as CLIP [radford-icml-2021] as a text encoder for Imagen.

Key contributions of the paper include:

  1. We discover that large frozen language models trained only on text data are surprisingly very effective text encoders for text-to-image generation, and that scaling the size of frozen text encoder improves sample quality significantly more than scaling the size of image diffusion model.
  2. We introduce dynamic thresholding, a new diffusion sampling technique to leverage high guidance weights and generating more photorealistic and detailed images than previously possible.
  3. We highlight several important diffusion architecture design choices and propose Efficient U-Net, a new architecture variant which is simpler, converges faster and is more memory efficient.
  4. We achieve a new state-of-the-art COCO FID of 7.27. Human raters find Imagen to be on-par with the reference images in terms of image-text alignment.
  5. We introduce DrawBench, a new comprehensive and challenging evaluation benchmark for the text-to-image task. On DrawBench human evaluation, we find Imagen to outperform all other work, including the concurrent work of DALL-E 2 [ramesh-dalle2].