Spaces:
Running
Running
Upload animate.py
Browse files- demo/animate.py +4 -3
demo/animate.py
CHANGED
@@ -72,9 +72,10 @@ class MagicAnimate():
|
|
72 |
controlnet.to(torch.float16)
|
73 |
self.appearance_encoder.to(torch.float16)
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
78 |
|
79 |
self.pipeline = AnimationPipeline(
|
80 |
vae=vae, text_encoder=text_encoder, tokenizer=tokenizer, unet=unet, controlnet=controlnet,
|
|
|
72 |
controlnet.to(torch.float16)
|
73 |
self.appearance_encoder.to(torch.float16)
|
74 |
|
75 |
+
if device == "cuda":
|
76 |
+
unet.enable_xformers_memory_efficient_attention()
|
77 |
+
self.appearance_encoder.enable_xformers_memory_efficient_attention()
|
78 |
+
controlnet.enable_xformers_memory_efficient_attention()
|
79 |
|
80 |
self.pipeline = AnimationPipeline(
|
81 |
vae=vae, text_encoder=text_encoder, tokenizer=tokenizer, unet=unet, controlnet=controlnet,
|