ernestkam commited on
Commit
ba22741
·
1 Parent(s): 8119fee

Update UI and add 4:5

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -157,6 +157,8 @@ def get_image_size(aspect_ratio):
157
  return 1024, 688
158
  elif aspect_ratio == "2:3":
159
  return 688, 1024
 
 
160
  else:
161
  # Default to 1:1 if something goes wrong
162
  return 1024, 1024
@@ -170,7 +172,7 @@ def infer(
170
  aspect_ratio="1:1",
171
  guidance_scale=1.0,
172
  num_inference_steps=8,
173
- prompt_enhance=True,
174
  progress=gr.Progress(track_tqdm=True),
175
  ):
176
  """
@@ -258,6 +260,8 @@ with gr.Blocks(css=css) as demo:
258
  placeholder="Enter your prompt",
259
  container=False,
260
  )
 
 
261
  run_button = gr.Button("Run", scale=0, variant="primary")
262
 
263
  with gr.Accordion("Advanced Settings", open=False):
@@ -274,10 +278,10 @@ with gr.Blocks(css=css) as demo:
274
  with gr.Row():
275
  aspect_ratio = gr.Radio(
276
  label="Aspect ratio (width:height)",
277
- choices=["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
278
  value="16:9",
279
  )
280
- prompt_enhance = gr.Checkbox(label="Prompt Enhance", value=True)
281
 
282
  with gr.Row():
283
  guidance_scale = gr.Slider(
 
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:
163
  # Default to 1:1 if something goes wrong
164
  return 1024, 1024
 
172
  aspect_ratio="1:1",
173
  guidance_scale=1.0,
174
  num_inference_steps=8,
175
+ prompt_enhance=False,
176
  progress=gr.Progress(track_tqdm=True),
177
  ):
178
  """
 
260
  placeholder="Enter your prompt",
261
  container=False,
262
  )
263
+
264
+ with gr.Row():
265
  run_button = gr.Button("Run", scale=0, variant="primary")
266
 
267
  with gr.Accordion("Advanced Settings", open=False):
 
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
 
286
  with gr.Row():
287
  guidance_scale = gr.Slider(