Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
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 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 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 |
|