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
3dd54017
Unverified
Commit
3dd54017
authored
Aug 26, 2023
by
Zijian He
Committed by
GitHub
Aug 25, 2023
Browse files
fix bug of progress bar in clip guided images mixing (#4729)
parent
b3b2d30c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/community/clip_guided_images_mixing_stable_diffusion.py
...s/community/clip_guided_images_mixing_stable_diffusion.py
+2
-1
No files found.
examples/community/clip_guided_images_mixing_stable_diffusion.py
View file @
3dd54017
...
@@ -408,7 +408,7 @@ class CLIPGuidedImagesMixingStableDiffusion(DiffusionPipeline):
...
@@ -408,7 +408,7 @@ class CLIPGuidedImagesMixingStableDiffusion(DiffusionPipeline):
if
accepts_generator
:
if
accepts_generator
:
extra_step_kwargs
[
"generator"
]
=
generator
extra_step_kwargs
[
"generator"
]
=
generator
with
self
.
progress_bar
(
total
=
num_inference_steps
):
with
self
.
progress_bar
(
total
=
num_inference_steps
)
as
progress_bar
:
for
i
,
t
in
enumerate
(
timesteps
):
for
i
,
t
in
enumerate
(
timesteps
):
# expand the latents if we are doing classifier free guidance
# expand the latents if we are doing classifier free guidance
latent_model_input
=
torch
.
cat
([
latents
]
*
2
)
if
do_classifier_free_guidance
else
latents
latent_model_input
=
torch
.
cat
([
latents
]
*
2
)
if
do_classifier_free_guidance
else
latents
...
@@ -440,6 +440,7 @@ class CLIPGuidedImagesMixingStableDiffusion(DiffusionPipeline):
...
@@ -440,6 +440,7 @@ class CLIPGuidedImagesMixingStableDiffusion(DiffusionPipeline):
# compute the previous noisy sample x_t -> x_t-1
# compute the previous noisy sample x_t -> x_t-1
latents
=
self
.
scheduler
.
step
(
noise_pred
,
t
,
latents
,
**
extra_step_kwargs
).
prev_sample
latents
=
self
.
scheduler
.
step
(
noise_pred
,
t
,
latents
,
**
extra_step_kwargs
).
prev_sample
progress_bar
.
update
()
# Hardcode 0.18215 because stable-diffusion-2-base has not self.vae.config.scaling_factor
# Hardcode 0.18215 because stable-diffusion-2-base has not self.vae.config.scaling_factor
latents
=
1
/
0.18215
*
latents
latents
=
1
/
0.18215
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
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