From dedd32d29ea3bc52b6589930827c5c65f1354041 Mon Sep 17 00:00:00 2001 From: toto Date: Sat, 16 Dec 2023 19:29:37 +0800 Subject: [PATCH] update --- __init__.py | 4 ++-- install.py | 15 +++++++-------- requirements.txt | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/__init__.py b/__init__.py index 885290f..c7a7b37 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,5 @@ -import os +import os, sys + main_path = os.path.dirname(__file__) sys.path.append(main_path) @@ -21,7 +22,6 @@ def urldownload_progressbar(url, file_path): progress_bar.update(len(chunk)) progress_bar.close() - print("Start Setting weights") for url, filename in zip(urls, filenames): diff --git a/install.py b/install.py index e4522ec..01eb8f8 100644 --- a/install.py +++ b/install.py @@ -11,6 +11,7 @@ import re main_path = os.path.dirname(__file__) sys.path.append(main_path) +windows_not_install = ['mmcv_full'] def handle_stream(stream, is_stdout): stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace') @@ -21,7 +22,6 @@ def handle_stream(stream, is_stdout): else: print(msg, end="", file=sys.stderr) - def process_wrap(cmd_str, cwd=None, handler=None): print(f"[Impact Pack] EXECUTE: {cmd_str} in '{cwd}'") process = subprocess.Popen(cmd_str, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1) @@ -40,11 +40,9 @@ def process_wrap(cmd_str, cwd=None, handler=None): return process.wait() - # --- pip_list = None - def get_installed_packages(): global pip_list if pip_list is None: @@ -57,7 +55,6 @@ def get_installed_packages(): return pip_list - def is_installed(name): name = name.strip() pattern = r'([^<>!=]+)([<>!=]=?)' @@ -69,7 +66,6 @@ def is_installed(name): result = name.lower() in get_installed_packages() return result - def check_and_install_requirements(file_path): print(f"req_path: {file_path}") if os.path.exists(file_path): @@ -77,13 +73,16 @@ def check_and_install_requirements(file_path): lines = file.readlines() for line in lines: if not is_installed(line): - process_wrap(pip_install + [line], cwd=main_path) - return False + if platform.system() == "Windows" and line in windows_not_install: + continue + else: + process_wrap(pip_install + [line], cwd=main_path) + return False return True - try: import platform + print("### ComfyUI-Impact-Pack: Check dependencies") if "python_embeded" in sys.executable or "python_embedded" in sys.executable: pip_install = [sys.executable, '-s', '-m', 'pip', 'install'] diff --git a/requirements.txt b/requirements.txt index e1ed11f..1cb78dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ scikit-image matplotlib insightface diffusers==0.18.2 +mmcv_full