Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -340,6 +340,10 @@ def preload_presets(target_ratio, ui_width, ui_height):
|
|
| 340 |
changed_width = 720
|
| 341 |
changed_height = 1280
|
| 342 |
return changed_width, changed_height, gr.update()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 343 |
elif target_ratio == "16:9":
|
| 344 |
changed_width = 1280
|
| 345 |
changed_height = 720
|
|
@@ -354,6 +358,8 @@ def preload_presets(target_ratio, ui_width, ui_height):
|
|
| 354 |
def select_the_right_preset(user_width, user_height):
|
| 355 |
if user_width == 720 and user_height == 1280:
|
| 356 |
return "9:16"
|
|
|
|
|
|
|
| 357 |
elif user_width == 1280 and user_height == 720:
|
| 358 |
return "16:9"
|
| 359 |
elif user_width == 1024 and user_height == 1024:
|
|
|
|
| 340 |
changed_width = 720
|
| 341 |
changed_height = 1280
|
| 342 |
return changed_width, changed_height, gr.update()
|
| 343 |
+
elif target_ratio == "2:3":
|
| 344 |
+
changed_width = 1024
|
| 345 |
+
changed_height = 1536
|
| 346 |
+
return changed_width, changed_height, gr.update()
|
| 347 |
elif target_ratio == "16:9":
|
| 348 |
changed_width = 1280
|
| 349 |
changed_height = 720
|
|
|
|
| 358 |
def select_the_right_preset(user_width, user_height):
|
| 359 |
if user_width == 720 and user_height == 1280:
|
| 360 |
return "9:16"
|
| 361 |
+
elif user_width == 1024 and user_height == 1536:
|
| 362 |
+
return "2:3"
|
| 363 |
elif user_width == 1280 and user_height == 720:
|
| 364 |
return "16:9"
|
| 365 |
elif user_width == 1024 and user_height == 1024:
|