feat(system): resolve every library path in one place

utils/library_location.py decides where the library lives: the
PROMPT_MANAGER_DATA_DIR folder (validated: absolute, never inside a folder
ComfyUI or Prompt Manager serves), an explicit database.default_path as
before, a node-folder library that was not moved, else ComfyUI's
user/__promptmanager. The database, diagnostics, config.json, logs and the
LoRA image cache all ask it, so a new install never writes into the node
folder and an existing one keeps every path until the user moves it.
"Keep it here" is persisted as library.keep_in_node_folder.
This commit is contained in:
Vito Sansevero
2026-10-24 07:16:57 -07:00
parent 06099579e6
commit 2c3d3a58c4
8 changed files with 1012 additions and 48 deletions
+14 -3
View File
@@ -567,10 +567,21 @@ def download_civitai_images(
def get_lora_image_cache_dir() -> Path:
"""Get the directory used to cache downloaded LoRA example images."""
# Store in the extension's own directory
"""Get the directory used to cache downloaded LoRA example images.
``<data folder>/data/lora_images`` (``utils.library_location``): the node
folder for a library that was not moved, else ComfyUI's
``user/__promptmanager``.
"""
try:
from ..utils import library_location
except ImportError:
from utils import library_location
ext_root = Path(__file__).resolve().parent.parent
cache = ext_root / "data" / "lora_images"
cache = Path(
library_location.cache_dir("lora_images", extension_root=str(ext_root))
)
cache.mkdir(parents=True, exist_ok=True)
return cache