John6666 commited on
Commit
a121a5b
·
verified ·
1 Parent(s): 09325c7

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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): 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,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
- yield gr.update(visible=True)
85
 
86
  change_base_model.zerogpu = True
87
 
@@ -194,10 +194,10 @@ def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, lora_scal
194
  def run_lora(prompt, cfg_scale, steps, selected_index, randomize_seed, seed, width, height,
195
  lora_scale, lora_json, cn_on, progress=gr.Progress(track_tqdm=True)):
196
  global pipe
197
- global taef1
198
- global good_vae
199
- global controlnet
200
- global controlnet_union
201
  if selected_index is None and not is_valid_lora(lora_json):
202
  gr.Info("LoRA isn't selected.")
203
  # raise gr.Error("You must select a LoRA before proceeding.")
 
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
  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
 
 
194
  def run_lora(prompt, cfg_scale, steps, selected_index, randomize_seed, seed, width, height,
195
  lora_scale, lora_json, cn_on, progress=gr.Progress(track_tqdm=True)):
196
  global pipe
197
+ #global taef1
198
+ #global good_vae
199
+ #global controlnet
200
+ #global controlnet_union
201
  if selected_index is None and not is_valid_lora(lora_json):
202
  gr.Info("LoRA isn't selected.")
203
  # raise gr.Error("You must select a LoRA before proceeding.")