File size: 666 Bytes
8da9c80 | 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 | 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()
|