Spaces:
Paused
Paused
Commit
·
f7e3553
1
Parent(s):
deb1535
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
|
|
|
| 3 |
from diffusers import StableDiffusionXLPipeline, AutoencoderKL, LCMScheduler
|
| 4 |
from huggingface_hub import hf_hub_download
|
| 5 |
from safetensors.torch import load_file
|
|
@@ -168,7 +169,7 @@ def run_lora(prompt, negative, lora_scale, selected_state, sdxl_loras, sdxl_lora
|
|
| 168 |
if(last_fused):
|
| 169 |
pipe.unfuse_lora()
|
| 170 |
pipe.load_lora_weights(loaded_state_dict, adapter_name="loaded_lora")
|
| 171 |
-
pipe.load_lora_weights(lcm_lora_id, weight_name="lcm_sdxl_lora.safetensors", adapter_name="lcm_lora", use_auth_token=
|
| 172 |
pipe.set_adapters(["loaded_lora", "lcm_lora"], adapter_weights=[0.8, 1.0])
|
| 173 |
pipe.fuse_lora()
|
| 174 |
last_fused = True
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
+
import os
|
| 4 |
from diffusers import StableDiffusionXLPipeline, AutoencoderKL, LCMScheduler
|
| 5 |
from huggingface_hub import hf_hub_download
|
| 6 |
from safetensors.torch import load_file
|
|
|
|
| 169 |
if(last_fused):
|
| 170 |
pipe.unfuse_lora()
|
| 171 |
pipe.load_lora_weights(loaded_state_dict, adapter_name="loaded_lora")
|
| 172 |
+
pipe.load_lora_weights(lcm_lora_id, weight_name="lcm_sdxl_lora.safetensors", adapter_name="lcm_lora", use_auth_token=os.getenv('HF_TOKEN'))
|
| 173 |
pipe.set_adapters(["loaded_lora", "lcm_lora"], adapter_weights=[0.8, 1.0])
|
| 174 |
pipe.fuse_lora()
|
| 175 |
last_fused = True
|