improved: move cache dir to user directory

This commit is contained in:
Dr.Lt.Data 2025-01-05 12:35:38 +09:00
parent bdad599f36
commit 3075764402
4 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,8 @@
"""
description:
`manager_core` contains the core implementation of the management functions in ComfyUI-Manager.
"""
import json
import os
import sys
@ -36,7 +41,7 @@ import manager_downloader
from node_package import InstalledNodePackage
version_code = [3, 3, 10]
version_code = [3, 3, 11]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
@ -177,6 +182,10 @@ def update_user_directory(user_dir):
manager_channel_list_path = os.path.join(manager_files_path, 'channels.list')
manager_pip_overrides_path = os.path.join(manager_files_path, "pip_overrides.json")
manager_components_path = os.path.join(manager_files_path, "components")
manager_util.cache_dir = os.path.join(manager_files_path, "cache")
if not os.path.exists(manager_util.cache_dir):
os.makedirs(manager_util.cache_dir)
try:
import folder_paths

View File

@ -1401,7 +1401,6 @@ async def default_cache_update():
# else:
# logging.info("[ComfyUI-Manager] Migration check is skipped...")
threading.Thread(target=lambda: asyncio.run(default_cache_update())).start()
if not os.path.exists(core.manager_config_path):

View File

@ -1,3 +1,8 @@
"""
description:
`manager_util` is the lightest module shared across the prestartup_script, main code, and cm-cli of ComfyUI-Manager.
"""
import aiohttp
import json
import threading
@ -10,7 +15,7 @@ import re
cache_lock = threading.Lock()
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
cache_dir = os.path.join(comfyui_manager_path, '.cache')
cache_dir = os.path.join(comfyui_manager_path, '.cache') # This path is also updated together in **manager_core.update_user_directory**.
# DON'T USE StrictVersion - cannot handle pre_release version

View File

@ -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.3.10"
version = "3.3.11"
license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]