From b5cdcb75b451dabdd76f6f5095ce8d668f3a164f Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sun, 2 Feb 2025 18:01:16 +0900 Subject: [PATCH] feat: add `always_lazy_install` config option. --- README.md | 1 + glob/manager_core.py | 11 ++++++++--- pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 51415fd3..1c2d6500 100644 --- a/README.md +++ b/README.md @@ -263,6 +263,7 @@ The following settings are applied based on the section marked as `is_default`. model_download_by_agent = downgrade_blacklist = security_level = + always_lazy_install = ``` ## Additional Feature diff --git a/glob/manager_core.py b/glob/manager_core.py index 11d9ef10..c8027bd4 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -42,7 +42,7 @@ import manager_downloader from node_package import InstalledNodePackage -version_code = [3, 16] +version_code = [3, 16, 1] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') @@ -174,7 +174,7 @@ git_script_path = os.path.join(manager_util.comfyui_manager_path, "git_helper.py manager_files_path = None manager_config_path = None manager_channel_list_path = None -manager_startup_script_path = None +manager_startup_script_path:str = None manager_snapshot_path = None manager_pip_overrides_path = None manager_components_path = None @@ -1557,6 +1557,7 @@ def write_config(): 'downgrade_blacklist': get_config()['downgrade_blacklist'], 'security_level': get_config()['security_level'], 'skip_migration_check': get_config()['skip_migration_check'], + 'always_lazy_install': get_config()['always_lazy_install'] } directory = os.path.dirname(manager_config_path) @@ -1597,6 +1598,7 @@ def read_config(): 'model_download_by_agent': default_conf['model_download_by_agent'].lower() == 'true' if 'model_download_by_agent' in default_conf else False, 'downgrade_blacklist': default_conf['downgrade_blacklist'] if 'downgrade_blacklist' in default_conf else '', 'skip_migration_check': default_conf['skip_migration_check'].lower() == 'true' if 'skip_migration_check' in default_conf else False, + 'always_lazy_install': default_conf['always_lazy_install'].lower() == 'true' if 'always_lazy_install' in default_conf else False, 'security_level': security_level, } @@ -1615,6 +1617,7 @@ def read_config(): 'model_download_by_agent': False, 'downgrade_blacklist': '', 'skip_migration_check': False, + 'always_lazy_install': False, 'security_level': 'normal', } @@ -1672,7 +1675,9 @@ def switch_to_default_branch(repo): def try_install_script(url, repo_path, install_cmd, instant_execution=False): - if not instant_execution and ((len(install_cmd) > 0 and install_cmd[0].startswith('#')) or (platform.system() == "Windows" and comfy_ui_commit_datetime.date() >= comfy_ui_required_commit_datetime.date())): + if not instant_execution and ( + (len(install_cmd) > 0 and install_cmd[0].startswith('#')) or platform.system() == "Windows" or get_config()['always_lazy_install'] + ): if not os.path.exists(manager_startup_script_path): os.makedirs(manager_startup_script_path) diff --git a/pyproject.toml b/pyproject.toml index 5829b2cc..4c90566d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-manager" description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." -version = "3.16" +version = "3.16.1" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]