Spaces:
Runtime error
Runtime error
zwl
commited on
Commit
·
4d1940c
1
Parent(s):
f9bf5c9
fix bug
Browse files
app.py
CHANGED
@@ -151,8 +151,11 @@ def img_to_img(model_path, prompt, neg_prompt, img, strength, guidance, steps, w
|
|
151 |
|
152 |
def replace_nsfw_images(results):
|
153 |
for i in range(len(results.images)):
|
154 |
-
|
155 |
-
results.
|
|
|
|
|
|
|
156 |
return results.images[0]
|
157 |
|
158 |
css = """
|
|
|
151 |
|
152 |
def replace_nsfw_images(results):
|
153 |
for i in range(len(results.images)):
|
154 |
+
try:
|
155 |
+
if results.nsfw_content_detected[i]:
|
156 |
+
results.images[i] = Image.open("nsfw.png")
|
157 |
+
except:
|
158 |
+
pass
|
159 |
return results.images[0]
|
160 |
|
161 |
css = """
|