wooyeolbaek commited on
Commit
eeb734b
1 Parent(s): 0e62d9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -16,7 +16,8 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
16
  torch_dtype=torch.float16,
17
  )
18
  pipe.unet = register_cross_attention_hook(pipe.unet)
19
- pipe = pipe.to("cuda")
 
20
 
21
 
22
  def inference(prompt):
 
16
  torch_dtype=torch.float16,
17
  )
18
  pipe.unet = register_cross_attention_hook(pipe.unet)
19
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
20
+ pipe = pipe.to(device)
21
 
22
 
23
  def inference(prompt):