All are Worth Words: A ViT Backbone for Diffusion Models

Fan Bao, Shen Nie, Kaiwen Xue, Yue Cao, Chongxuan Li +2 more
9/25/2022
cs.CVcs.AIcs.LG

Official code: baofff/U-ViT (1,109 stars, MIT, last commit 2023-03-25).

Abstract

Vision transformers (ViT) have shown promise in various vision tasks while the U-Net based on a convolutional neural network (CNN) remains dominant in diffusion models. We design a simple and general ViT-based architecture (named U-ViT) for image generation with diffusion models. U-ViT is characterized by treating all inputs including the time, condition and noisy image patches as tokens and employing long skip connections between shallow and deep layers. We evaluate U-ViT in unconditional and class-conditional image generation, as well as text-to-image generation tasks, where U-ViT is comparable if not superior to a CNN-based U-Net of a similar size. In particular, latent diffusion models with U-ViT achieve record-breaking FID scores of 2.29 in class-conditional image generation on ImageNet 256x256, and 5.48 in text-to-image generation on MS-COCO, among methods without accessing large external datasets during the training of generative models. Our results suggest that, for diffusion-based image modeling, the long skip connection is crucial while the down-sampling and up-sampling operators in CNN-based U-Net are not always necessary. We believe that U-ViT can provide insights for future research on backbones in diffusion models and benefit generative modeling on large scale cross-modality datasets.

View on arXivView PDF

Code Implementations(1)

baofff/U-ViTOfficial100%
MIT

A PyTorch implementation of the paper "All are Worth Words: A ViT Backbone for Diffusion Models".

1,10977Python, Jupyter NotebookNov 18, 20223 years agoMIT

Similar Papers

Cite this paper

@article{bao2022worth,
  title  = {All are Worth Words: A ViT Backbone for Diffusion Models},
  author = {Fan Bao and Shen Nie and Kaiwen Xue and Yue Cao and Chongxuan Li and Hang Su and Jun Zhu},
  year   = {2022},
  eprint = {2209.12152},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.12152}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.12152.svg)](https://codeofpaper.com/paper/2209.12152)

Discussion