akaUNik commited on
Commit
70323db
·
verified ·
1 Parent(s): 32a6eb1

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -39,9 +39,9 @@ def load_pipeline(model_id: str):
39
  # Use the specified base model for your LoRA adapter.
40
  base_model = "CompVis/stable-diffusion-v1-4"
41
  pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch_dtype)
42
- # Load the LoRA weights into the U-Net.
43
- pipe.unet = PeftModel.from_pretrained(pipe.unet, model_id, torch_dtype=torch_dtype)
44
-
45
  else:
46
  pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
47
 
 
39
  # Use the specified base model for your LoRA adapter.
40
  base_model = "CompVis/stable-diffusion-v1-4"
41
  pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch_dtype)
42
+ # Load the LoRA weights
43
+ pipe.unet = PeftModel.from_pretrained(pipe.unet, f"{model_id}/unet", torch_dtype=torch_dtype)
44
+ pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, f"{model_id}/text_encoder", torch_dtype=torch_dtype)
45
  else:
46
  pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
47