huangrh9 commited on
Commit
2470160
·
verified ·
1 Parent(s): 5aa83ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -540,18 +540,24 @@ def update_resolution_dropdown(diffusion_enabled, current_resolution_str):
540
  if (new_h, new_w) not in DEFAULT_DIFFUSION_RESOLUTIONS:
541
  new_h, new_w = DEFAULT_DIFFUSION_RESOLUTIONS[0]
542
  new_value_str = f"{new_h}x{new_w}"
543
- return gr.Dropdown.update(
544
  choices=[f'{h}x{w}' for h, w in DEFAULT_DIFFUSION_RESOLUTIONS],
545
- value=new_value_str
 
 
 
546
  )
547
  else:
548
  new_h, new_w = int(current_h) // 2, int(current_w) // 2
549
  if (new_h, new_w) not in DEFAULT_RESOLUTIONS:
550
  new_h, new_w = DEFAULT_RESOLUTIONS[0]
551
  new_value_str = f"{new_h}x{new_w}"
552
- return gr.Dropdown.update(
553
  choices=[f'{h}x{w}' for h, w in DEFAULT_RESOLUTIONS],
554
- value=new_value_str
 
 
 
555
  )
556
 
557
 
 
540
  if (new_h, new_w) not in DEFAULT_DIFFUSION_RESOLUTIONS:
541
  new_h, new_w = DEFAULT_DIFFUSION_RESOLUTIONS[0]
542
  new_value_str = f"{new_h}x{new_w}"
543
+ return gr.Dropdown(
544
  choices=[f'{h}x{w}' for h, w in DEFAULT_DIFFUSION_RESOLUTIONS],
545
+ value=new_value_str,
546
+ label="Output Resolution (HxW)",
547
+ elem_id="resolution_dropdown",
548
+ info="Select target size for generated images."
549
  )
550
  else:
551
  new_h, new_w = int(current_h) // 2, int(current_w) // 2
552
  if (new_h, new_w) not in DEFAULT_RESOLUTIONS:
553
  new_h, new_w = DEFAULT_RESOLUTIONS[0]
554
  new_value_str = f"{new_h}x{new_w}"
555
+ return gr.Dropdown(
556
  choices=[f'{h}x{w}' for h, w in DEFAULT_RESOLUTIONS],
557
+ value=new_value_str,
558
+ label="Output Resolution (HxW)",
559
+ elem_id="resolution_dropdown",
560
+ info="Select target size for generated images."
561
  )
562
 
563