akaUNik commited on
Commit
282485e
·
verified ·
1 Parent(s): ce2f64e

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -38,13 +38,11 @@ def load_pipeline(model_id: str):
38
  # Use the specified base model for your LoRA adapter.
39
  base_model = "CompVis/stable-diffusion-v1-4"
40
  pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch_dtype)
41
- # Load LoRA weights
42
- lora_weights_path = hf_hub_download(
43
- repo_id=model_id,
44
- filename="pytorch_lora_weights.safetensors", # Verify this filename
45
- repo_type="model"
46
- )
47
- pipe.load_lora_weights(lora_weights_path)
48
  else:
49
  pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
50
 
 
38
  # Use the specified base model for your LoRA adapter.
39
  base_model = "CompVis/stable-diffusion-v1-4"
40
  pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch_dtype)
41
+ # Load the LoRA weights into the U-Net.
42
+ # This assumes that load_attn_procs loads the LoRA weights.
43
+ # pipe.unet.load_attn_procs(model_id)
44
+ pipe.load_lora_weights(model_id, weight_name="text_encoder/adapter_model.safetensors")
45
+ pipe.load_lora_weights(model_id, weight_name="unet/adapter_model.safetensors")
 
 
46
  else:
47
  pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
48