KingNish commited on
Commit
36e241a
1 Parent(s): e93ee25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -5,16 +5,12 @@ from diffusers import DiffusionPipeline
5
  import torch
6
  import spaces
7
 
8
- device = "cuda" if torch.cuda.is_available() else "cpu"
9
 
10
- if torch.cuda.is_available():
11
- torch.cuda.max_memory_allocated(device=device)
12
- pipe = DiffusionPipeline.from_pretrained("sd-community/sdxl-flash", torch_dtype=torch.float16, use_safetensors=True)
13
- pipe.enable_xformers_memory_efficient_attention()
14
- pipe = pipe.to(device)
15
- else:
16
- pipe = DiffusionPipeline.from_pretrained("sd-community/sdxl-flash", use_safetensors=True)
17
- pipe = pipe.to(device)
18
 
19
  MAX_SEED = np.iinfo(np.int32).max
20
  MAX_IMAGE_SIZE = 1024
 
5
  import torch
6
  import spaces
7
 
8
+ device = "cuda"
9
 
10
+ torch.cuda.max_memory_allocated(device=device)
11
+ pipe = DiffusionPipeline.from_pretrained("sd-community/sdxl-flash", torch_dtype=torch.float16, use_safetensors=True)
12
+ pipe.enable_xformers_memory_efficient_attention()
13
+ pipe = pipe.to(device)
 
 
 
 
14
 
15
  MAX_SEED = np.iinfo(np.int32).max
16
  MAX_IMAGE_SIZE = 1024