From 60a9ea76f4c5b524e21c18d05151c4167149a31c Mon Sep 17 00:00:00 2001 From: Daniel Gu Date: Tue, 26 Dec 2023 13:17:30 -0800 Subject: [PATCH] Use DDPMScheduler instead of DDIMScheduler for noise_scheduler since PR #6305 has been merged. --- examples/add/train_add_distill_sd_wds.py | 6 +++--- examples/add/train_add_distill_sdxl_wds.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/add/train_add_distill_sd_wds.py b/examples/add/train_add_distill_sd_wds.py index 0bcd3825a981..4927b79b2d2b 100644 --- a/examples/add/train_add_distill_sd_wds.py +++ b/examples/add/train_add_distill_sd_wds.py @@ -57,7 +57,7 @@ import diffusers from diffusers import ( AutoencoderKL, - DDIMScheduler, + DDPMScheduler, StableDiffusionPipeline, UNet2DConditionModel, ) @@ -1119,12 +1119,12 @@ def main(args): # 1. Create the noise scheduler and the desired noise schedule. # Enforce zero terminal SNR (see section 3.1 of ADD paper) - teacher_scheduler = DDIMScheduler.from_pretrained( + teacher_scheduler = DDPMScheduler.from_pretrained( args.pretrained_teacher_model, subfolder="scheduler", revision=args.teacher_revision ) if not teacher_scheduler.config.rescale_betas_zero_snr: teacher_scheduler.config["rescale_betas_zero_snr"] = True - noise_scheduler = DDIMScheduler(**teacher_scheduler.config) + noise_scheduler = DDPMScheduler(**teacher_scheduler.config) # DDIMScheduler calculates the alpha and sigma noise schedules (based on the alpha bars) for us alpha_schedule = torch.sqrt(noise_scheduler.alphas_cumprod) diff --git a/examples/add/train_add_distill_sdxl_wds.py b/examples/add/train_add_distill_sdxl_wds.py index 3d8a4bf04724..8eda39ce47a2 100644 --- a/examples/add/train_add_distill_sdxl_wds.py +++ b/examples/add/train_add_distill_sdxl_wds.py @@ -57,7 +57,7 @@ import diffusers from diffusers import ( AutoencoderKL, - DDIMScheduler, + DDPMScheduler, StableDiffusionXLPipeline, UNet2DConditionModel, ) @@ -1177,12 +1177,12 @@ def main(args): # 1. Create the noise scheduler and the desired noise schedule. # Enforce zero terminal SNR (see section 3.1 of ADD paper) - teacher_scheduler = DDIMScheduler.from_pretrained( + teacher_scheduler = DDPMScheduler.from_pretrained( args.pretrained_teacher_model, subfolder="scheduler", revision=args.teacher_revision ) if not teacher_scheduler.config.rescale_betas_zero_snr: teacher_scheduler.config["rescale_betas_zero_snr"] = True - noise_scheduler = DDIMScheduler(**teacher_scheduler.config) + noise_scheduler = DDPMScheduler(**teacher_scheduler.config) # DDPMScheduler calculates the alpha and sigma noise schedules (based on the alpha bars) for us alpha_schedule = torch.sqrt(noise_scheduler.alphas_cumprod)