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
effe9d66
Unverified
Commit
effe9d66
authored
Oct 13, 2022
by
Suraj Patil
Committed by
GitHub
Oct 13, 2022
Browse files
[FlaxStableDiffusionPipeline] fix bug when nsfw is detected (#832)
fix nsfw bug
parent
0679d090
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py
...elines/stable_diffusion/pipeline_flax_stable_diffusion.py
+2
-1
No files found.
src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py
View file @
effe9d66
...
...
@@ -291,6 +291,7 @@ class FlaxStableDiffusionPipeline(FlaxDiffusionPipeline):
# block images
if
any
(
has_nsfw_concept
):
for
i
,
is_nsfw
in
enumerate
(
has_nsfw_concept
):
if
is_nsfw
:
images
[
i
]
=
np
.
asarray
(
images_uint8_casted
[
i
])
images
=
images
.
reshape
(
num_devices
,
batch_size
,
height
,
width
,
3
)
...
...
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