multimodalart HF staff commited on
Commit
701c4ad
1 Parent(s): 6fb1c0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -36,7 +36,10 @@ def run_lora(prompt, cfg_scale, steps, selected_index, seed, width, height, lora
36
  trigger_word = selected_lora["trigger_word"]
37
 
38
  # Load LoRA weights
39
- pipe.load_lora_weights(lora_path)
 
 
 
40
 
41
  # Set random seed for reproducibility
42
  generator = torch.Generator(device="cuda").manual_seed(seed)
 
36
  trigger_word = selected_lora["trigger_word"]
37
 
38
  # Load LoRA weights
39
+ if "weights" in selected_lora:
40
+ pipe.load_lora_weights(lora_path, weight_name=selected_lora["weights"])
41
+ else:
42
+ pipe.load_lora_weights(lora_path)
43
 
44
  # Set random seed for reproducibility
45
  generator = torch.Generator(device="cuda").manual_seed(seed)