X-modaler is a versatile and high-performance codebase for cross-modal analytics(e.g., image captioning, video captioning, vision-language pre-training, visual question answering, visual commonsense reasoning, and cross-modal retrieval).
Key parameters and specifications
Key parameters and specifications
Parameter
Value
Language
Jupyter Notebook
Category
Model Development
Subcategory
Architecture
Keywords
Diffusion
Stars
974
Forks
159
Contributors
3
Created date
2022-01-11
Updated date
2026-10-06
Stars in 1 day
0
Stars in 7 days
0
Rank
12,294
Previous rank
12,222
Rank change
-72
7-day stars rank
13,352
Previous 7-day stars rank
13,364
7-day stars rank change
12
Total stars rank
11,382
Previous total stars rank
11,366
Total stars rank change
-16
Country
USA
README summary
Official implementation of Diffusion Autoencoders A CVPR 2022 (ORAL) paper (paper, site, 5-min video): Usage Note: Since we expect a lot of changes on the codebase, please fork the repo before using. Prerequisites See Quick start A jupyter notebook. For unconditional generation: For manipulation: For interpolation: For autoencoding: Aligning your own images: 1. Result images will be available in directory Original in directory Aligned with Using Checkpoints We provide checkpoints for the following models: 1. DDIM: **FFHQ128** (72M, 130M
), **Bedroom128**, **Horse128** 2. DiffAE (autoencoding only): **FFHQ256**, **FFHQ128** (72M, 130M), **Bedroom128**, **Horse128** 3. DiffAE (with latent DPM, can sample): **FFHQ256**, **FFHQ128**, **Bedroom128**, **Horse128** 4. DiffAE's classifiers (for manipulation): **FFHQ256's latent on CelebAHQ**, **FFHQ128's latent on CelebAHQ** Checkpoints ought to be put into a separate directory . Download the checkpoints and put them into directory. It should look like this: LMDB Datasets We do not own any of the following datasets. We provide the LMDB ready-to-use dataset for the sake
of convenience. FFHQ CelebAHQ **Broken links** Note: I'm trying to recover the following links. CelebA LSUN Bedroom LSUN Horse The directory tree should be: You can also download from the original sources, and use our provided codes to package them as LMDB files. Original sources for each dataset is as follows: FFHQ ( CelebAHQ ( CelebA ( LSUN ( The conversion codes are provided as: Google drive: Training We provide scripts for training & evaluate DDIM and DiffAE (including latent DPM) on the following datasets
: FFHQ128, FFHQ256, Bedroom128, Horse128, Celeba64 (D2C's crop). Usually, the evaluation results (FID's) will be available in directory. Note: Most experiment requires at least 4x V100s during training the DPM models while requiring 1x 2080Ti during training the accompanying latent DPM. **FFHQ128** A classifier (for manipulation) can be trained using: **FFHQ256** We only trained the DiffAE due to high computation cost. After the task is done, you need to train the latent DPM (requiring only 1x 2080Ti) A classifier (for manipulation
) can be trained using: **Bedroom128** **Horse128** **Celeba64** This experiment can be run on 2080Ti's.
Frequently asked questions
How many stars and forks are recorded?
konpatp/diffae has 974 stars and 159 forks.
What is the repository rank?
konpatp/diffae is ranked 12,294.
What language and category are recorded?
konpatp/diffae has 974 stars, uses Jupyter Notebook and belongs to Model Development.
Which repository is closest in rank?
konpatp/diffae is compared with salesforce/OmniXAI, ranked 12,296 with 974 stars.
@inproceedings{preechakul2021diffusion,
title={Diffusion Autoencoders: Toward a Meaningful and Decodable Representation},
author={Preechakul, Konpat and Chatthee, Nattanat and Wizadwongsa, Suttisak and Suwajanakorn, Supasorn},
booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2022},
}
Usage
⚙️ Try a Colab walkthrough:
🤗 Try a web demo:
Note: Since we expect a lot of changes on the codebase, please fork the repo before using.
Prerequisites
See requirements.txt
pip install -r requirements.txt
Quick start
A jupyter notebook.
For unconditional generation: sample.ipynb
For manipulation: manipulate.ipynb
For interpolation: interpolate.ipynb
For autoencoding: autoencoding.ipynb
Aligning your own images:
Put images into the imgs directory
Run align.py (need to pip install dlib requests)
Result images will be available in imgs_align directory
Checkpoints ought to be put into a separate directory checkpoints.
Download the checkpoints and put them into checkpoints directory. It should look like this:
You can also download from the original sources, and use our provided codes to package them as LMDB files.
Original sources for each dataset is as follows:
We provide scripts for training & evaluate DDIM and DiffAE (including latent DPM) on the following datasets: FFHQ128, FFHQ256, Bedroom128, Horse128, Celeba64 (D2C's crop).
Usually, the evaluation results (FID's) will be available in eval directory.
Note: Most experiment requires at least 4x V100s during training the DPM models while requiring 1x 2080Ti during training the accompanying latent DPM.
FFHQ128
# diffae
python run_ffhq128.py
# ddim
python run_ffhq128_ddim.py
A classifier (for manipulation) can be trained using:
python run_ffhq128_cls.py
FFHQ256
We only trained the DiffAE due to high computation cost.
This requires 8x V100s.
sbatch run_ffhq256.py
After the task is done, you need to train the latent DPM (requiring only 1x 2080Ti)
python run_ffhq256_latent.py
A classifier (for manipulation) can be trained using:
python run_ffhq256_cls.py
Bedroom128
# diffae
python run_bedroom128.py
# ddim
python run_bedroom128_ddim.py
Horse128
# diffae
python run_horse128.py
# ddim
python run_horse128_ddim.py