Spaces:
Runtime error
Runtime error
enable xformers and f16
Browse files- app.py +3 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -19,15 +19,15 @@ conditioning_image_transforms = T.Compose(
|
|
19 |
]
|
20 |
)
|
21 |
|
22 |
-
cnet = ControlNetModel.from_pretrained("./models/catcon-controlnet-wd", torch_dtype=torch.
|
23 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
24 |
"./models/wd-1-5-b2",
|
25 |
controlnet=cnet,
|
26 |
-
torch_dtype=torch.
|
27 |
)
|
28 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
29 |
pipe.enable_model_cpu_offload()
|
30 |
-
|
31 |
|
32 |
generator = torch.manual_seed(0)
|
33 |
|
|
|
19 |
]
|
20 |
)
|
21 |
|
22 |
+
cnet = ControlNetModel.from_pretrained("./models/catcon-controlnet-wd", torch_dtype=torch.float16, from_flax=True)
|
23 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
24 |
"./models/wd-1-5-b2",
|
25 |
controlnet=cnet,
|
26 |
+
torch_dtype=torch.float16,
|
27 |
)
|
28 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
29 |
pipe.enable_model_cpu_offload()
|
30 |
+
pipe.enable_xformers_memory_efficient_attention()
|
31 |
|
32 |
generator = torch.manual_seed(0)
|
33 |
|
requirements.txt
CHANGED
@@ -9,3 +9,4 @@ pillow
|
|
9 |
torch
|
10 |
torchvision
|
11 |
accelerate
|
|
|
|
9 |
torch
|
10 |
torchvision
|
11 |
accelerate
|
12 |
+
xformers==0.0.16
|