ovi054 commited on
Commit
3fc723e
·
verified ·
1 Parent(s): d3df5ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -107,9 +107,15 @@ def generate(prompt, negative_prompt, width=1024, height=1024, num_inference_ste
107
  image = (image * 255).astype(np.uint8)
108
  return Image.fromarray(image)
109
  finally:
110
- if lora_id and lora_id.strip() != "":
111
- pass
112
  # pipe.unload_lora_weights()
 
 
 
 
 
 
113
 
114
  iface = gr.Interface(
115
  fn=generate,
 
107
  image = (image * 255).astype(np.uint8)
108
  return Image.fromarray(image)
109
  finally:
110
+ # if lora_id and lora_id.strip() != "":
111
+ # pass
112
  # pipe.unload_lora_weights()
113
+ if clean_lora_id:
114
+ print(f"Unloading '{CUSTOM_LORA_NAME}' from this run.")
115
+ pipe.unload_lora_weights(CUSTOM_LORA_NAME)
116
+
117
+ # Always disable all active LoRAs to reset the state.
118
+ pipe.disable_lora()
119
 
120
  iface = gr.Interface(
121
  fn=generate,