Skip to content

Commit

Permalink
prevent unnecessary network calls so that aipg works when offline
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Schuettler <markus.schuettler@tngtech.com>
  • Loading branch information
mschuettlerTNG authored Feb 17, 2025
1 parent c23dde9 commit edeaaae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions service/comfyui_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ def _install_pip_requirements(requirements_txt_path: str):


def install_pypi_package(packageSpecifier: str):
installed_packages = aipg_utils.call_subprocess(f"{service_config.comfyui_python_exe} -m pip list")
if packageSpecifier.endswith(".whl"):
package_name = packageSpecifier.split("/")[-1].split("-")[0]
else:
package_name = packageSpecifier.split("==")[0]
if package_name in installed_packages:
logging.info(f"package {package_name} already installed. Omitting installation")
return
if packageSpecifier.endswith(".whl"):
pip_specifier = os.path.abspath(os.path.join(service_config.comfyui_python_env, packageSpecifier.split("/")[-1]))
try:
Expand Down

0 comments on commit edeaaae

Please sign in to comment.