Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,18 +6,16 @@ from diffusers import (
|
|
6 |
AutoencoderKL,
|
7 |
DPMSolverSinglestepScheduler,
|
8 |
)
|
9 |
-
from huggingface_hub import hf_hub_download
|
10 |
|
11 |
# --- Configuration ---
|
12 |
# The base model your LoRA was trained on.
|
13 |
base_model_id = "stabilityai/stable-diffusion-xl-base-1.0"
|
14 |
|
15 |
-
# ---
|
16 |
-
# The
|
17 |
-
|
18 |
-
lora_filename = "emilyh.safetensors"
|
19 |
|
20 |
-
# --- Load the Pipeline
|
21 |
# Use a recommended VAE for SDXL
|
22 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
23 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
@@ -28,9 +26,8 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
28 |
use_safetensors=True
|
29 |
)
|
30 |
|
31 |
-
# --- Load
|
32 |
-
#
|
33 |
-
lora_file_path = hf_hub_download(repo_id=lora_repo_id, filename=lora_filename)
|
34 |
pipe.load_lora_weights(lora_file_path)
|
35 |
|
36 |
# Move the pipeline to the GPU
|
|
|
6 |
AutoencoderKL,
|
7 |
DPMSolverSinglestepScheduler,
|
8 |
)
|
|
|
9 |
|
10 |
# --- Configuration ---
|
11 |
# The base model your LoRA was trained on.
|
12 |
base_model_id = "stabilityai/stable-diffusion-xl-base-1.0"
|
13 |
|
14 |
+
# --- The file is local, so we just need its name ---
|
15 |
+
# The safetensors file is in the same directory as this script.
|
16 |
+
lora_file_path = "emilyh.safetensors"
|
|
|
17 |
|
18 |
+
# --- Load the Pipeline ---
|
19 |
# Use a recommended VAE for SDXL
|
20 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
21 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
|
26 |
use_safetensors=True
|
27 |
)
|
28 |
|
29 |
+
# --- Load the local LoRA file ---
|
30 |
+
# No download needed. We just load the local file directly.
|
|
|
31 |
pipe.load_lora_weights(lora_file_path)
|
32 |
|
33 |
# Move the pipeline to the GPU
|