Spaces:
Sleeping
Sleeping
AlekseyCalvin
commited on
Commit
•
91464a3
1
Parent(s):
03edeca
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import torch
|
|
6 |
from PIL import Image
|
7 |
import spaces
|
8 |
from diffusers import DiffusionPipeline, AutoPipelineForText2Image
|
9 |
-
from diffusers import StableDiffusion3Pipeline # pip install diffusers>=0.31.0
|
10 |
import copy
|
11 |
import random
|
12 |
import time
|
@@ -14,6 +14,11 @@ from huggingface_hub import login
|
|
14 |
hf_token = os.environ.get("HF_TOKEN")
|
15 |
login(token=hf_token)
|
16 |
|
|
|
|
|
|
|
|
|
|
|
17 |
torch.set_float32_matmul_precision("high")
|
18 |
|
19 |
#torch._inductor.config.conv_1x1_as_mm = True
|
|
|
6 |
from PIL import Image
|
7 |
import spaces
|
8 |
from diffusers import DiffusionPipeline, AutoPipelineForText2Image
|
9 |
+
from diffusers import StableDiffusion3Pipeline, FlowMatchEulerDiscreteScheduler, SD3Transformer2DModel # pip install diffusers>=0.31.0
|
10 |
import copy
|
11 |
import random
|
12 |
import time
|
|
|
14 |
hf_token = os.environ.get("HF_TOKEN")
|
15 |
login(token=hf_token)
|
16 |
|
17 |
+
cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
18 |
+
os.environ["TRANSFORMERS_CACHE"] = cache_path
|
19 |
+
os.environ["HF_HUB_CACHE"] = cache_path
|
20 |
+
os.environ["HF_HOME"] = cache_path
|
21 |
+
|
22 |
torch.set_float32_matmul_precision("high")
|
23 |
|
24 |
#torch._inductor.config.conv_1x1_as_mm = True
|