Spaces:
Running
on
Zero
Running
on
Zero
add hyper-sd
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import random
|
|
4 |
|
5 |
import spaces
|
6 |
import torch
|
7 |
-
|
8 |
from diffusers import FluxPriorReduxPipeline, FluxPipeline
|
9 |
from diffusers.utils import load_image
|
10 |
|
@@ -15,6 +15,10 @@ pipe = FluxPipeline.from_pretrained(
|
|
15 |
"black-forest-labs/FLUX.1-dev" ,
|
16 |
torch_dtype=torch.bfloat16
|
17 |
).to("cuda")
|
|
|
|
|
|
|
|
|
18 |
pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(
|
19 |
"black-forest-labs/FLUX.1-Redux-dev",
|
20 |
text_encoder=pipe.text_encoder,
|
|
|
4 |
|
5 |
import spaces
|
6 |
import torch
|
7 |
+
from huggingface_hub import hf_hub_download
|
8 |
from diffusers import FluxPriorReduxPipeline, FluxPipeline
|
9 |
from diffusers.utils import load_image
|
10 |
|
|
|
15 |
"black-forest-labs/FLUX.1-dev" ,
|
16 |
torch_dtype=torch.bfloat16
|
17 |
).to("cuda")
|
18 |
+
pipe.load_lora_weights(hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), lora_scale=0.125)
|
19 |
+
pipe.fuse_lora(lora_scale=0.125)
|
20 |
+
pipe.to(device="cuda", dtype=torch.bfloat16)
|
21 |
+
|
22 |
pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(
|
23 |
"black-forest-labs/FLUX.1-Redux-dev",
|
24 |
text_encoder=pipe.text_encoder,
|