Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -68,8 +68,9 @@ def inpaint(ip, image_editor, prompt, neg_prompt, width, height, ip_scale, stren
|
|
68 |
inpaint_pipeline.to("cuda")
|
69 |
print(image_editor)
|
70 |
image = image_editor['background'].convert('RGB')
|
71 |
-
mask = image_editor["layers"][0]
|
72 |
-
|
|
|
73 |
|
74 |
ip.thumbnail((1024, 1024))
|
75 |
image.thumbnail((1024, 1024))
|
|
|
68 |
inpaint_pipeline.to("cuda")
|
69 |
print(image_editor)
|
70 |
image = image_editor['background'].convert('RGB')
|
71 |
+
mask = Image.new("RGBA", image_editor["layers"][0].size, "WHITE")
|
72 |
+
mask.paste(image_editor["layers"][0], (0, 0), image_editor["layers"][0])
|
73 |
+
mask = ImageOps.invert(mask.convert('L'))
|
74 |
|
75 |
ip.thumbnail((1024, 1024))
|
76 |
image.thumbnail((1024, 1024))
|