silveroxides commited on
Commit
796633c
1 Parent(s): 1fe6c59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -19,6 +19,7 @@ import gradio as gr
19
  from PIL import Image
20
  import numpy as np
21
  from transformers import AutoProcessor, AutoModelForCausalLM, pipeline
 
22
  import requests
23
  from RealESRGAN import RealESRGAN
24
 
@@ -62,8 +63,6 @@ def download_file(url, folder_path, filename):
62
  download_file("https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth?download=true", "models/upscalers/", "RealESRGAN_x2.pth")
63
  download_file("https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/RealESRGAN_x4.pth?download=true", "models/upscalers/", "RealESRGAN_x4.pth")
64
  download_file("https://huggingface.co/silveroxides/sdxl_lowstep_beta_v1/resolve/main/pytorch_lora_weights.safetensors?download=true", "models/lora/", "LowStepBeta_v001.safetensors")
65
- lora_model_path = "models/lora/LowStepBeta_v001.safetensors"
66
- lora = torch.load(lora_model_path)
67
  # Download the model files
68
  ckpt_dir_realpony = snapshot_download(repo_id="silveroxides/RNS_RealPonyV20")
69
  ckpt_dir_noobai = snapshot_download(repo_id="silveroxides/NoobAI-XL-EPS-1.0-Vwe")
@@ -104,6 +103,9 @@ pipe_realpony.unet.set_attn_processor(AttnProcessor2_0())
104
  pipe_noobai.unet.set_attn_processor(AttnProcessor2_0())
105
  pipe_hybridpony.unet.set_attn_processor(AttnProcessor2_0())
106
 
 
 
 
107
  # Define samplers
108
  samplers = {
109
  "Euler a": EulerAncestralDiscreteScheduler.from_config(pipe_realpony.scheduler.config),
 
19
  from PIL import Image
20
  import numpy as np
21
  from transformers import AutoProcessor, AutoModelForCausalLM, pipeline
22
+ from safetensors.torch import load_file
23
  import requests
24
  from RealESRGAN import RealESRGAN
25
 
 
63
  download_file("https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth?download=true", "models/upscalers/", "RealESRGAN_x2.pth")
64
  download_file("https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/RealESRGAN_x4.pth?download=true", "models/upscalers/", "RealESRGAN_x4.pth")
65
  download_file("https://huggingface.co/silveroxides/sdxl_lowstep_beta_v1/resolve/main/pytorch_lora_weights.safetensors?download=true", "models/lora/", "LowStepBeta_v001.safetensors")
 
 
66
  # Download the model files
67
  ckpt_dir_realpony = snapshot_download(repo_id="silveroxides/RNS_RealPonyV20")
68
  ckpt_dir_noobai = snapshot_download(repo_id="silveroxides/NoobAI-XL-EPS-1.0-Vwe")
 
103
  pipe_noobai.unet.set_attn_processor(AttnProcessor2_0())
104
  pipe_hybridpony.unet.set_attn_processor(AttnProcessor2_0())
105
 
106
+ lora_model_path = "models/lora/LowStepBeta_v001.safetensors"
107
+ lora = load_file(lora_model_path).to("cuda")
108
+
109
  # Define samplers
110
  samplers = {
111
  "Euler a": EulerAncestralDiscreteScheduler.from_config(pipe_realpony.scheduler.config),