Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
3228eb16
Unverified
Commit
3228eb16
authored
Aug 11, 2022
by
Suraj Patil
Committed by
GitHub
Aug 11, 2022
Browse files
allow pndm scheduler to be used with ldm pipeline (#165)
parent
c1488ff3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py
...s/pipelines/latent_diffusion/pipeline_latent_diffusion.py
+1
-1
src/diffusers/schedulers/scheduling_pndm.py
src/diffusers/schedulers/scheduling_pndm.py
+1
-0
No files found.
src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py
View file @
3228eb16
...
...
@@ -79,7 +79,7 @@ class LDMTextToImagePipeline(DiffusionPipeline):
noise_pred
=
noise_pred_uncond
+
guidance_scale
*
(
noise_prediction_text
-
noise_pred_uncond
)
# compute the previous noisy sample x_t -> x_t-1
latents
=
self
.
scheduler
.
step
(
noise_pred
,
t
,
latents
,
eta
)[
"prev_sample"
]
latents
=
self
.
scheduler
.
step
(
noise_pred
,
t
,
latents
,
eta
=
eta
)[
"prev_sample"
]
# scale and decode the image latents with vae
latents
=
1
/
0.18215
*
latents
...
...
src/diffusers/schedulers/scheduling_pndm.py
View file @
3228eb16
...
...
@@ -116,6 +116,7 @@ class PNDMScheduler(SchedulerMixin, ConfigMixin):
model_output
:
Union
[
torch
.
FloatTensor
,
np
.
ndarray
],
timestep
:
int
,
sample
:
Union
[
torch
.
FloatTensor
,
np
.
ndarray
],
**
kwargs
,
):
if
self
.
counter
<
len
(
self
.
prk_timesteps
):
return
self
.
step_prk
(
model_output
=
model_output
,
timestep
=
timestep
,
sample
=
sample
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment