Jordan Legg commited on
Commit
5d15a18
1 Parent(s): d83ac73

added check for cudaaaaa

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -13,8 +13,9 @@ device: str = "cuda" if torch.cuda.is_available() else "cpu"
13
  pipe = DiffusionPipeline.from_pretrained("shuttleai/shuttle-3-diffusion", torch_dtype=dtype).to(device)
14
  # Enable VAE tiling
15
  pipe.vae.enable_tiling()
16
- # Enable memory efficient attention
17
- pipe.enable_xformers_memory_efficient_attention()
 
18
 
19
  # Define cinematic aspect ratios
20
  ASPECT_RATIOS = {
 
13
  pipe = DiffusionPipeline.from_pretrained("shuttleai/shuttle-3-diffusion", torch_dtype=dtype).to(device)
14
  # Enable VAE tiling
15
  pipe.vae.enable_tiling()
16
+ # Only enable xformers memory efficient attention when using CUDA
17
+ if device == "cuda":
18
+ pipe.enable_xformers_memory_efficient_attention()
19
 
20
  # Define cinematic aspect ratios
21
  ASPECT_RATIOS = {