use configured db_mode instead of hardcoded 'remote' at startup

This allows users to set db_mode='cache' in config to avoid downloading
fresh data on every startup, which should help with startup performance
and reduce unnecessary network requests.
This commit is contained in:
Mark Merritt 2025-09-16 12:17:41 -07:00
parent a0b14d4127
commit e26927a881
2 changed files with 5 additions and 4 deletions

View File

@ -809,7 +809,7 @@ class UnifiedManager:
dont_wait = True
# reload 'cnr_map' and 'repo_cnr_map'
cnrs = await cnr_utils.get_cnr_data(cache_mode=cache_mode=='cache', dont_wait=dont_wait)
cnrs = await cnr_utils.get_cnr_data(cache_mode=True, dont_wait=dont_wait)
for x in cnrs:
self.cnr_map[x['id']] = x

View File

@ -1754,9 +1754,10 @@ async def default_cache_update():
if core.get_config()['network_mode'] == 'private':
logging.info("[ComfyUI-Manager] The private comfyregistry is not yet supported in `network_mode=private`.")
else:
# load at least once
await core.unified_manager.reload('remote', dont_wait=False)
await core.unified_manager.get_custom_nodes(channel_url, 'remote')
# use configured db_mode for startup data loading
db_mode = core.get_config()['db_mode']
await core.unified_manager.reload(db_mode, dont_wait=False)
await core.unified_manager.get_custom_nodes(channel_url, db_mode)
logging.info("[ComfyUI-Manager] All startup tasks have been completed.")