diff --git a/invokeai/app/api/routers/models.py b/invokeai/app/api/routers/models.py index 870ca33534..759f6c9f59 100644 --- a/invokeai/app/api/routers/models.py +++ b/invokeai/app/api/routers/models.py @@ -298,7 +298,7 @@ async def search_for_models( )->List[pathlib.Path]: if not search_path.is_dir(): raise HTTPException(status_code=404, detail=f"The search path '{search_path}' does not exist or is not directory") - return ApiDependencies.invoker.services.model_manager.search_for_models([search_path]) + return ApiDependencies.invoker.services.model_manager.search_for_models(search_path) @models_router.get( "/ckpt_confs", diff --git a/invokeai/app/services/model_manager_service.py b/invokeai/app/services/model_manager_service.py index b1b995309e..f7d3b3a7a7 100644 --- a/invokeai/app/services/model_manager_service.py +++ b/invokeai/app/services/model_manager_service.py @@ -600,7 +600,7 @@ class ModelManagerService(ModelManagerServiceBase): """ Return list of all models found in the designated directory. """ - search = FindModels(directory,self.logger) + search = FindModels([directory], self.logger) return search.list_models() def sync_to_config(self): diff --git a/invokeai/backend/model_management/model_search.py b/invokeai/backend/model_management/model_search.py index 1e282b4bb8..5657bd9549 100644 --- a/invokeai/backend/model_management/model_search.py +++ b/invokeai/backend/model_management/model_search.py @@ -98,6 +98,6 @@ class FindModels(ModelSearch): def list_models(self) -> List[Path]: self.search() - return self.models_found + return list(self.models_found)