tonyassi commited on
Commit
93b65f4
1 Parent(s): d040427

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
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