diff --git a/modules/impact/config.py b/modules/impact/config.py index b64f16c..c453140 100644 --- a/modules/impact/config.py +++ b/modules/impact/config.py @@ -1,7 +1,7 @@ import configparser import os -version_code = [8, 5, 1] +version_code = [8, 5, 2] version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') dependency_version = 24 diff --git a/modules/impact/impact_server.py b/modules/impact/impact_server.py index e6a232d..35d7727 100644 --- a/modules/impact/impact_server.py +++ b/modules/impact/impact_server.py @@ -78,9 +78,13 @@ async def sam_prepare(request): if data['sam_model_name'] == 'auto': model_name = impact.config.get_config()['sam_editor_model'] - model_name = os.path.join(impact_pack.model_path, "sams", model_name) + model_path = folder_paths.get_full_path("sams", model_name) - logging.info(f"[Impact Pack] Loading SAM model '{impact_pack.model_path}'") + if model_path is None: + logging.error(f"[Impact Pack] The '{model_name}' model file cannot be found in any sams model path.") + return web.Response(status=400) + + logging.info(f"[Impact Pack] Loading SAM model '{model_path}'") filename, image_dir = folder_paths.annotated_filepath(data["filename"]) @@ -93,7 +97,7 @@ async def sam_prepare(request): if image_dir is None: return web.Response(status=400) - thread = threading.Thread(target=async_prepare_sam, args=(image_dir, model_name, filename,)) + thread = threading.Thread(target=async_prepare_sam, args=(image_dir, model_path, filename,)) thread.start() logging.info("[Impact Pack] SAM model loaded. ") diff --git a/pyproject.toml b/pyproject.toml index aeef754..48ec8d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-impact-pack" description = "This node pack offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler." -version = "8.5.1" +version = "8.5.2" license = { file = "LICENSE.txt" } dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]