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.
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.
- Chinese blog posts
- Refine documents
- Training scripts
- [12/2025]: Training code relased.
- [03/2025]: Repository created.
- 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 .-
Install PyTorch in your Python environment.
-
Install pip libraries.
pip install -r requirements.txtAll the detailed commands are shown inside .sh files.
bash shift_ldm_ffhq.shDue 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.shbash image_interpolation.shThis is not a blind SR. The degradation function is fixed.
bash shift_ldm_sr.shbash shift_normal_estimation.shDownload ImageNet (ILSVRC2012_img_train.tar) and extract the sub files. The organization of directory should be like:
train
βββ n01440764
βββ n01443537
...
-
Update
train_data_dirwith your ImageNet path inconfigs/vae/train_afvae_imagenet.json. -
Run script.
bash train_afvae.sh
-
Run script.
bash train_afldm.sh -
Update path in
scripts/shift_ldm_ffhq.pywithtrain_ckpt/ffhq_uncond_afldm(the default output diretory set inconfigs/ldm/train_unet_ffhq.json). Run the scriptbash shift_ldm_ffhq.shto test the results.
-
Update
train_data_dirwith your ImageNet path inconfigs/sr/train_i2sb_imagenet.json. -
Run script.
bash train_af_i2sb_sr.sh -
Update path in
scripts/shift_ldm_sr.pywithtrain_ckpt/imagenet_sr_i2sb(the default output diretory set inconfigs/sr/train_i2sb_imagenet.json). Run the scriptbash shift_ldm_sr.shto test the results.
@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},
}
- Diffusers: Our project is built on diffusers.
- GMFlow: Our flow estimator.
- StyleGAN3: For sharing alias-free module implementation.
- Alias-Free Convnets: For sharing alias-free module implementation.
- I2SB: For sharing SR implementation.
- StableNormal: For sharing normal estimation dataset.