zhiweili commited on
Commit
52763ae
Β·
1 Parent(s): 0f25938

test cuda12

Browse files
Files changed (2) hide show
  1. app_onediff.py +5 -3
  2. 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/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"
@@ -38,7 +40,7 @@ base_pipe.scheduler = DDPMScheduler.from_pretrained(
38
  subfolder="scheduler",
39
  )
40
 
41
- base_pipe = compile_pipe(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