ernestkam commited on
Commit
39901d7
·
1 Parent(s): ba22741

Removed 4:5 and updated resolution

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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 1024, 1024
148
  elif aspect_ratio == "16:9":
149
- return 1152, 640
150
  elif aspect_ratio == "9:16":
151
- return 640, 1152
152
  elif aspect_ratio == "4:3":
153
- return 1024, 768
154
  elif aspect_ratio == "3:4":
155
- return 768, 1024
156
  elif aspect_ratio == "3:2":
157
- return 1024, 688
158
  elif aspect_ratio == "2:3":
159
- return 688, 1024
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=["4:5", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
282
- value="16:9",
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