zhiweili
commited on
Commit
Β·
e2a532c
1
Parent(s):
5018a4b
add onediffx
Browse files- app_onediff.py +6 -4
- requirements.txt +2 -4
app_onediff.py
CHANGED
|
@@ -10,8 +10,10 @@ from diffusers import (
|
|
| 10 |
AutoencoderTiny,
|
| 11 |
)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
|
| 16 |
BASE_MODEL = "stabilityai/sdxl-turbo"
|
| 17 |
device = "cuda"
|
|
@@ -35,8 +37,8 @@ base_pipe.scheduler = DDPMScheduler.from_pretrained(
|
|
| 35 |
BASE_MODEL,
|
| 36 |
subfolder="scheduler",
|
| 37 |
)
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
def create_demo() -> gr.Blocks:
|
| 42 |
|
|
|
|
| 10 |
AutoencoderTiny,
|
| 11 |
)
|
| 12 |
|
| 13 |
+
os.system("git clone https://github.com/siliconflow/onediff.git")
|
| 14 |
+
os.system("cd onediff_diffusers_extensions && python3 -m pip install -e .")
|
| 15 |
+
|
| 16 |
+
from onediffx import compile_pipe
|
| 17 |
|
| 18 |
BASE_MODEL = "stabilityai/sdxl-turbo"
|
| 19 |
device = "cuda"
|
|
|
|
| 37 |
BASE_MODEL,
|
| 38 |
subfolder="scheduler",
|
| 39 |
)
|
| 40 |
+
|
| 41 |
+
base_pipe = compile_pipe(base_pipe)
|
| 42 |
|
| 43 |
def create_demo() -> gr.Blocks:
|
| 44 |
|
requirements.txt
CHANGED
|
@@ -1,9 +1,7 @@
|
|
| 1 |
gradio
|
| 2 |
-
torch
|
| 3 |
-
torchvision
|
| 4 |
diffusers
|
| 5 |
transformers
|
| 6 |
accelerate
|
| 7 |
spaces
|
| 8 |
-
oneflow -f https://github.com/siliconflow/oneflow_releases/releases/expanded_assets/community_cu121
|
| 9 |
-
onediff
|
|
|
|
| 1 |
gradio
|
| 2 |
+
torch
|
| 3 |
+
torchvision
|
| 4 |
diffusers
|
| 5 |
transformers
|
| 6 |
accelerate
|
| 7 |
spaces
|
|
|
|
|
|