DonImages commited on
Commit
f95ef44
·
verified ·
1 Parent(s): 9024a26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,7 +14,7 @@ else:
14
  # Load the Stable Diffusion 3.5 model
15
  model_id = "stabilityai/stable-diffusion-3.5-medium"
16
  pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16)
17
- pipe.to("cuda")
18
 
19
  # Define the path to the LoRA model
20
  lora_model_path = "https://huggingface.co/spaces/DonImages/Testing2/resolve/main/lora_model.pth" # LoRA model path
@@ -22,7 +22,7 @@ lora_model_path = "https://huggingface.co/spaces/DonImages/Testing2/resolve/main
22
  # Custom method to load and apply LoRA weights to the Stable Diffusion pipeline
23
  def load_lora_model(pipe, lora_model_path):
24
  # Load the LoRA weights (assuming it's a PyTorch .pth file)
25
- lora_weights = torch.load(lora_model_path, map_location="cuda")
26
 
27
  # Modify this section based on how LoRA is intended to interact with your Stable Diffusion model
28
  # Here, we just load the weights into the model's parameters (this is a conceptual approach)
 
14
  # Load the Stable Diffusion 3.5 model
15
  model_id = "stabilityai/stable-diffusion-3.5-medium"
16
  pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16)
17
+ pipe.to("cpu")
18
 
19
  # Define the path to the LoRA model
20
  lora_model_path = "https://huggingface.co/spaces/DonImages/Testing2/resolve/main/lora_model.pth" # LoRA model path
 
22
  # Custom method to load and apply LoRA weights to the Stable Diffusion pipeline
23
  def load_lora_model(pipe, lora_model_path):
24
  # Load the LoRA weights (assuming it's a PyTorch .pth file)
25
+ lora_weights = torch.load(lora_model_path, map_location="cpu")
26
 
27
  # Modify this section based on how LoRA is intended to interact with your Stable Diffusion model
28
  # Here, we just load the weights into the model's parameters (this is a conceptual approach)