Spaces:
Running
on
Zero
Running
on
Zero
Removed 4:5 and updated resolution
Browse files
app.py
CHANGED
@@ -144,19 +144,19 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
144 |
def get_image_size(aspect_ratio):
|
145 |
"""Converts aspect ratio string to width, height tuple, optimized for 1024 base."""
|
146 |
if aspect_ratio == "1:1":
|
147 |
-
return
|
148 |
elif aspect_ratio == "16:9":
|
149 |
-
return
|
150 |
elif aspect_ratio == "9:16":
|
151 |
-
return
|
152 |
elif aspect_ratio == "4:3":
|
153 |
-
return
|
154 |
elif aspect_ratio == "3:4":
|
155 |
-
return
|
156 |
elif aspect_ratio == "3:2":
|
157 |
-
return
|
158 |
elif aspect_ratio == "2:3":
|
159 |
-
return
|
160 |
elif aspect_ratio == "4:5":
|
161 |
return 1024, 1280
|
162 |
else:
|
@@ -278,8 +278,8 @@ with gr.Blocks(css=css) as demo:
|
|
278 |
with gr.Row():
|
279 |
aspect_ratio = gr.Radio(
|
280 |
label="Aspect ratio (width:height)",
|
281 |
-
choices=["
|
282 |
-
value="
|
283 |
)
|
284 |
prompt_enhance = gr.Checkbox(label="Prompt Enhance", value=False)
|
285 |
|
|
|
144 |
def get_image_size(aspect_ratio):
|
145 |
"""Converts aspect ratio string to width, height tuple, optimized for 1024 base."""
|
146 |
if aspect_ratio == "1:1":
|
147 |
+
return 1328, 1328
|
148 |
elif aspect_ratio == "16:9":
|
149 |
+
return 1664, 928
|
150 |
elif aspect_ratio == "9:16":
|
151 |
+
return 928, 1664
|
152 |
elif aspect_ratio == "4:3":
|
153 |
+
return 1472, 1104
|
154 |
elif aspect_ratio == "3:4":
|
155 |
+
return 1104, 1472
|
156 |
elif aspect_ratio == "3:2":
|
157 |
+
return 1584, 1056
|
158 |
elif aspect_ratio == "2:3":
|
159 |
+
return 1056, 1584
|
160 |
elif aspect_ratio == "4:5":
|
161 |
return 1024, 1280
|
162 |
else:
|
|
|
278 |
with gr.Row():
|
279 |
aspect_ratio = gr.Radio(
|
280 |
label="Aspect ratio (width:height)",
|
281 |
+
choices=["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
|
282 |
+
value="3:4",
|
283 |
)
|
284 |
prompt_enhance = gr.Checkbox(label="Prompt Enhance", value=False)
|
285 |
|