From 62469a4dd96e32509171aad74fcae8d2bb0ec593 Mon Sep 17 00:00:00 2001 From: Mel Massadian Date: Wed, 11 Dec 2024 00:09:43 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20i/o=20sidebar=20for=20cus?= =?UTF-8?q?tom=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In utils I uses a constant for these which doesn't update with the global... calling the getters should solve that. This issue is probably in other places where I use these utils. fixes #219 --- endpoint.py | 7 +++++-- utils.py | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/endpoint.py b/endpoint.py index 28c4455..df112a9 100644 --- a/endpoint.py +++ b/endpoint.py @@ -4,6 +4,7 @@ import sys from pathlib import Path from typing import Any, Literal +import folder_paths from aiohttp import web from .log import mklog @@ -13,8 +14,6 @@ from .utils import ( build_glob_patterns, glob_multiple, import_install, - input_dir, - output_dir, reqs_map, run_command, styles_dir, @@ -70,6 +69,10 @@ def ACTIONS_getUserImages( # return {"error": "Session not authorized to getInputs"} imgs = {} + + input_dir = Path(folder_paths.get_input_directory()) + output_dir = Path(folder_paths.get_output_directory()) + entry_dir = input_dir if mode == "input" else output_dir supported = ["png", "jpg", "jpeg", "webp", "gif"] diff --git a/utils.py b/utils.py index f6056f7..31f51fd 100644 --- a/utils.py +++ b/utils.py @@ -498,8 +498,12 @@ here = Path(__file__).parent.absolute() # - Construct the absolute path to the ComfyUI directory comfy_dir = Path(folder_paths.base_path) models_dir = Path(folder_paths.models_dir) + + +# NOTE: these aren't reliable, better call the getters each time output_dir = Path(folder_paths.output_directory) input_dir = Path(folder_paths.input_directory) + styles_dir = comfy_dir / "styles" session_id = str(uuid.uuid4()) # - Construct the path to the font file