Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,16 +5,12 @@ from diffusers import DiffusionPipeline
|
|
5 |
import torch
|
6 |
import spaces
|
7 |
|
8 |
-
device = "cuda"
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
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
|