John6666 commited on
Commit
ea1aefb
1 Parent(s): 5a49af7

Upload animate.py

Browse files
Files changed (1) hide show
  1. demo/animate.py +5 -6
demo/animate.py CHANGED
@@ -66,13 +66,12 @@ class MagicAnimate():
66
  ### Load controlnet
67
  controlnet = ControlNetModel.from_pretrained(config.pretrained_controlnet_path)
68
 
69
- vae.to(torch.float16)
70
- unet.to(torch.float16)
71
- text_encoder.to(torch.float16)
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()
 
66
  ### Load controlnet
67
  controlnet = ControlNetModel.from_pretrained(config.pretrained_controlnet_path)
68
 
 
 
 
 
 
 
69
  if device == "cuda":
70
+ vae.to(torch.float16)
71
+ unet.to(torch.float16)
72
+ text_encoder.to(torch.float16)
73
+ controlnet.to(torch.float16)
74
+ self.appearance_encoder.to(torch.float16)
75
  unet.enable_xformers_memory_efficient_attention()
76
  self.appearance_encoder.enable_xformers_memory_efficient_attention()
77
  controlnet.enable_xformers_memory_efficient_attention()