forked from williamyang1991/Rerender_A_Video
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
78 lines (60 loc) · 2.11 KB
/
install.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import os
import platform
import requests
def build_ebsynth():
if os.path.exists('deps/ebsynth/bin/ebsynth'):
print('Ebsynth has been built.')
return
os_str = platform.system()
if os_str == 'Windows':
print('Build Ebsynth Windows 64 bit.',
'If you want to build for 32 bit, please modify install.py.')
cmd = '.\\build-win64-cpu+cuda.bat'
exe_file = 'deps/ebsynth/bin/ebsynth.exe'
elif os_str == 'Linux':
cmd = 'bash build-linux-cpu+cuda.sh'
exe_file = 'deps/ebsynth/bin/ebsynth'
elif os_str == 'Darwin':
cmd = 'sh build-macos-cpu_only.sh'
exe_file = 'deps/ebsynth/bin/ebsynth.app'
else:
print('Cannot recognize OS. Ebsynth installation stopped.')
return
os.chdir('deps/ebsynth')
print(cmd)
os.system(cmd)
os.chdir('../..')
if os.path.exists(exe_file):
print('Ebsynth installed successfully.')
else:
print('Failed to install Ebsynth.')
def download(url, dir, name=None):
os.makedirs(dir, exist_ok=True)
if name is None:
name = url.split('/')[-1]
path = os.path.join(dir, name)
if not os.path.exists(path):
print(f'Install {name} ...')
open(path, 'wb').write(requests.get(url).content)
print('Install successfully.')
def download_gmflow_ckpt():
url = ('https://huggingface.co/PKUWilliamYang/Rerender/'
'resolve/main/models/gmflow_sintel-0c07dcb3.pth')
download(url, 'models')
def download_controlnet_canny():
url = ('https://huggingface.co/lllyasviel/ControlNet/'
'resolve/main/models/control_sd15_canny.pth')
download(url, 'models')
def download_controlnet_hed():
url = ('https://huggingface.co/lllyasviel/ControlNet/'
'resolve/main/models/control_sd15_hed.pth')
download(url, 'models')
def download_vae():
url = ('https://huggingface.co/stabilityai/sd-vae-ft-mse-original'
'/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt')
download(url, 'models')
build_ebsynth()
download_gmflow_ckpt()
download_controlnet_canny()
download_controlnet_hed()
download_vae()