Update app.py
Browse files
app.py
CHANGED
@@ -59,6 +59,15 @@ def generate(image_editor, prompt, neg_prompt, versions):
|
|
59 |
image=image,
|
60 |
mask_image=mask).images[0]
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
# Crop image to original aspect ratio
|
63 |
final_image = final_image.crop((0, 0, original_image_size[0], original_image_size[1]))
|
64 |
|
|
|
59 |
image=image,
|
60 |
mask_image=mask).images[0]
|
61 |
|
62 |
+
|
63 |
+
if (original_image_size[0] > original_image_size[1]):
|
64 |
+
original_image_size[0] = original_image_size[0] * (1024/original_image_size[0])
|
65 |
+
original_image_size[1] = original_image_size[1] * (1024/original_image_size[0])
|
66 |
+
else:
|
67 |
+
original_image_size[0] = original_image_size[0] * (1024/original_image_size[1])
|
68 |
+
original_image_size[1] = original_image_size[1] * (1024/original_image_size[1])
|
69 |
+
|
70 |
+
|
71 |
# Crop image to original aspect ratio
|
72 |
final_image = final_image.crop((0, 0, original_image_size[0], original_image_size[1]))
|
73 |
|