Skip to content

Commit

Permalink
feat: add default_cache_is_channel_url config option
Browse files Browse the repository at this point in the history
  • Loading branch information
ltdrdata committed Feb 2, 2025
1 parent d7d31a1 commit f15032f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ The following settings are applied based on the section marked as `is_default`.
[default]
git_exe = <Manually specify the path to the git executable. If left empty, the default git executable path will be used.>
use_uv = <Use uv instead of pip for dependency installation.>
channel_url = https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main
default_cache_is_channel_url = <Determines whether to retrieve the DB designated as channel_url at startup>
bypass_ssl = <Set to True if SSL errors occur to disable SSL.>
file_logging = <Configure whether to create a log file used by ComfyUI-Manager.>
windows_selector_event_loop_policy = <If an event loop error occurs on Windows, set this to True.>
Expand Down
4 changes: 3 additions & 1 deletion glob/manager_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from node_package import InstalledNodePackage


version_code = [3, 17, 3]
version_code = [3, 17, 4]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')


Expand Down Expand Up @@ -1593,6 +1593,7 @@ def read_config():
'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,
'channel_url': default_conf['channel_url'] if 'channel_url' in default_conf else DEFAULT_CHANNEL,
'default_cache_is_channel_url': default_conf['default_cache_is_channel_url'].lower() == 'true' if 'default_cache_is_channel_url' in default_conf else False,
'share_option': default_conf['share_option'] if 'share_option' in default_conf else 'all',
'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,
Expand All @@ -1613,6 +1614,7 @@ def read_config():
'git_exe': '',
'use_uv': False,
'channel_url': DEFAULT_CHANNEL,
'default_cache_is_channel_url': False,
'share_option': 'all',
'bypass_ssl': False,
'file_logging': True,
Expand Down
6 changes: 5 additions & 1 deletion glob/manager_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,11 @@ def confirm_try_install(sender, custom_node_url, msg):
async def default_cache_update():
channel_url = core.get_config()['channel_url']
async def get_cache(filename):
uri = f"{channel_url}/{filename}"
if core.get_config()['default_cache_is_channel_url']:
uri = f"{channel_url}/{filename}"
else:
uri = f"{core.DEFAULT_CHANNEL}/{filename}"

cache_uri = str(manager_util.simple_hash(uri)) + '_' + filename
cache_uri = os.path.join(manager_util.cache_dir, cache_uri)

Expand Down
7 changes: 6 additions & 1 deletion glob/manager_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ async def get_data(uri, silent=False):
with open(uri, "r", encoding="utf-8") as f:
json_text = f.read()

json_obj = json.loads(json_text)
try:
json_obj = json.loads(json_text)
except Exception as e:
logging.error(f"[ComfyUI-Manager] An error occurred while fetching '{uri}': {e}")

return {}

if not silent:
print(" [DONE]")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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.3"
version = "3.17.4"
license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]

Expand Down

0 comments on commit f15032f

Please sign in to comment.