TuringsSolutions commited on
Commit
b7cde37
·
verified ·
1 Parent(s): 564f386

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
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
- # --- CORRECTED REPOSITORY PATH ---
16
- # The path to your LoRA file on the Hugging Face Hub.
17
- lora_repo_id = "TuringSolutions/EmilyH" # Corrected from "TuringsSolutions"
18
- lora_filename = "emilyh.safetensors"
19
 
20
- # --- Load the Pipeline (No token needed for public repos) ---
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 and Fuse the LoRA (No token needed for public repos) ---
32
- # Download the LoRA file and load the state dict.
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