cocktailpeanut commited on
Commit
a7b3e4b
1 Parent(s): ad2d8cc
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -28,7 +28,8 @@ unet = UNet2DConditionModel.from_pretrained(model_id, subfolder="unet", revision
28
 
29
  # pipe for TokenFlow
30
  tokenflow_pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(device)
31
- tokenflow_pipe.enable_xformers_memory_efficient_attention()
 
32
 
33
  def randomize_seed_fn():
34
  seed = random.randint(0, np.iinfo(np.int32).max)
 
28
 
29
  # pipe for TokenFlow
30
  tokenflow_pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(device)
31
+ if device == "cuda":
32
+ tokenflow_pipe.enable_xformers_memory_efficient_attention()
33
 
34
  def randomize_seed_fn():
35
  seed = random.randint(0, np.iinfo(np.int32).max)