mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Bugfix/ignore dot directories on model scan (#4865)
## What type of PR is this? (check all applicable) - [ ] Refactor - [ ] Feature - [X] Bug Fix - [ ] Optimization - [ ] Documentation Update - [ ] Community Node Submission ## Have you discussed this change with the InvokeAI team? - [X] Yes - [ ] No, because: ## Have you updated all relevant documentation? - [X] Yes - [ ] No ## Description Mac users have a recurring issue in which a `.DS_Store` directory is created in their `models` hierarchy, causing the new model scanner to freak out. This PR skips over any paths that begin with a dot. I haven't tested it on a Macintosh, so I'm not 100% certain it will do the trick. ## Related Tickets & Documents - Related Issue #4815 ## QA Instructions, Screenshots, Recordings Someone with a Mac please try to reproduce the `.DS_Store` crash and then see if applying this PR addresses the issue.
This commit is contained in:
commit
e6c1e03b8b
@ -986,6 +986,8 @@ class ModelManager(object):
|
||||
|
||||
for model_path in models_dir.iterdir():
|
||||
if model_path not in loaded_files: # TODO: check
|
||||
if model_path.name.startswith("."):
|
||||
continue
|
||||
model_name = model_path.name if model_path.is_dir() else model_path.stem
|
||||
model_key = self.create_key(model_name, cur_base_model, cur_model_type)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user