-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.py
More file actions
22 lines (19 loc) · 787 Bytes
/
install.py
File metadata and controls
22 lines (19 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import launch
import os
current_dir = os.path.dirname(os.path.realpath(__file__))
req_file = os.path.join(current_dir, "requirements.txt")
with open(req_file) as file:
for lib in file:
lib = lib.strip()
if not lib or lib.startswith('#'):
continue
if not launch.is_installed(lib):
# Special handling for nvdiffrast (not on PyPI, requires --no-build-isolation)
if lib == 'nvdiffrast':
launch.run_pip(
"install git+https://github.com/NVlabs/nvdiffrast.git --no-build-isolation",
"sd-instantmesh requirement: nvdiffrast")
else:
launch.run_pip(
f"install {lib}",
f"sd-instantmesh requirement: {lib}")