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