Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def predict(prompt, source_img):
|
|
38 |
mask = resize(512, "data_mask.png")
|
39 |
mask.save("mask.png")
|
40 |
|
41 |
-
images_list = pipe([prompt] *
|
42 |
images = []
|
43 |
safe_image = Image.open(r"unsafe.png")
|
44 |
for i, image in enumerate(images_list["sample"]):
|
@@ -49,5 +49,6 @@ def predict(prompt, source_img):
|
|
49 |
return images
|
50 |
|
51 |
custom_css="style.css"
|
52 |
-
|
53 |
-
|
|
|
|
38 |
mask = resize(512, "data_mask.png")
|
39 |
mask.save("mask.png")
|
40 |
|
41 |
+
images_list = pipe([prompt] * 2, init_image=src, mask_image=mask, strength=0.75)
|
42 |
images = []
|
43 |
safe_image = Image.open(r"unsafe.png")
|
44 |
for i, image in enumerate(images_list["sample"]):
|
|
|
49 |
return images
|
50 |
|
51 |
custom_css="style.css"
|
52 |
+
title="InPainting Stable Diffusion CPU"
|
53 |
+
description="Inpainting Stable Diffusion example using CPU and HF token. <br />Warning: Slow process... ~5/10 min inference time. <b>NSFW filter enabled.</b><br /><span style="color:'red';">Please use 512*512 square image as input to avoid memory error </span>"
|
54 |
+
gr.Interface(fn=predict, inputs=["text", source_img], outputs=gallery, css=custom_css, title=title, description=description).launch(enable_queue=True)
|