-
Notifications
You must be signed in to change notification settings - Fork 10
/
__init__.py
54 lines (47 loc) · 1.97 KB
/
__init__.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
import os
import site
now_dir = os.path.dirname(os.path.abspath(__file__))
site_packages_roots = []
for path in site.getsitepackages():
if "packages" in path:
site_packages_roots.append(path)
if(site_packages_roots==[]):site_packages_roots=["%s/runtime/Lib/site-packages" % now_dir]
#os.environ["OPENBLAS_NUM_THREADS"] = "4"
for site_packages_root in site_packages_roots:
if os.path.exists(site_packages_root):
try:
with open("%s/VExpress.pth" % (site_packages_root), "w") as f:
f.write(
"%s\n%s/V_Express\n"
% (now_dir,now_dir)
)
break
except PermissionError:
raise PermissionError
if os.path.isfile("%s/VExpress.pth" % (site_packages_root)):
print("!!!VExpress path was added to " + "%s/VExpress.pth" % (site_packages_root)
+ "\n if meet `No module` error,try `python main.py` again, don't be foolish to pip install modules")
from huggingface_hub import snapshot_download
if not os.path.isfile(os.path.join(now_dir,"model_ckpts","v-express","v_kps_guider.pth")):
snapshot_download(repo_id="tk93/V-Express",local_dir=now_dir,allow_patterns=["*.onnx", "*.json","*.pth","*.bin"])
else:
print("V-Express use cache models,make sure your 'model_ckpts' complete")
from .nodes import LoadVideo,PreViewVideo,VExpress,LoadImagePath, LoadAudioPath
WEB_DIRECTORY = "./web"
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"LoadAudioPath": LoadAudioPath,
"LoadVideo": LoadVideo,
"PreViewVideo": PreViewVideo,
"VExpress": VExpress,
"LoadImagePath": LoadImagePath
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"VExpress": "VExpress Node",
"LoadVideo": "Video Loader",
"PreViewVideo": "PreView Video",
"LoadImagePath": "LoadImagePath",
"LoadAudioPath": "LoadAudioPath"
}