huangrh9 commited on
Commit
bb52f3a
·
verified ·
1 Parent(s): 99d7669

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -542,7 +542,7 @@ def update_resolution_dropdown(diffusion_enabled, current_resolution_str):
542
  if (new_h, new_w) not in DEFAULT_DIFFUSION_RESOLUTIONS:
543
  new_h, new_w = DEFAULT_DIFFUSION_RESOLUTIONS[0]
544
  new_value_str = f"{new_h}x{new_w}"
545
- return gr.Dropdown.update(choices=[f'{h}x{w}' for h, w in DEFAULT_DIFFUSION_RESOLUTIONS],
546
  value=new_value_str)
547
  else:
548
  new_h, new_w = int(current_h) // 2, int(current_w) // 2
@@ -551,7 +551,7 @@ def update_resolution_dropdown(diffusion_enabled, current_resolution_str):
551
  new_h, new_w = DEFAULT_RESOLUTIONS[0]
552
  new_value_str = f"{new_h}x{new_w}"
553
 
554
- return gr.Dropdown.update(choices=[f'{h}x{w}' for h, w in DEFAULT_RESOLUTIONS],
555
  value=new_value_str)
556
 
557
 
 
542
  if (new_h, new_w) not in DEFAULT_DIFFUSION_RESOLUTIONS:
543
  new_h, new_w = DEFAULT_DIFFUSION_RESOLUTIONS[0]
544
  new_value_str = f"{new_h}x{new_w}"
545
+ return dict(choices=[f'{h}x{w}' for h, w in DEFAULT_DIFFUSION_RESOLUTIONS],
546
  value=new_value_str)
547
  else:
548
  new_h, new_w = int(current_h) // 2, int(current_w) // 2
 
551
  new_h, new_w = DEFAULT_RESOLUTIONS[0]
552
  new_value_str = f"{new_h}x{new_w}"
553
 
554
+ return dict(choices=[f'{h}x{w}' for h, w in DEFAULT_RESOLUTIONS],
555
  value=new_value_str)
556
 
557