|
|
|
@@ -42,7 +42,7 @@ import manager_downloader
|
|
|
|
|
from node_package import InstalledNodePackage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
version_code = [3, 16]
|
|
|
|
|
version_code = [3, 17]
|
|
|
|
|
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
|
|
|
|
@@ -325,6 +325,8 @@ def normalize_channel(channel):
|
|
|
|
|
return None
|
|
|
|
|
elif channel.startswith('https://'):
|
|
|
|
|
return channel
|
|
|
|
|
elif channel.startswith('http://') and get_config()['http_channel_enabled'] == True:
|
|
|
|
|
return channel
|
|
|
|
|
|
|
|
|
|
tmp_dict = get_channel_dict()
|
|
|
|
|
channel_url = tmp_dict.get(channel)
|
|
|
|
@@ -1557,6 +1559,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)
|
|
|
|
@@ -1585,6 +1588,7 @@ def read_config():
|
|
|
|
|
manager_util.use_uv = default_conf['use_uv'].lower() == 'true' if 'use_uv' in default_conf else False
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
'http_channel_enabled': default_conf['http_channel_enabled'].lower() == 'true' if 'http_channel_enabled' in default_conf else False,
|
|
|
|
|
'preview_method': default_conf['preview_method'] if 'preview_method' in default_conf else manager_funcs.get_current_preview_method(),
|
|
|
|
|
'git_exe': default_conf['git_exe'] if 'git_exe' in default_conf else '',
|
|
|
|
|
'use_uv': default_conf['use_uv'].lower() == 'true' if 'use_uv' in default_conf else False,
|
|
|
|
@@ -1597,12 +1601,14 @@ 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,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
except Exception:
|
|
|
|
|
manager_util.use_uv = False
|
|
|
|
|
return {
|
|
|
|
|
'http_channel_enabled': False,
|
|
|
|
|
'preview_method': manager_funcs.get_current_preview_method(),
|
|
|
|
|
'git_exe': '',
|
|
|
|
|
'use_uv': False,
|
|
|
|
@@ -1615,6 +1621,7 @@ def read_config():
|
|
|
|
|
'model_download_by_agent': False,
|
|
|
|
|
'downgrade_blacklist': '',
|
|
|
|
|
'skip_migration_check': False,
|
|
|
|
|
'always_lazy_install': False,
|
|
|
|
|
'security_level': 'normal',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1624,6 +1631,8 @@ def get_config():
|
|
|
|
|
|
|
|
|
|
if cached_config is None:
|
|
|
|
|
cached_config = read_config()
|
|
|
|
|
if cached_config['http_channel_enabled']:
|
|
|
|
|
print("[ComfyUI-Manager] Warning: http channel enabled, make sure server in secure env")
|
|
|
|
|
|
|
|
|
|
return cached_config
|
|
|
|
|
|
|
|
|
@@ -1672,7 +1681,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)
|
|
|
|
|
|
|
|
|
@@ -2081,14 +2092,8 @@ async def get_data_by_mode(mode, filename, channel_url=None):
|
|
|
|
|
cache_uri = str(manager_util.simple_hash(uri))+'_'+filename
|
|
|
|
|
cache_uri = os.path.join(manager_util.cache_dir, cache_uri)
|
|
|
|
|
|
|
|
|
|
if mode == "cache":
|
|
|
|
|
if manager_util.is_file_created_within_one_day(cache_uri):
|
|
|
|
|
if mode == "cache" and manager_util.is_file_created_within_one_day(cache_uri):
|
|
|
|
|
json_obj = await manager_util.get_data(cache_uri)
|
|
|
|
|
else:
|
|
|
|
|
json_obj = await manager_util.get_data(uri)
|
|
|
|
|
with manager_util.cache_lock:
|
|
|
|
|
with open(cache_uri, "w", encoding='utf-8') as file:
|
|
|
|
|
json.dump(json_obj, file, indent=4, sort_keys=True)
|
|
|
|
|
else:
|
|
|
|
|
json_obj = await manager_util.get_data(uri)
|
|
|
|
|
with manager_util.cache_lock:
|
|
|
|
|