From ced93b05257637b10cf0b77984c4bf1e8694b48c Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sun, 2 Feb 2025 23:41:01 +0900 Subject: [PATCH] fixed: prestartup_script.py error when config.ini is not exists --- glob/manager_core.py | 2 +- prestartup_script.py | 34 +++++++++++++--------------------- pyproject.toml | 2 +- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index 51e0d76a..423d6712 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, 17, 5] +version_code = [3, 17, 6] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') diff --git a/prestartup_script.py b/prestartup_script.py index ce85f5d5..b4009a9a 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -57,22 +57,6 @@ def is_import_failed_extension(name): return name in import_failed_extensions -def check_file_logging(): - global enable_file_logging - try: - import configparser - config = configparser.ConfigParser() - config.read(manager_config_path) - default_conf = config['default'] - - if 'file_logging' in default_conf and default_conf['file_logging'].lower() == 'false': - enable_file_logging = False - except Exception: - pass - - -check_file_logging() - comfy_path = os.environ.get('COMFYUI_PATH') comfy_base_path = os.environ.get('COMFYUI_FOLDERS_BASE_PATH') @@ -107,19 +91,27 @@ default_conf = {} def read_config(): global default_conf - import configparser - config = configparser.ConfigParser() - config.read(manager_config_path) - default_conf = config['default'] + try: + import configparser + config = configparser.ConfigParser() + config.read(manager_config_path) + default_conf = config['default'] + except Exception: + pass def read_uv_mode(): if 'use_uv' in default_conf: manager_util.use_uv = default_conf['use_uv'] +def check_file_logging(): + global enable_file_logging + if 'file_logging' in default_conf and default_conf['file_logging'].lower() == 'false': + enable_file_logging = False + read_config() read_uv_mode() - +check_file_logging() cm_global.pip_overrides = {'numpy': 'numpy<2', 'ultralytics': 'ultralytics==8.3.40'} if os.path.exists(manager_pip_overrides_path): diff --git a/pyproject.toml b/pyproject.toml index b7e9cce3..a3bdd4ff 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.17.5" +version = "3.17.6" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]