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
cac7adab
Unverified
Commit
cac7adab
authored
Sep 27, 2023
by
Patrick von Platen
Committed by
GitHub
Sep 27, 2023
Browse files
[Flax SDXL] fix zero out sdxl (#5203)
parent
a584d42c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/diffusers/pipelines/stable_diffusion_xl/pipeline_flax_stable_diffusion_xl.py
.../stable_diffusion_xl/pipeline_flax_stable_diffusion_xl.py
+4
-3
No files found.
src/diffusers/pipelines/stable_diffusion_xl/pipeline_flax_stable_diffusion_xl.py
View file @
cac7adab
...
@@ -188,9 +188,10 @@ class FlaxStableDiffusionXLPipeline(FlaxDiffusionPipeline):
...
@@ -188,9 +188,10 @@ class FlaxStableDiffusionXLPipeline(FlaxDiffusionPipeline):
# Get unconditional embeddings
# Get unconditional embeddings
batch_size
=
prompt_embeds
.
shape
[
0
]
batch_size
=
prompt_embeds
.
shape
[
0
]
if
neg_prompt_ids
is
None
:
if
neg_prompt_ids
is
None
:
neg_prompt_ids
=
self
.
prepare_inputs
([
""
]
*
batch_size
)
neg_prompt_embeds
=
jnp
.
zeros_like
(
prompt_embeds
)
negative_pooled_embeds
=
jnp
.
zeros_like
(
pooled_embeds
)
neg_prompt_embeds
,
negative_pooled_embeds
=
self
.
get_embeddings
(
neg_prompt_ids
,
params
)
else
:
neg_prompt_embeds
,
negative_pooled_embeds
=
self
.
get_embeddings
(
neg_prompt_ids
,
params
)
add_time_ids
=
self
.
_get_add_time_ids
(
add_time_ids
=
self
.
_get_add_time_ids
(
(
height
,
width
),
(
0
,
0
),
(
height
,
width
),
prompt_embeds
.
shape
[
0
],
dtype
=
prompt_embeds
.
dtype
(
height
,
width
),
(
0
,
0
),
(
height
,
width
),
prompt_embeds
.
shape
[
0
],
dtype
=
prompt_embeds
.
dtype
...
...
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