Skip to content

Commit

Permalink
Resolve when instantiating _cached_model_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonrising committed Mar 15, 2024
1 parent d165bb6 commit 1b4d4a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invokeai/app/services/model_install/model_install_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _migrate_yaml(self) -> None:
yaml_path.rename(yaml_path.with_suffix(".yaml.bak"))

def scan_directory(self, scan_dir: Path, install: bool = False) -> List[str]: # noqa D102
self._cached_model_paths = {Path(x.path).absolute() for x in self.record_store.all_models()}
self._cached_model_paths = {Path(x.path).resolve() for x in self.record_store.all_models()}
callback = self._scan_install if install else self._scan_register
search = ModelSearch(on_model_found=callback)
self._models_installed.clear()
Expand Down Expand Up @@ -528,7 +528,7 @@ def _sync_model_path(self, key: str) -> AnyModelConfig:
return model

def _scan_register(self, model: Path) -> bool:
if any(model == m.resolve() for m in self._cached_model_paths):
if model in self._cached_model_paths:
return True
try:
id = self.register_path(model)
Expand Down

0 comments on commit 1b4d4a7

Please sign in to comment.