Update app.py
Browse files
app.py
CHANGED
@@ -24,20 +24,8 @@ source_img = gr.Image(source="upload", type="numpy")
|
|
24 |
gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
|
25 |
|
26 |
def infer(prompt, init_image):
|
27 |
-
|
28 |
-
|
29 |
-
#image = pipe(prompt, init_image=init_image)["sample"][0]
|
30 |
-
images_list = pipe([prompt] * 2, init_image=init_image, strength=0.75)
|
31 |
-
images = []
|
32 |
-
safe_image = Image.open(r"unsafe.png")
|
33 |
-
for i, image in enumerate(images_list["sample"]):
|
34 |
-
if(images_list["nsfw_content_detected"][i]):
|
35 |
-
images.append(safe_image)
|
36 |
-
else:
|
37 |
-
images.append(image)
|
38 |
-
|
39 |
-
return images
|
40 |
-
|
41 |
print("Great sylvain ! Everything is working fine !")
|
42 |
|
43 |
title="Stable Diffusion CPU"
|
|
|
24 |
gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[2], height="auto")
|
25 |
|
26 |
def infer(prompt, init_image):
|
27 |
+
print(init_image)
|
28 |
+
return init_image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
print("Great sylvain ! Everything is working fine !")
|
30 |
|
31 |
title="Stable Diffusion CPU"
|