/ACT

Primary LanguagePythonApache License 2.0Apache-2.0

ACT-Diffusion: Efficient Adversarial Consistency Training for One-step Diffusion Models

Download checkpoint

We provide the checkpoint reported in our paper.

Download CIFAR10 checkpoint from cifar10_fid_6_0.ckpt.

Download ImageNet 64x64 checkpoint from imagenet_fid_10_6.ckpt.

Download LSUNCAT 256x256 checkpoint from lsun256_fid_13_0.ckpt.

Install environment

Using code below to install the package.

pip install -r requirements.txt

Evaluation

CIFAR10

You can use the following code to run evaluation on CIFAR10:

python train_cifar10.py --dataset_path your_dataset_path --resume-from checkpoint_path --mode eval

ImageNet 64x64

To evaluation ImageNet 64x64, you need first download the reference batch from guided-diffusion/evaluations or one_driver.

python train_imagenet64.py --dataset_path your_dataset_path --resume-from checkpoint_file --fid_path reference_batch_file --mode eval

Sample

CIFAR10

You can use the following code to run evaluation on CIFAR10:

python train_cifar10.py --dataset_path your_dataset_path --resume-from checkpoint_path --mode sample

ImageNet 64x64

python train_imagenet64.py --dataset_path your_dataset_path --resume-from checkpoint_file --mode sample

LSUNCAT 256x256

python lsun_cat_256.py --dataset_path your_dataset_path --resume-from checkpoint_file --mode sample

Train

CIFAR10

You can use the following code to run evaluation on CIFAR10:

python train_cifar10.py --dataset_path your_dataset_path --resume-from checkpoint_path --mode train --ckpt_path save_path --device gpu_num

ImageNet 64x64

To train ImageNet 64x64, you need first download the reference batch from guided-diffusion/evaluations or one_driver. (for period evaluation)

python train_imagenet64.py --dataset_path your_dataset_path --resume-from checkpoint_file --mode train --fid_path reference_batch_file --ckpt_path save_path --device gpu_num

LSUN CAT 256x256

python lsun_cat_256.py --dataset_path your_dataset_path --resume-from checkpoint_file --mode train --fid_path reference_batch_file --ckpt_path save_path --device gpu_num

Convert ImageNet 64x64 dataset

You need to download ImageNet 64x64 dataset with format .npz from ImageNet.

Run code below:

python convert_imagenet_lmdb.py --path_lmdb dataset_to_save --dataset_path npz_path