This is the official PyTorch implementation of Consistency Posterior Sampling for Diverse Image Synthesis [Paper]
conda create -n cps_diverse python=3.11 -y
conda activate cps_diverse
pip install -r requirements.txtDownload pretrained diffusion and consistency models from following links and place them in 'pretrained_models' folder -
| Dataset | Diffusion Model | Consistency Model |
|---|---|---|
| LSUN-Bedroom | LSUN-Bedroom-DM | LSUN-Bedroom-CM |
| ImageNet | ImageNet-DM | ImageNet-CM |
Download datasets from OpenAI repo and place them in 'sample_dataset' folder.
#------------------------------------ LSUN-Beadroom (256 x 256) ------------------------------------
## 8x Super-Resolution
CPS_Diverse/scripts/fidelity_exps/solve_SR_our_method_CD_LPIPS_8x_one_step.sh
CPS_Diverse/scripts/fidelity_exps/solve_SR_our_method_CD_LPIPS_8x_multi_step.sh
## Gaussian Deblur
CPS_Diverse/scripts/fidelity_exps/solve_GD_our_method_CD_LPIPS_one_step.sh
CPS_Diverse/scripts/fidelity_exps/solve_GD_our_method_CD_LPIPS_multi_step.sh
## Random pixel inpainting (10%)
CPS_Diverse/scripts/fidelity_exps/solve_pixel_inpaint_our_method_CD_LPIPS_10_one_step.sh
CPS_Diverse/scripts/fidelity_exps/solve_pixel_inpaint_our_method_CD_LPIPS_10_multi_step.sh
#------------------------------------ ImageNet (64 x 64) ------------------------------------
## 4x Super-Resolution
CPS_Diverse/scripts/fidelity_exps/solve_SR_our_method_CD_LPIPS_4x_one_step.sh
CPS_Diverse/scripts/fidelity_exps/solve_SR_our_method_CD_LPIPS_4x_multi_step.sh
## Gaussian Deblur
CPS_Diverse/scripts/fidelity_exps/solve_ImNet_GD_our_method_CD_LPIPS_one_step.sh
CPS_Diverse/scripts/fidelity_exps/solve_ImNet_GD_our_method_CD_LPIPS_multi_step.sh
## Random pixel inpainting (20%)
CPS_Diverse/scripts/fidelity_exps/solve_pixel_inpaint_our_method_CD_LPIPS_20_one_step.sh
CPS_Diverse/scripts/fidelity_exps/solve_pixel_inpaint_our_method_CD_LPIPS_20_multi_step.sh
# LSUN-Beadroom (256 x 256)
## 8x Super-Resolution
CPS_Diverse/scripts/diversity_exps/solve_SR_our_method_CD_LPIPS_8x_one_step.sh
CPS_Diverse/scripts/diversity_exps/solve_SR_our_method_CD_LPIPS_8x_multi_step.sh
## Gaussian Deblur
CPS_Diverse/scripts/diversity_exps/solve_GD_our_method_CD_LPIPS_one_step.sh
CPS_Diverse/scripts/diversity_exps/solve_GD_our_method_CD_LPIPS_multi_step.sh
## Random pixel inpainting (10%)
CPS_Diverse/scripts/diversity_exps/solve_pixel_inpaint_our_method_CD_LPIPS_10_one_step.sh
CPS_Diverse/scripts/diversity_exps/solve_pixel_inpaint_our_method_CD_LPIPS_10_multi_step.sh
Thanks for open source efforts Cosistency Models codebase. Our code is also built using DPS.
