From 5190a4c28208995e2cd8bc986012d6c80e9f1a2f Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 14 Aug 2023 14:43:08 -0400 Subject: [PATCH] further removal of Paths --- invokeai/app/api/routers/models.py | 3 +-- invokeai/app/services/model_manager_service.py | 2 +- invokeai/backend/model_management/model_merge.py | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/invokeai/app/api/routers/models.py b/invokeai/app/api/routers/models.py index b6c1edbbe1..428f672618 100644 --- a/invokeai/app/api/routers/models.py +++ b/invokeai/app/api/routers/models.py @@ -267,12 +267,11 @@ async def convert_model( logger = ApiDependencies.invoker.services.logger try: logger.info(f"Converting model: {model_name}") - dest = pathlib.Path(convert_dest_directory) if convert_dest_directory else None ApiDependencies.invoker.services.model_manager.convert_model( model_name, base_model=base_model, model_type=model_type, - convert_dest_directory=dest, + convert_dest_directory=convert_dest_directory, ) model_raw = ApiDependencies.invoker.services.model_manager.list_model( model_name, base_model=base_model, model_type=model_type diff --git a/invokeai/app/services/model_manager_service.py b/invokeai/app/services/model_manager_service.py index fd14e26364..973ff9f02b 100644 --- a/invokeai/app/services/model_manager_service.py +++ b/invokeai/app/services/model_manager_service.py @@ -577,7 +577,7 @@ class ModelManagerService(ModelManagerServiceBase): alpha: float = 0.5, interp: Optional[MergeInterpolationMethod] = None, force: bool = False, - merge_dest_directory: Optional[Path] = Field( + merge_dest_directory: Optional[str] = Field( default=None, description="Optional directory location for merged model" ), ) -> AddModelResult: diff --git a/invokeai/backend/model_management/model_merge.py b/invokeai/backend/model_management/model_merge.py index 120379c45a..6e7304a09e 100644 --- a/invokeai/backend/model_management/model_merge.py +++ b/invokeai/backend/model_management/model_merge.py @@ -31,7 +31,7 @@ class ModelMerger(object): def merge_diffusion_models( self, - model_paths: List[Path], + model_paths: List[str], alpha: float = 0.5, interp: Optional[MergeInterpolationMethod] = None, force: bool = False, @@ -75,7 +75,7 @@ class ModelMerger(object): alpha: float = 0.5, interp: Optional[MergeInterpolationMethod] = None, force: bool = False, - merge_dest_directory: Optional[Path] = None, + merge_dest_directory: Optional[str] = None, **kwargs, ) -> AddModelResult: """