Spaces:
Runtime error
Runtime error
Commit
·
4e7fe8d
1
Parent(s):
79c54b5
fix pipe
Browse files- sd_model.py +2 -2
sd_model.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
|
| 2 |
from diffusers import StableDiffusionXLControlNetPipeline, ControlNetModel, AutoencoderKL
|
| 3 |
import torch
|
|
|
|
| 4 |
import spaces
|
| 5 |
|
| 6 |
device = "cuda"
|
| 7 |
|
| 8 |
-
@spaces.GPU
|
| 9 |
def get_cn_pipeline():
|
| 10 |
controlnets = [
|
| 11 |
ControlNetModel.from_pretrained("./controlnet/lineart", torch_dtype=torch.float16, use_safetensors=True),
|
|
@@ -17,7 +17,7 @@ def get_cn_pipeline():
|
|
| 17 |
"cagliostrolab/animagine-xl-3.1", controlnet=controlnets, vae=vae, torch_dtype=torch.float16
|
| 18 |
)
|
| 19 |
|
| 20 |
-
pipe.enable_model_cpu_offload()
|
| 21 |
|
| 22 |
#if pipe.safety_checker is not None:
|
| 23 |
# pipe.safety_checker = lambda images, **kwargs: (images, [False])
|
|
|
|
| 1 |
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
|
| 2 |
from diffusers import StableDiffusionXLControlNetPipeline, ControlNetModel, AutoencoderKL
|
| 3 |
import torch
|
| 4 |
+
import pickle as pkl
|
| 5 |
import spaces
|
| 6 |
|
| 7 |
device = "cuda"
|
| 8 |
|
|
|
|
| 9 |
def get_cn_pipeline():
|
| 10 |
controlnets = [
|
| 11 |
ControlNetModel.from_pretrained("./controlnet/lineart", torch_dtype=torch.float16, use_safetensors=True),
|
|
|
|
| 17 |
"cagliostrolab/animagine-xl-3.1", controlnet=controlnets, vae=vae, torch_dtype=torch.float16
|
| 18 |
)
|
| 19 |
|
| 20 |
+
#pipe.enable_model_cpu_offload()
|
| 21 |
|
| 22 |
#if pipe.safety_checker is not None:
|
| 23 |
# pipe.safety_checker = lambda images, **kwargs: (images, [False])
|