multimodalart HF staff commited on
Commit
a739485
1 Parent(s): e053e10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -28,6 +28,7 @@ from pipeline_stable_diffusion_xl_instantid_img2img import StableDiffusionXLInst
28
  from controlnet_aux import ZoeDetector
29
 
30
  from compel import Compel, ReturnedEmbeddingsType
 
31
  #from gradio_imageslider import ImageSlider
32
 
33
  with open("sdxl_loras.json", "r") as file:
@@ -204,7 +205,7 @@ def merge_incompatible_lora(full_path_lora, lora_scale):
204
  del weights_sd
205
  del lora_model
206
  gc.collect()
207
-
208
  def run_lora(face_image, prompt, negative, lora_scale, selected_state, face_strength, image_strength, guidance_scale, depth_control_scale, sdxl_loras, progress=gr.Progress(track_tqdm=True)):
209
  global last_lora, last_merged, last_fused, pipe
210
 
@@ -262,7 +263,7 @@ def run_lora(face_image, prompt, negative, lora_scale, selected_state, face_stre
262
  pipe.unfuse_lora()
263
  pipe.unload_lora_weights()
264
  pipe.load_lora_weights(loaded_state_dict)
265
- pipe.fuse_lora()
266
  last_fused = True
267
  is_pivotal = sdxl_loras[selected_state.index]["is_pivotal"]
268
  if(is_pivotal):
 
28
  from controlnet_aux import ZoeDetector
29
 
30
  from compel import Compel, ReturnedEmbeddingsType
31
+ import spaces
32
  #from gradio_imageslider import ImageSlider
33
 
34
  with open("sdxl_loras.json", "r") as file:
 
205
  del weights_sd
206
  del lora_model
207
  gc.collect()
208
+ @spaces.GPU
209
  def run_lora(face_image, prompt, negative, lora_scale, selected_state, face_strength, image_strength, guidance_scale, depth_control_scale, sdxl_loras, progress=gr.Progress(track_tqdm=True)):
210
  global last_lora, last_merged, last_fused, pipe
211
 
 
263
  pipe.unfuse_lora()
264
  pipe.unload_lora_weights()
265
  pipe.load_lora_weights(loaded_state_dict)
266
+ pipe.fuse_lora(lora_scale)
267
  last_fused = True
268
  is_pivotal = sdxl_loras[selected_state.index]["is_pivotal"]
269
  if(is_pivotal):