Skip to content

SingleZombie/AFLDM

Repository files navigation

[CVPR 2025] Alias-free Latent Diffusion Models

Yifan Zhou1 Zeqi Xiao1 Shuai Yang2 Xingang Pan1
1S-Lab, Nanyang Technological University,
2Wangxuan Institute of Computer Technology, Peking University

Official PyTorch implementation of Alias-free latent diffusion models.

Motivation

teaser_video.mp4

We found the VAE and denoising network in LDM are not equivariant to fractional shifts. We propose an alias-free framework to improve the fractional shift equivariance of LDM. We demonstrate the effectiveness of our method in various applications, including video editing, frame interpolation, super-resolution and normal estimation.

TODO

  • Chinese blog posts
  • Refine documents
  • Training scripts

Update

  • [12/2025]: Training code relased.
  • [03/2025]: Repository created.

Installation

  1. Clone the repository. (Don't forget --recursive. Otherwise, please run git submodule update --init --recursive)
git clone [email protected]:SingleZombie/AFLDM.git --recursive
cd AFLDM
pip install -e .
  1. Install PyTorch in your Python environment.

  2. Install pip libraries.

pip install -r requirements.txt

Inference

All the detailed commands are shown inside .sh files.

Unconditional Generation Shift

bash shift_ldm_ffhq.sh

Video Editing

Due to the limitation of our computation resource, the finetuned alias-free Stable Diffusion has a poor generation capacity. It can only perform simple editing.

bash video_editing.sh

Image Interpolation

bash image_interpolation.sh

Super-resolution Shift

This is not a blind SR. The degradation function is fixed.

bash shift_ldm_sr.sh

Normal Estimation Shift

bash shift_normal_estimation.sh

Training

ImageNet Dataset

Download ImageNet (ILSVRC2012_img_train.tar) and extract the sub files. The organization of directory should be like:

train
β”œβ”€β”€ n01440764
└── n01443537
...

Alias-free VAE

  1. Update train_data_dir with your ImageNet path in configs/vae/train_afvae_imagenet.json.

  2. Run script. bash train_afvae.sh

Alias-free LDM

  1. Run script. bash train_afldm.sh

  2. Update path in scripts/shift_ldm_ffhq.py with train_ckpt/ffhq_uncond_afldm (the default output diretory set in configs/ldm/train_unet_ffhq.json). Run the script bash shift_ldm_ffhq.sh to test the results.

Alias-free Latent I2SB Super Resolution

  1. Update train_data_dir with your ImageNet path in configs/sr/train_i2sb_imagenet.json.

  2. Run script. bash train_af_i2sb_sr.sh

  3. Update path in scripts/shift_ldm_sr.py with train_ckpt/imagenet_sr_i2sb (the default output diretory set in configs/sr/train_i2sb_imagenet.json). Run the script bash shift_ldm_sr.sh to test the results.

Citation

@inproceedings{zhou2025afldm,
      title={Alias-Free Latent Diffusion Models: Improving Fractional Shift Equivariance of Diffusion Latent Space},
      author={Zhou, Yifan and Xiao, Zeqi and Yang, Shuai and Pan, Xingang },
      booktitle = {CVPR},
      year = {2025},
    }

Acknowledgements

About

[CVPR 2025 Oral] Alias-free Latent Diffusion Models (official implementation)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published