1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

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

fix safety_checker for batch_size > 1
This commit is contained in:
Tianlei Wu
2023-02-16 14:57:33 -08:00
committed by GitHub
parent 8e1cae5d66
commit 568b73fdf8

View File

@@ -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(