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
OpenDAS
diffusers
Commits
c91272d6
Unverified
Commit
c91272d6
authored
Aug 08, 2023
by
Dhruv Nair
Committed by
GitHub
Aug 08, 2023
Browse files
fix indexing issue in sd reference pipeline (#4531)
parent
f0725c58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
examples/community/stable_diffusion_reference.py
examples/community/stable_diffusion_reference.py
+1
-2
No files found.
examples/community/stable_diffusion_reference.py
View file @
c91272d6
...
@@ -153,8 +153,6 @@ class StableDiffusionReferencePipeline(StableDiffusionPipeline):
...
@@ -153,8 +153,6 @@ class StableDiffusionReferencePipeline(StableDiffusionPipeline):
)
)
ref_image_latents
=
ref_image_latents
.
repeat
(
batch_size
//
ref_image_latents
.
shape
[
0
],
1
,
1
,
1
)
ref_image_latents
=
ref_image_latents
.
repeat
(
batch_size
//
ref_image_latents
.
shape
[
0
],
1
,
1
,
1
)
ref_image_latents
=
torch
.
cat
([
ref_image_latents
]
*
2
)
if
do_classifier_free_guidance
else
ref_image_latents
# aligning device to prevent device errors when concating it with the latent model input
# aligning device to prevent device errors when concating it with the latent model input
ref_image_latents
=
ref_image_latents
.
to
(
device
=
device
,
dtype
=
dtype
)
ref_image_latents
=
ref_image_latents
.
to
(
device
=
device
,
dtype
=
dtype
)
return
ref_image_latents
return
ref_image_latents
...
@@ -733,6 +731,7 @@ class StableDiffusionReferencePipeline(StableDiffusionPipeline):
...
@@ -733,6 +731,7 @@ class StableDiffusionReferencePipeline(StableDiffusionPipeline):
1
,
1
,
),
),
)
)
ref_xt
=
torch
.
cat
([
ref_xt
]
*
2
)
if
do_classifier_free_guidance
else
ref_xt
ref_xt
=
self
.
scheduler
.
scale_model_input
(
ref_xt
,
t
)
ref_xt
=
self
.
scheduler
.
scale_model_input
(
ref_xt
,
t
)
MODE
=
"write"
MODE
=
"write"
...
...
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