feat: add always_lazy_install config option.

This commit is contained in:
Dr.Lt.Data 2025-02-02 18:01:16 +09:00
parent bd9aae40b8
commit b5cdcb75b4
3 changed files with 10 additions and 4 deletions

View File

@ -263,6 +263,7 @@ The following settings are applied based on the section marked as `is_default`.
model_download_by_agent = <When downloading models, use an agent instead of torchvision_download_url.>
downgrade_blacklist = <Set a list of packages to prevent downgrades. List them separated by commas.>
security_level = <Set the security level.>
always_lazy_install = <Whether to perform dependency installation on restart even in environments other than Windows.>
```
## Additional Feature

View File

@ -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)

View File

@ -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"]