zhiweili
commited on
Commit
Β·
52763ae
1
Parent(s):
0f25938
test cuda12
Browse files- app_onediff.py +5 -3
- requirements.txt +2 -2
app_onediff.py
CHANGED
@@ -10,10 +10,12 @@ from diffusers import (
|
|
10 |
AutoencoderTiny,
|
11 |
)
|
12 |
|
|
|
13 |
os.system("git clone https://github.com/siliconflow/onediff.git")
|
14 |
-
os.system("cd onediff
|
15 |
|
16 |
-
|
|
|
17 |
|
18 |
BASE_MODEL = "stabilityai/sdxl-turbo"
|
19 |
device = "cuda"
|
@@ -38,7 +40,7 @@ base_pipe.scheduler = DDPMScheduler.from_pretrained(
|
|
38 |
subfolder="scheduler",
|
39 |
)
|
40 |
|
41 |
-
base_pipe =
|
42 |
|
43 |
def create_demo() -> gr.Blocks:
|
44 |
|
|
|
10 |
AutoencoderTiny,
|
11 |
)
|
12 |
|
13 |
+
os.system("python3 -m pip install -U --pre oneflow -f https://github.com/siliconflow/oneflow_releases/releases/expanded_assets/community_cu121")
|
14 |
os.system("git clone https://github.com/siliconflow/onediff.git")
|
15 |
+
os.system("cd onediff && python3 -m pip install -e .")
|
16 |
|
17 |
+
import oneflow as flow
|
18 |
+
from onediff.infer_compiler import oneflow_compile
|
19 |
|
20 |
BASE_MODEL = "stabilityai/sdxl-turbo"
|
21 |
device = "cuda"
|
|
|
40 |
subfolder="scheduler",
|
41 |
)
|
42 |
|
43 |
+
base_pipe.unet = oneflow_compile(base_pipe.unet)
|
44 |
|
45 |
def create_demo() -> gr.Blocks:
|
46 |
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
gradio
|
2 |
-
torch
|
3 |
-
torchvision
|
4 |
diffusers
|
5 |
transformers
|
6 |
accelerate
|
|
|
1 |
gradio
|
2 |
+
torch -f https://download.pytorch.org/whl/cu121/torch_stable.html
|
3 |
+
torchvision -f https://download.pytorch.org/whl/cu121/torch_stable.html
|
4 |
diffusers
|
5 |
transformers
|
6 |
accelerate
|