Unverified Commit 568b73fd authored by Tianlei Wu's avatar Tianlei Wu Committed by GitHub
Browse files

Fix stable diffusion onnx pipeline error when batch_size > 1 (#2366)

fix safety_checker for batch_size > 1
parent 8e1cae5d
......@@ -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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment