unidiffuser-v1 / README.md
baofff's picture
Update README.md
3dd8509
|
raw
history blame
5.29 kB
metadata
license: agpl-3.0
tags:
  - text-to-image
  - image-to-text
  - image-captioning
  - image-variation
  - text-variation
  - multi-modality
  - generative model

UniDiffuser is a unified diffusion framework to fit all distributions relevant to a set of multi-modal data in one transformer. UniDiffuser is able to perform image, text, text-to-image, image-to-text, and image-text pair generation by setting proper timesteps without additional overhead.

Specifically, UniDiffuser employs a variation of transformer, called U-ViT, which parameterizes the joint noise prediction network. Other components perform as encoders and decoders of different modalities, including a pretrained image autoencoder from Stable Diffusion, a pretrained image ViT-B/32 CLIP encoder, a pretrained text ViT-L CLIP encoder, and a GPT-2 text decoder finetuned by ourselves.

We provide two versions of UniDiffuser:

  • UniDiffuser-v0: This version is trained on LAION-5B, which contains noisy webdata of text-image pairs.
  • UniDiffuser-v1: This version is resumed from UniDiffuser-v0, and is further trained with a set of less noisy internal text-image pairs. It uses a flag as its input to distinguish webdata and internal data during training.

Download

We provide files for UniDiffuser-v0 in this link, and files for UniDiffuser-v1 in this link. These files are:

  • autoencoder_kl.pth is the weight of the image autoencoder converted from Stable Diffusion.
  • caption_decoder.pth is the weight of the finetuned GPT-2 text decoder.
  • uvit_v0.pth/uvit_v1.pth is the weight of U-ViT for UniDiffuser-v0/UniDiffuser-v1.

Note that UniDiffuser-v0 and UniDiffuser-v1 share the same autoencoder_kl.pth and caption_decoder.pth. You only need to download them once. As for other components, they will be automatically downloaded.

Usage

Use the model with UniDiffuser codebase.

Model Details

  • Model type: Diffusion-based multi-modal generation model
  • Language(s): English
  • License: agpl-3.0
  • Model Description: This is a model that can perform image, text, text-to-image, image-to-text, and image-text pair generation. Its main component is a U-ViT, which parameterizes the joint noise prediction network. Other components perform as encoders and decoders of different modalities, including a pretrained image autoencoder from Stable Diffusion, a pretrained image ViT-B/32 CLIP encoder, a pretrained text ViT-L CLIP encoder, and a GPT-2 text decoder finetuned by ourselves.
  • Resources for more information: GitHub Repository, Paper.

Direct Use

Note: Most of this section is taken from the Stable Diffusion model card, but applies in the same way to UniDiffuser.

The model should be used following the agpl-3.0 license. Possible usage includes

  • Safe deployment of models which have the potential to generate harmful content.
  • Probing and understanding the limitations and biases of generative models.
  • Generation of artworks and use in design and other artistic processes.
  • Applications in educational or creative tools.
  • Research on generative models.

Excluded uses are described below.

Misuse, Malicious Use, and Out-of-Scope Use

The model should not be used to intentionally create or disseminate images that create hostile or alienating environments for people. This includes generating images that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.

Out-of-Scope Use

The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.

Misuse and Malicious Use

Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:

  • Generating demeaning, dehumanizing, or otherwise harmful representations of people or their environments, cultures, religions, etc.
  • Intentionally promoting or propagating discriminatory content or harmful stereotypes.
  • Impersonating individuals without their consent.
  • Sexual content without consent of the people who might see it.
  • Mis- and disinformation
  • Representations of egregious violence and gore
  • Sharing of copyrighted or licensed material in violation of its terms of use.
  • Sharing content that is an alteration of copyrighted or licensed material in violation of its terms of use.