diff --git a/__init__.py b/__init__.py index b6a250de..2daa216c 100644 --- a/__init__.py +++ b/__init__.py @@ -18,7 +18,7 @@ from server import PromptServer from .glob import manager_core as core import cm_global -version = [2, 18, 2] +version = [2, 18, 3] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') print(f"### Loading: ComfyUI-Manager ({version_str})") @@ -78,34 +78,9 @@ class ManagerFuncsInComfyUI(core.ManagerFuncs): core.manager_funcs = ManagerFuncsInComfyUI() -try: - import git -except: - my_path = os.path.dirname(__file__) - requirements_path = os.path.join(my_path, "requirements.txt") - - print(f"## ComfyUI-Manager: installing dependencies") - - core.manager_funcs.run_script([sys.executable, '-s', '-m', 'pip', 'install', '-r', requirements_path]) - - try: - import git - except: - print(f"## [ERROR] ComfyUI-Manager: Attempting to reinstall dependencies using an alternative method.") - core.manager_funcs.run_script([sys.executable, '-s', '-m', 'pip', 'install', '--user', '-r', requirements_path]) - - try: - import git - except: - print(f"## [ERROR] ComfyUI-Manager: Failed to install the GitPython package in the correct Python environment. Please install it manually in the appropriate environment. (You can seek help at https://app.element.io/#/room/%23comfyui_space%3Amatrix.org)") - - print(f"## ComfyUI-Manager: installing dependencies done.") - - - - sys.path.append('../..') + from torchvision.datasets.utils import download_url diff --git a/prestartup_script.py b/prestartup_script.py index 68d8a9b1..e419f306 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -300,6 +300,30 @@ except Exception as e: print(f"[ComfyUI-Manager] Logging failed: {e}") +try: + import git +except: + my_path = os.path.dirname(__file__) + requirements_path = os.path.join(my_path, "requirements.txt") + + print(f"## ComfyUI-Manager: installing dependencies. (GitPython)") + + result = subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'install', '-r', requirements_path]) + + try: + import git + except: + print(f"## [ERROR] ComfyUI-Manager: Attempting to reinstall dependencies using an alternative method.") + result = subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'install', '--user', '-r', requirements_path]) + + try: + import git + except: + print(f"## [ERROR] ComfyUI-Manager: Failed to install the GitPython package in the correct Python environment. Please install it manually in the appropriate environment. (You can seek help at https://app.element.io/#/room/%23comfyui_space%3Amatrix.org)") + + print(f"## ComfyUI-Manager: installing dependencies done.") + + print("** ComfyUI startup time:", datetime.datetime.now()) print("** Platform:", platform.system()) print("** Python version:", sys.version)