File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
pipelines/stable_diffusion Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ def __call__(
96
96
97
97
self .scheduler .set_timesteps (num_inference_steps , ** extra_set_kwargs )
98
98
99
+ # if we use LMSDiscreteScheduler, let's make sure latents are mulitplied by sigmas
100
+ if isinstance (self .scheduler , LMSDiscreteScheduler ):
101
+ latents = latents * self .scheduler .sigmas [0 ]
102
+
99
103
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
100
104
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.
101
105
# eta corresponds to η in DDIM paper: https://arxiv.org/abs/2010.02502
@@ -105,10 +109,6 @@ def __call__(
105
109
if accepts_eta :
106
110
extra_step_kwargs ["eta" ] = eta
107
111
108
- self .scheduler .set_timesteps (num_inference_steps )
109
- if isinstance (self .scheduler , LMSDiscreteScheduler ):
110
- latents = latents * self .scheduler .sigmas [0 ]
111
-
112
112
for i , t in tqdm (enumerate (self .scheduler .timesteps )):
113
113
# expand the latents if we are doing classifier free guidance
114
114
latent_model_input = torch .cat ([latents ] * 2 ) if do_classifier_free_guidance else latents
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ def __init__(
36
36
tensor_format = "pt" ,
37
37
):
38
38
"""
39
- Linear Multistep Scheduler for discrete beta schedules.
40
- Based on the original k-diffusion implementation by Katherine Crowson:
39
+ Linear Multistep Scheduler for discrete beta schedules. Based on the original k-diffusion implementation by
40
+ Katherine Crowson:
41
41
https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L181
42
42
"""
43
43
You can’t perform that action at this time.
0 commit comments