ford442 commited on
Commit
a8a4cc0
·
verified ·
1 Parent(s): 196a479

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -2,7 +2,6 @@ import spaces
2
  import gradio as gr
3
  import numpy as np
4
  import random
5
- from lora import LoRAModel
6
 
7
  import torch
8
  from diffusers import StableDiffusion3Pipeline
@@ -74,16 +73,13 @@ pipe = StableDiffusion3Pipeline.from_pretrained(
74
  #tokenizer=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer", token=True),
75
  #tokenizer_2=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer_2", token=True),
76
  tokenizer_3=T5TokenizerFast.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=False, use_fast=True, subfolder="tokenizer_3", token=True),
77
- torch_dtype=torch.bfloat16,
78
  #use_safetensors=False,
79
  )
80
 
81
-
82
-
83
- lora_model = LoRAModel.from_pretrained("https://huggingface.co/ford442/sdxl-vae-bf16/LoRA/UltraReal.safetensors")
84
- pipe.apply_lora(lora_model, scaling_factor=0.75)
85
- #pipe.to(device=device, dtype=torch.bfloat16)
86
- pipe.to(device)
87
 
88
  upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device('cpu'))
89
 
 
2
  import gradio as gr
3
  import numpy as np
4
  import random
 
5
 
6
  import torch
7
  from diffusers import StableDiffusion3Pipeline
 
73
  #tokenizer=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer", token=True),
74
  #tokenizer_2=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer_2", token=True),
75
  tokenizer_3=T5TokenizerFast.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=False, use_fast=True, subfolder="tokenizer_3", token=True),
76
+ #torch_dtype=torch.bfloat16,
77
  #use_safetensors=False,
78
  )
79
 
80
+ pipe.load_lora_weights("https://huggingface.co/ford442/sdxl-vae-bf16/LoRA/UltraReal.safetensors")
81
+ pipe.to(device=device, dtype=torch.bfloat16)
82
+ #pipe.to(device)
 
 
 
83
 
84
  upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device('cpu'))
85