John6666 commited on
Commit
970c031
β€’
1 Parent(s): 4aeca56

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -55,7 +55,7 @@ def change_base_model(repo_id: str, cn_on: bool): # , progress=gr.Progress(track
55
  global last_model
56
  global last_cn_on
57
  try:
58
- if (repo_id == last_model and cn_on is last_cn_on) or not is_repo_name(repo_id) or not is_repo_exists(repo_id): return gr.update(visible=True)
59
  if cn_on:
60
  #progress(0, desc=f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
61
  print(f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
@@ -81,7 +81,7 @@ def change_base_model(repo_id: str, cn_on: bool): # , progress=gr.Progress(track
81
  except Exception as e:
82
  print(f"Model load Error: {e}")
83
  raise gr.Error(f"Model load Error: {e}")
84
- return gr.update(visible=True)
85
 
86
  change_base_model.zerogpu = True
87
 
 
55
  global last_model
56
  global last_cn_on
57
  try:
58
+ if (repo_id == last_model and cn_on is last_cn_on) or not is_repo_name(repo_id) or not is_repo_exists(repo_id): yield gr.update(visible=True)
59
  if cn_on:
60
  #progress(0, desc=f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
61
  print(f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
 
81
  except Exception as e:
82
  print(f"Model load Error: {e}")
83
  raise gr.Error(f"Model load Error: {e}")
84
+ yield gr.update(visible=True)
85
 
86
  change_base_model.zerogpu = True
87