-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
62 lines (47 loc) · 1.81 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import argparse
import os, sys
def setup(clone_diffusers=False, install_editable_diffusers=False):
if clone_diffusers:
clone_diffusers_library()
if install_editable_diffusers:
install_editable_diffusers_library()
move_new_pipeline_to_diffusers()
def clone_diffusers_library():
wget_link = "https://github.com/huggingface/diffusers/archive/refs/tags/v0.13.0.zip"
os.system(f"wget {wget_link}")
os.system("unzip v0.13.0.zip")
os.system("rm v0.13.0.zip")
print("Successfully clone the stable version of diffusers (v0.13.0)")
def install_editable_diffusers_library():
os.system("cd diffusers-0.13.0 && pip install -e \".[torch]\" && cd ..")
print("Successfully install the diffusers library (v0.13.0) in editable mode")
def move_new_pipeline_to_diffusers():
source2destination = [
(
"noise_comparative_analysis/latent_diffusion_noise_comparative_analysis.py",
"diffusers-0.13.0/examples/community/",
),
(
"noise_comparative_analysis/ddim_noise_comparative_analysis.py",
"diffusers-0.13.0/examples/community/",
),
]
for source, destination in source2destination:
os.system(f"cp {source} {destination}")
print(f"Successfully move the {len(source2destination)} new pipelines to diffusers")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--clone_diffusers",
action="store_true",
default=False,
help="Clone the stable version of diffusers (v0.13.0)",
)
parser.add_argument(
"--install_editable_diffusers",
action="store_true",
default=False,
help="Install the diffusers library (v0.13.0) in editable mode",
)
args = parser.parse_args()
setup(**vars(args))