From 772f464af94747a501500b263fd5cb803eaa7ff2 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Mon, 13 May 2024 21:19:23 +0900 Subject: [PATCH] potential errors of bool values in config.ini is fixed --- glob/manager_core.py | 14 +++++++------- prestartup_script.py | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index 727af44..7f04958 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -23,7 +23,7 @@ sys.path.append(glob_path) import cm_global from manager_util import * -version = [2, 32, 4] +version = [2, 32, 6] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) @@ -223,15 +223,15 @@ def read_config(): 'git_exe': default_conf['git_exe'] if 'git_exe' in default_conf else '', 'channel_url': default_conf['channel_url'] if 'channel_url' in default_conf else 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main', 'share_option': default_conf['share_option'] if 'share_option' in default_conf else 'all', - 'bypass_ssl': default_conf['bypass_ssl'] if 'bypass_ssl' in default_conf else 'False', - 'file_logging': default_conf['file_logging'] if 'file_logging' in default_conf else 'True', + 'bypass_ssl': default_conf['bypass_ssl'].lower() == 'true' if 'bypass_ssl' in default_conf else False, + 'file_logging': default_conf['file_logging'].lower() == 'true' if 'file_logging' in default_conf else True, 'default_ui': default_conf['default_ui'] if 'default_ui' in default_conf else 'none', 'component_policy': default_conf['component_policy'] if 'component_policy' in default_conf else 'workflow', 'double_click_policy': default_conf['double_click_policy'] if 'double_click_policy' in default_conf else 'copy-all', - 'windows_selector_event_loop_policy': default_conf['windows_selector_event_loop_policy'] if 'windows_selector_event_loop_policy' in default_conf else 'False', - 'model_download_by_agent': default_conf['model_download_by_agent'] if 'model_download_by_agent' in default_conf else 'False', + 'windows_selector_event_loop_policy': default_conf['windows_selector_event_loop_policy'].lower() == 'true' if 'windows_selector_event_loop_policy' in default_conf else False, + '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 '', - 'disable_unsecure_features': default_conf['disable_unsecure_features'] if 'disable_unsecure_features' in default_conf else 'False', + 'disable_unsecure_features': default_conf['disable_unsecure_features'].lower() == 'true' if 'disable_unsecure_features' in default_conf else False, } except Exception: @@ -1192,4 +1192,4 @@ def unzip(model_path): def is_unsecure_features_disabled(): - return get_config()['disable_unsecure_features'].lower() == 'true' + return get_config()['disable_unsecure_features'] diff --git a/prestartup_script.py b/prestartup_script.py index 024634c..4cf03b4 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -49,7 +49,7 @@ def check_file_logging(): config.read(config_path) default_conf = config['default'] - if 'file_logging' in default_conf and default_conf['file_logging'].lower() == 'false': + if 'file_logging' in default_conf and not default_conf['file_logging']: enable_file_logging = False except Exception: pass @@ -364,7 +364,7 @@ def check_bypass_ssl(): config.read(config_path) default_conf = config['default'] - if 'bypass_ssl' in default_conf and default_conf['bypass_ssl'].lower() == 'true': + if 'bypass_ssl' in default_conf and default_conf['bypass_ssl']: print(f"[ComfyUI-Manager] WARN: Unsafe - SSL verification bypass option is Enabled. (see ComfyUI-Manager/config.ini)") ssl._create_default_https_context = ssl._create_unverified_context # SSL certificate error fix. except Exception: @@ -586,7 +586,7 @@ def check_windows_event_loop_policy(): config.read(config_path) default_conf = config['default'] - if 'windows_selector_event_loop_policy' in default_conf and default_conf['windows_selector_event_loop_policy'].lower() == 'true': + if 'windows_selector_event_loop_policy' in default_conf and default_conf['windows_selector_event_loop_policy']: try: import asyncio import asyncio.windows_events