Ming Li commited on
Commit
e557299
1 Parent(s): 3dd8e2c

turn off xformers

Browse files
Files changed (1) hide show
  1. model.py +2 -2
model.py CHANGED
@@ -57,8 +57,8 @@ class Model:
57
  base_model_id, safety_checker=None, controlnet=controlnet, torch_dtype=torch.float16
58
  )
59
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
60
- # if self.device.type == "cuda":
61
- # pipe.enable_xformers_memory_efficient_attention()
62
  pipe.to(self.device)
63
  torch.cuda.empty_cache()
64
  gc.collect()
 
57
  base_model_id, safety_checker=None, controlnet=controlnet, torch_dtype=torch.float16
58
  )
59
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
60
+ if self.device.type == "cuda":
61
+ pipe.disable_xformers_memory_efficient_attention()
62
  pipe.to(self.device)
63
  torch.cuda.empty_cache()
64
  gc.collect()