Skip to content

Commit c872cbc

Browse files
committed
{DDIM,DDPM}Scheduler -> KarrasDiffusionSchedulers re: @patrickvonplaten
1 parent f35b2e8 commit c872cbc

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from ...models import AutoencoderKL, PriorTransformer, UNet2DConditionModel
2323
from ...models.embeddings import get_timestep_embedding
24-
from ...schedulers import DDIMScheduler, DDPMScheduler
24+
from ...schedulers import KarrasDiffusionSchedulers
2525
from ...utils import is_accelerate_available, logging, randn_tensor, replace_example_docstring
2626
from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
2727
from .stable_unclip_image_normalizer import StableUnCLIPImageNormalizer
@@ -62,12 +62,12 @@ class StableUnCLIPPipeline(DiffusionPipeline):
6262
Frozen text-encoder.
6363
prior ([`PriorTransformer`]):
6464
The canonincal unCLIP prior to approximate the image embedding from the text embedding.
65-
prior_scheduler ([`DDPMScheduler`]):
65+
prior_scheduler ([`KarrasDiffusionSchedulers`]):
6666
Scheduler used in the prior denoising process.
6767
image_normalizer ([`StableUnCLIPImageNormalizer`]):
6868
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
6969
embeddings after the noise has been applied.
70-
image_noising_scheduler ([`DDPMScheduler`]):
70+
image_noising_scheduler ([`KarrasDiffusionSchedulers`]):
7171
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
7272
by `noise_level` in `StableUnCLIPPipeline.__call__`.
7373
tokenizer (`CLIPTokenizer`):
@@ -76,7 +76,7 @@ class StableUnCLIPPipeline(DiffusionPipeline):
7676
text_encoder ([`CLIPTextModel`]):
7777
Frozen text-encoder.
7878
unet ([`UNet2DConditionModel`]): Conditional U-Net architecture to denoise the encoded image latents.
79-
scheduler ([`DDIMScheduler`]):
79+
scheduler ([`KarrasDiffusionSchedulers`]):
8080
A scheduler to be used in combination with `unet` to denoise the encoded image latents.
8181
vae ([`AutoencoderKL`]):
8282
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
@@ -86,17 +86,17 @@ class StableUnCLIPPipeline(DiffusionPipeline):
8686
prior_tokenizer: CLIPTokenizer
8787
prior_text_encoder: CLIPTextModelWithProjection
8888
prior: PriorTransformer
89-
prior_scheduler: DDPMScheduler
89+
prior_scheduler: KarrasDiffusionSchedulers
9090

9191
# image noising components
9292
image_normalizer: StableUnCLIPImageNormalizer
93-
image_noising_scheduler: DDPMScheduler
93+
image_noising_scheduler: KarrasDiffusionSchedulers
9494

9595
# regular denoising components
9696
tokenizer: CLIPTokenizer
9797
text_encoder: CLIPTextModel
9898
unet: UNet2DConditionModel
99-
scheduler: DDIMScheduler
99+
scheduler: KarrasDiffusionSchedulers
100100

101101
vae: AutoencoderKL
102102

@@ -106,15 +106,15 @@ def __init__(
106106
prior_tokenizer: CLIPTokenizer,
107107
prior_text_encoder: CLIPTextModelWithProjection,
108108
prior: PriorTransformer,
109-
prior_scheduler: DDPMScheduler,
109+
prior_scheduler: KarrasDiffusionSchedulers,
110110
# image noising components
111111
image_normalizer: StableUnCLIPImageNormalizer,
112-
image_noising_scheduler: DDPMScheduler,
112+
image_noising_scheduler: KarrasDiffusionSchedulers,
113113
# regular denoising components
114114
tokenizer: CLIPTokenizer,
115115
text_encoder: CLIPTextModelWithProjection,
116116
unet: UNet2DConditionModel,
117-
scheduler: DDIMScheduler,
117+
scheduler: KarrasDiffusionSchedulers,
118118
# vae
119119
vae: AutoencoderKL,
120120
):

src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from ...models import AutoencoderKL, UNet2DConditionModel
2525
from ...models.embeddings import get_timestep_embedding
26-
from ...schedulers import DDIMScheduler, DDPMScheduler
26+
from ...schedulers import KarrasDiffusionSchedulers
2727
from ...utils import logging, randn_tensor, replace_example_docstring
2828
from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput
2929
from .stable_unclip_image_normalizer import StableUnCLIPImageNormalizer
@@ -75,7 +75,7 @@ class StableUnCLIPImg2ImgPipeline(DiffusionPipeline):
7575
image_normalizer ([`StableUnCLIPImageNormalizer`]):
7676
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
7777
embeddings after the noise has been applied.
78-
image_noising_scheduler ([`DDPMScheduler`]):
78+
image_noising_scheduler ([`KarrasDiffusionSchedulers`]):
7979
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
8080
by `noise_level` in `StableUnCLIPPipeline.__call__`.
8181
tokenizer (`CLIPTokenizer`):
@@ -84,7 +84,7 @@ class StableUnCLIPImg2ImgPipeline(DiffusionPipeline):
8484
text_encoder ([`CLIPTextModel`]):
8585
Frozen text-encoder.
8686
unet ([`UNet2DConditionModel`]): Conditional U-Net architecture to denoise the encoded image latents.
87-
scheduler ([`DDIMScheduler`]):
87+
scheduler ([`KarrasDiffusionSchedulers`]):
8888
A scheduler to be used in combination with `unet` to denoise the encoded image latents.
8989
vae ([`AutoencoderKL`]):
9090
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
@@ -96,13 +96,13 @@ class StableUnCLIPImg2ImgPipeline(DiffusionPipeline):
9696

9797
# image noising components
9898
image_normalizer: StableUnCLIPImageNormalizer
99-
image_noising_scheduler: DDPMScheduler
99+
image_noising_scheduler: KarrasDiffusionSchedulers
100100

101101
# regular denoising components
102102
tokenizer: CLIPTokenizer
103103
text_encoder: CLIPTextModel
104104
unet: UNet2DConditionModel
105-
scheduler: DDIMScheduler
105+
scheduler: KarrasDiffusionSchedulers
106106

107107
vae: AutoencoderKL
108108

@@ -113,12 +113,12 @@ def __init__(
113113
image_encoder: CLIPVisionModelWithProjection,
114114
# image noising components
115115
image_normalizer: StableUnCLIPImageNormalizer,
116-
image_noising_scheduler: DDPMScheduler,
116+
image_noising_scheduler: KarrasDiffusionSchedulers,
117117
# regular denoising components
118118
tokenizer: CLIPTokenizer,
119119
text_encoder: CLIPTextModel,
120120
unet: UNet2DConditionModel,
121-
scheduler: DDIMScheduler,
121+
scheduler: KarrasDiffusionSchedulers,
122122
# vae
123123
vae: AutoencoderKL,
124124
):

0 commit comments

Comments
 (0)