forked from adieyal/sd-dynamic-prompts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
28 lines (20 loc) · 666 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
26
27
28
import logging
from pathlib import Path
logger = logging.getLogger(__name__)
def is_empty_line(line):
return line is None or line.strip() == "" or line.strip().startswith("#")
def check_versions() -> None:
requirements = [
line
for line in (Path(__file__).parent / "requirements.txt")
.read_text()
.splitlines()
if not is_empty_line(line)
]
pip_command = f"install {' '.join(requirements)}"
try:
from launch import run_pip # from AUTOMATIC1111
run_pip(pip_command, desc="sd-dynamic-prompts requirements.txt")
except Exception as e:
logger.exception(e)
check_versions()