Update app.py
Browse files
app.py
CHANGED
@@ -31,10 +31,13 @@ def generate(image_editor, prompt, neg_prompt, strength, guidance):
|
|
31 |
image = image_editor['background'].convert('RGB')
|
32 |
image.thumbnail((1024, 1024))
|
33 |
image = divisible_by_8(image)
|
34 |
-
|
35 |
|
36 |
layer = image_editor["layers"][0].resize(image.size)
|
37 |
-
|
|
|
|
|
|
|
38 |
|
39 |
mask = Image.new("RGBA", image.size, "WHITE")
|
40 |
mask.paste(layer, (0, 0), layer)
|
|
|
31 |
image = image_editor['background'].convert('RGB')
|
32 |
image.thumbnail((1024, 1024))
|
33 |
image = divisible_by_8(image)
|
34 |
+
|
35 |
|
36 |
layer = image_editor["layers"][0].resize(image.size)
|
37 |
+
|
38 |
+
image = squarify_image(image)
|
39 |
+
layer = squarify_image(layer).convert('RGBA')
|
40 |
+
|
41 |
|
42 |
mask = Image.new("RGBA", image.size, "WHITE")
|
43 |
mask.paste(layer, (0, 0), layer)
|