Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

CycleDiff

> 编程语言
Open source

Code for TIP2026 paper: CycleDiff: Cycle Diffusion Models for Unpaired Image-to-image Translation

99 stars0 likes0 views
WebsiteGitHub

About

Code for TIP2026 paper: CycleDiff: Cycle Diffusion Models for Unpaired Image-to-image Translation

CycleDiff: CycleDiff: Cycle Diffusion Models for Unpaired Image-to-image Translation [ ]

Content

  • CycleDiff: CycleDiff: Cycle Diffusion Models for Unpaired Image-to-image Translation [ ]
    • Content
    • Installation
    • Train CycleDiff from scratch
      • 0. prepare dataset and the pretrained weight
      • 1. train VAE
      • 2. train ldm
      • 3. train cycle translator (supports Multi-GPU training)
    • Test CycleDiff
    • Acknowledgement
    • Contact
    • Citation

Installation

bash
conda create -n cyclediff python=3.9 && conda activate CycleDiff
git clone https://github.com/ZouShilong1024/CycleDiff.git && cd CycleDiff
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
pip install -r requirement.txt

Train CycleDiff from scratch

0. prepare dataset and the pretrained weight

The structure of the dataset should be as follows:

datasetA2B
|-- train
|   |-- class_A
|   |   |-- 0.png
|   |   |-- 1.png
|   |   |-- ...
|   |-- class_B
|   |   |-- 0.png
|   |   |-- 1.png
|   |   |-- ...
|-- test
|   |-- class_A
|   |   |-- 0.png
|   |   |-- 1.png
|   |   |-- ...
|   |-- class_B
|   |   |-- 0.png
|   |   |-- 1.png
|   |   |-- ...

Before starting training, 1. please modify the dataset paths in ./configs/{datasetA2B}/*.yaml. 2. download the pretrained weight at link and modify the ckpt_path on line 19 of ./configs/{datasetA2B}/*_ae_kl_256x256_d4.yaml.

1. train VAE

bash
accelerate launch train_vae.py --cfg ./configs/{datasetA2B}/{class_A}_ae_kl_256x256_d4.yaml
accelerate launch train_vae.py --cfg ./configs/{datasetA2B}/{class_B}_ae_kl_256x256_d4.yaml

2. train ldm

bash
accelerate launch train_uncond_ldm.py --cfg ./configs/{datasetA2B}/{class_A}_ddm_const4_ldm_unet6_114_ode_2.yaml
accelerate launch train_uncond_ldm.py --cfg ./configs/{datasetA2B}/{class_B}_ddm_const4_ldm_unet6_114_ode_2.yaml

3. train cycle translator (supports Multi-GPU training)

bash
# Single GPU
python train_uncond_ldm_cycle.py --cfg ./configs/{datasetA2B}/translation_C_disc_timestep_ode_2.yaml
# or
accelerate train_uncond_ldm_cycle.py --cfg ./configs/{datasetA2B}/translation_C_disc_timestep_ode_2.yaml
# Multi GPU
accelerate launch train_uncond_ldm_cycle_multi_gpu.py --cfg ./configs/{datasetA2B}/translation_C_disc_timestep_ode_2.yaml

Test CycleDiff

bash
accelerate launch translation_uncond_ldm_cycle.py --cfg ./configs/{datasetA2B}/translation_C_disc_timestep_ode_2.yaml

Acknowledgement

Our Code is based on ADM and CycleGAN.

Contact

If you have some questions, please contact [email protected].

Citation

@article{zou2025cyclediff,
  title={CycleDiff: Cycle Diffusion Models for Unpaired Image-to-image Translation},
  author={Zou, Shilong and Huang, Yuhang and Yi, Renjiao and Zhu, Chenyang and Xu, Kai},
  journal={arXiv preprint arXiv:2508.06625},
  year={2025}
}

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythoncomputer-visioncross-modality-translationcyclegandeep-learning

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言