From d4872253a143093fe18431a8d4928b60cd91bcfd Mon Sep 17 00:00:00 2001 From: Brandon Rising Date: Wed, 21 Aug 2024 11:18:07 -0400 Subject: [PATCH] Update doc string for import_local_model and remove access_token since it's only usable for local file paths --- .../app/services/shared/invocation_context.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/invokeai/app/services/shared/invocation_context.py b/invokeai/app/services/shared/invocation_context.py index 9ba1bf68f3..ce52d08809 100644 --- a/invokeai/app/services/shared/invocation_context.py +++ b/invokeai/app/services/shared/invocation_context.py @@ -468,17 +468,24 @@ class ModelsInterface(InvocationContextInterface): self, model_path: Path, config: Optional[ModelRecordChanges] = None, - access_token: Optional[str] = None, inplace: Optional[bool] = False, ): """ - TODO: Fill out description of this method + Import the model file located at the given local file path and return its ModelInstallJob. + + This can be used to single-file models or directories. + + Args: + model_path: A pathlib.Path object pointing to a model file or directory + config: Optional ModelRecordChanges to define manual probe overrides + inplace: Optional boolean to declare whether or not to install the model in the models dir + + Returns: + ModelInstallJob object defining the install job to be used in tracking the job """ if not model_path.exists(): raise Exception("Models provided to import_local_model must already exist on disk") - return self._services.model_manager.install.heuristic_import( - str(model_path), config=config, access_token=access_token, inplace=inplace - ) + return self._services.model_manager.install.heuristic_import(str(model_path), config=config, inplace=inplace) def load_local_model( self,