From 7feea3b61e8a82c5e2f48d6c38888e142c26ee70 Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Tue, 14 Jul 2026 00:09:59 +0200 Subject: [PATCH] Restrict scanner extension filtering to configured category extensions only --- core/scanner.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/core/scanner.py b/core/scanner.py index ede0594..8176ba9 100644 --- a/core/scanner.py +++ b/core/scanner.py @@ -13,8 +13,6 @@ log = create_module_logger(__name__) from .path_utils import get_path_identity -from .type_utils import MODEL_EXTENSIONS - # Import folder_paths lazily - it may not be available until ComfyUI is initialized try: import folder_paths @@ -157,17 +155,10 @@ def scan_directory( # Check if file has a model extension file_ext = os.path.splitext(filename)[1].lower() - # For categories with empty extension set, accept all files - # Otherwise, check if extension matches - # Accept if: - # - no explicit extensions configured, or - # - matches configured extensions, or - # - matches our known model extensions - if ( - len(extensions or set()) == 0 - or file_ext in extensions - or file_ext in MODEL_EXTENSIONS - ): + # Categories with explicit extensions must keep those boundaries. + # Custom nodes may register aliases such as model_gguf against the + # diffusion_models roots, but only .gguf files belong to that alias. + if len(extensions or set()) == 0 or file_ext in extensions: full_path = os.path.join(root, filename) # Calculate relative path from base directory