Skip to content

Commit

Permalink
fix safety check (open-mmlab#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
patil-suraj authored Aug 19, 2022
1 parent 65ea7d6 commit 89e9521
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diffusers/pipelines/stable_diffusion/safety_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def forward(self, clip_input, images):

result.append(result_img)

has_nsfw_concepts = [len(result[i]["bad_concepts"]) > 0 or i in range(len(result))]
has_nsfw_concepts = [len(res["bad_concepts"]) > 0 for res in result]

for idx, has_nsfw_concept in enumerate(has_nsfw_concepts):
if has_nsfw_concept:
Expand Down

0 comments on commit 89e9521

Please sign in to comment.