Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import random
|
|
5 |
import spaces
|
6 |
from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
|
7 |
import torch
|
|
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
model_repo_id = "tensorart/stable-diffusion-3.5-large-TurboX"
|
@@ -14,9 +15,9 @@ if torch.cuda.is_available():
|
|
14 |
else:
|
15 |
torch_dtype = torch.bfloat16
|
16 |
|
17 |
-
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype
|
18 |
|
19 |
-
pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(model_repo_id, subfolder="scheduler", shift=5)
|
20 |
|
21 |
pipe = pipe.to(device)
|
22 |
|
|
|
5 |
import spaces
|
6 |
from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
|
7 |
import torch
|
8 |
+
torch.cuda.empty_cache()
|
9 |
|
10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
11 |
model_repo_id = "tensorart/stable-diffusion-3.5-large-TurboX"
|
|
|
15 |
else:
|
16 |
torch_dtype = torch.bfloat16
|
17 |
|
18 |
+
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
19 |
|
20 |
+
pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(model_repo_id, subfolder="scheduler", shift=5, use_fast=True)
|
21 |
|
22 |
pipe = pipe.to(device)
|
23 |
|