zhiweili commited on
Commit
e2a532c
Β·
1 Parent(s): 5018a4b

add onediffx

Browse files
Files changed (2) hide show
  1. app_onediff.py +6 -4
  2. requirements.txt +2 -4
app_onediff.py CHANGED
@@ -10,8 +10,10 @@ from diffusers import (
10
  AutoencoderTiny,
11
  )
12
 
13
- import oneflow as flow
14
- from onediff.infer_compiler import oneflow_compile
 
 
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
- base_pipe.unet = oneflow_compile(base_pipe.unet)
39
- # base_pipe.vae.decoder = oneflow_compile(base_pipe.vae.decoder)
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 -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
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