Spaces:
Running
on
Zero
Running
on
Zero
Update feifeilib/feifeimodload.py
Browse files- feifeilib/feifeimodload.py +10 -2
feifeilib/feifeimodload.py
CHANGED
@@ -3,17 +3,25 @@ import spaces
|
|
3 |
from diffusers import (
|
4 |
DiffusionPipeline,
|
5 |
AutoencoderTiny,
|
|
|
6 |
)
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
-
|
|
|
9 |
|
10 |
def feifeimodload():
|
11 |
|
12 |
dtype = torch.bfloat16
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
pipe = DiffusionPipeline.from_pretrained(
|
16 |
-
"aifeifei798/DarkIdol-flux-v1", torch_dtype=dtype
|
17 |
).to(device)
|
18 |
|
19 |
pipe.load_lora_weights(
|
|
|
3 |
from diffusers import (
|
4 |
DiffusionPipeline,
|
5 |
AutoencoderTiny,
|
6 |
+
FluxControlNetModel
|
7 |
)
|
8 |
from huggingface_hub import hf_hub_download
|
9 |
+
from diffusers.utils import load_image
|
10 |
+
from diffusers.pipelines import FluxControlNetPipeline
|
11 |
|
12 |
def feifeimodload():
|
13 |
|
14 |
dtype = torch.bfloat16
|
15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
16 |
|
17 |
+
# Load pipeline
|
18 |
+
controlnet = FluxControlNetModel.from_pretrained(
|
19 |
+
"jasperai/Flux.1-dev-Controlnet-Upscaler",
|
20 |
+
torch_dtype=torch.bfloat16
|
21 |
+
)
|
22 |
+
|
23 |
pipe = DiffusionPipeline.from_pretrained(
|
24 |
+
"aifeifei798/DarkIdol-flux-v1", controlnet=controlnet, torch_dtype=dtype,
|
25 |
).to(device)
|
26 |
|
27 |
pipe.load_lora_weights(
|