Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def resize(value,img):
|
|
16 |
return img
|
17 |
|
18 |
def predict(source_img, prompt):
|
19 |
-
imageio.imwrite("data.png", source_img[
|
20 |
imageio.imwrite("data_mask.png", source_img["mask"])
|
21 |
src = resize(768, "data.png")
|
22 |
src.save("src.png")
|
@@ -25,10 +25,9 @@ def predict(source_img, prompt):
|
|
25 |
image = pipe(prompt=prompt, image=src, mask_image=mask, num_inference_steps=4, strength=0.5, guidance_scale=0.0).images[0]
|
26 |
return image
|
27 |
|
28 |
-
simage = gr.ImageEditor(sources=("upload"), brush=gr.Brush(colors=["#000000"]), label='Source Image')
|
29 |
title="SDXL Turbo Inpainting CPU"
|
30 |
description="Inpainting with SDXL Turbo <br><br> <b>Please use square .png image as input, 512x512, 768x768, or 1024x1024</b>"
|
31 |
-
gr.Interface(fn=predict, inputs=[
|
32 |
gr.Textbox(label='What you want the AI to Generate, 77 Token limit')],
|
33 |
outputs='image',
|
34 |
title=title,
|
|
|
16 |
return img
|
17 |
|
18 |
def predict(source_img, prompt):
|
19 |
+
imageio.imwrite("data.png", source_img["image"])
|
20 |
imageio.imwrite("data_mask.png", source_img["mask"])
|
21 |
src = resize(768, "data.png")
|
22 |
src.save("src.png")
|
|
|
25 |
image = pipe(prompt=prompt, image=src, mask_image=mask, num_inference_steps=4, strength=0.5, guidance_scale=0.0).images[0]
|
26 |
return image
|
27 |
|
|
|
28 |
title="SDXL Turbo Inpainting CPU"
|
29 |
description="Inpainting with SDXL Turbo <br><br> <b>Please use square .png image as input, 512x512, 768x768, or 1024x1024</b>"
|
30 |
+
gr.Interface(fn=predict, inputs=[gr.ImageEditor(sources=("upload"), brush=gr.Brush(colors=["#000000"]), label='Source Image'),
|
31 |
gr.Textbox(label='What you want the AI to Generate, 77 Token limit')],
|
32 |
outputs='image',
|
33 |
title=title,
|