jiuface commited on
Commit
c0d646a
·
verified ·
1 Parent(s): b9ea7a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -162,9 +162,15 @@ def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, s
162
  seed = random.randint(0, MAX_SEED)
163
 
164
  # Load LoRA weights
165
- gr.Info("Start to load loras ...")
 
 
 
 
 
166
  lora_configs = None
167
  adapter_names = []
 
168
  if lora_strings_json:
169
  try:
170
  lora_configs = json.loads(lora_strings_json)
 
162
  seed = random.randint(0, MAX_SEED)
163
 
164
  # Load LoRA weights
165
+ gr.Info("Start to load LoRA ...")
166
+
167
+ with calculateDuration("Unloading LoRA"):
168
+ pipe.unload_lora_weights()
169
+ img2img.unload_lora_weights()
170
+
171
  lora_configs = None
172
  adapter_names = []
173
+
174
  if lora_strings_json:
175
  try:
176
  lora_configs = json.loads(lora_strings_json)