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
568b73fd
Unverified
Commit
568b73fd
authored
Feb 16, 2023
by
Tianlei Wu
Committed by
GitHub
Feb 16, 2023
Browse files
Fix stable diffusion onnx pipeline error when batch_size > 1 (#2366)
fix safety_checker for batch_size > 1
parent
8e1cae5d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
3 deletions
+0
-3
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py
...elines/stable_diffusion/pipeline_onnx_stable_diffusion.py
+0
-3
No files found.
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py
View file @
568b73fd
...
...
@@ -303,9 +303,6 @@ class OnnxStableDiffusionPipeline(DiffusionPipeline):
self
.
numpy_to_pil
(
image
),
return_tensors
=
"np"
).
pixel_values
.
astype
(
image
.
dtype
)
image
,
has_nsfw_concepts
=
self
.
safety_checker
(
clip_input
=
safety_checker_input
,
images
=
image
)
# There will throw an error if use safety_checker batchsize>1
images
,
has_nsfw_concept
=
[],
[]
for
i
in
range
(
image
.
shape
[
0
]):
image_i
,
has_nsfw_concept_i
=
self
.
safety_checker
(
...
...
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