forked from TemryL/ComfyUI-IDM-VTON
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
25 lines (18 loc) · 781 Bytes
/
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
import sys
import os.path
import subprocess
from huggingface_hub import snapshot_download
CUSTOM_NODES_PATH = os.path.dirname(os.path.abspath(__file__))
WEIGHTS_PATH = os.path.join(CUSTOM_NODES_PATH, "models")
HF_REPO_ID = "yisol/IDM-VTON"
def build_pip_install_cmds(args):
if "python_embeded" in sys.executable or "python_embedded" in sys.executable:
return [sys.executable, '-s', '-m', 'pip', 'install'] + args
else:
return [sys.executable, '-m', 'pip', 'install'] + args
def ensure_package():
cmds = build_pip_install_cmds(['-r', 'requirements.txt'])
subprocess.run(cmds, cwd=CUSTOM_NODES_PATH)
if __name__ == "__main__":
ensure_package()
snapshot_download(repo_id=HF_REPO_ID, local_dir=WEIGHTS_PATH, local_dir_use_symlinks=False)