Skip to content

Commit 093f8d6

Browse files
fix(mm): ignore files in hidden directories when identifying models
1 parent 22fdfab commit 093f8d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

invokeai/backend/model_manager/configs/factory.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,11 @@ def _validate_path_looks_like_model(path: Path) -> None:
333333
# For directories, do a quick file count check with early exit
334334
total_files = 0
335335
# Ignore hidden files and directories
336-
paths_to_check = (p for p in path.rglob("*") if not p.name.startswith("."))
336+
paths_to_check = (
337+
p
338+
for p in path.rglob("*")
339+
if not p.name.startswith(".") and not any(part.startswith(".") for part in p.parts)
340+
)
337341
for item in paths_to_check:
338342
if item.is_file():
339343
total_files += 1

0 commit comments

Comments
 (0)