Spaces:
Running
Running
Commit
·
19d8964
1
Parent(s):
c9fbf9f
change from diffusion pipeline to flux control
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ import numpy as np
|
|
3 |
import random
|
4 |
|
5 |
import spaces #[uncomment to use ZeroGPU]
|
6 |
-
from diffusers import DiffusionPipeline
|
|
|
7 |
from controlnet_aux import CannyDetector
|
8 |
from huggingface_hub import login
|
9 |
import torch
|
@@ -32,7 +33,7 @@ if torch.cuda.is_available():
|
|
32 |
else:
|
33 |
torch_dtype = torch.float32
|
34 |
|
35 |
-
pipe =
|
36 |
pipe = pipe.to(device)
|
37 |
pipe.load_lora_weights(flat_lora_path, weight_name=flat_weigths_file, adapter_name="flat")
|
38 |
pipe.load_lora_weights(canny_lora_path, weight_name=canny_weigths_file, adapter_name="canny")
|
|
|
3 |
import random
|
4 |
|
5 |
import spaces #[uncomment to use ZeroGPU]
|
6 |
+
# from diffusers import DiffusionPipeline
|
7 |
+
from diffusers import FluxControlPipeline
|
8 |
from controlnet_aux import CannyDetector
|
9 |
from huggingface_hub import login
|
10 |
import torch
|
|
|
33 |
else:
|
34 |
torch_dtype = torch.float32
|
35 |
|
36 |
+
pipe = FluxControlPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
37 |
pipe = pipe.to(device)
|
38 |
pipe.load_lora_weights(flat_lora_path, weight_name=flat_weigths_file, adapter_name="flat")
|
39 |
pipe.load_lora_weights(canny_lora_path, weight_name=canny_weigths_file, adapter_name="canny")
|