From 88ffc4d7c75c76898e139a625cf26fa60788cccc Mon Sep 17 00:00:00 2001 From: Luke Mino-Altherr Date: Tue, 24 Feb 2026 16:15:07 -0800 Subject: [PATCH] fix: include all model categories in scanning, not just those under models_dir get_comfy_models_folders() previously filtered by startswith(models_root), excluding extra model paths outside the main models directory. Now includes every category with non-empty paths from folder_names_and_paths. Amp-Thread-ID: https://ampcode.com/threads/T-019c9224-d83c-7797-8c02-e1e1ae2ee452 Co-authored-by: Amp --- app/assets/services/path_utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/services/path_utils.py b/app/assets/services/path_utils.py index 7149d418f..c2be4bb52 100644 --- a/app/assets/services/path_utils.py +++ b/app/assets/services/path_utils.py @@ -8,16 +8,15 @@ from app.assets.helpers import normalize_tags, select_best_live_path def get_comfy_models_folders() -> list[tuple[str, list[str]]]: - """Build list of (folder_name, base_paths[]) for model locations. + """Build list of (folder_name, base_paths[]) for all model locations. - Includes a category if any of its base paths lies under models_dir. + Includes every category registered in folder_names_and_paths, + regardless of whether its paths are under the main models_dir. """ targets: list[tuple[str, list[str]]] = [] - models_root = os.path.abspath(folder_paths.models_dir) for name, values in folder_paths.folder_names_and_paths.items(): - # Unpack carefully to handle nodepacks that modify folder_paths paths, _exts = values[0], values[1] - if any(os.path.abspath(p).startswith(models_root + os.sep) for p in paths): + if paths: targets.append((name, paths)) return targets