Skip to content

Commit

Permalink
[FlaxStableDiffusionPipeline] fix bug when nsfw is detected (#832)
Browse files Browse the repository at this point in the history
fix nsfw bug
  • Loading branch information
patil-suraj authored Oct 13, 2022
1 parent 0679d09 commit effe9d6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ def __call__(
# block images
if any(has_nsfw_concept):
for i, is_nsfw in enumerate(has_nsfw_concept):
images[i] = np.asarray(images_uint8_casted[i])
if is_nsfw:
images[i] = np.asarray(images_uint8_casted[i])

images = images.reshape(num_devices, batch_size, height, width, 3)
else:
Expand Down

1 comment on commit effe9d6

@pcuenca
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Very cool you found it so quick @patil-suraj @patrickvonplaten !

Please sign in to comment.