diff --git a/invokeai/backend/install/invokeai_configure.py b/invokeai/backend/install/invokeai_configure.py index 695e67e32d..86da993e85 100755 --- a/invokeai/backend/install/invokeai_configure.py +++ b/invokeai/backend/install/invokeai_configure.py @@ -836,9 +836,9 @@ def main(): download_support_models() if opt.skip_sd_weights: - logger.info("\n** SKIPPING DIFFUSION WEIGHTS DOWNLOAD PER USER REQUEST **") + logger.warning("SKIPPING DIFFUSION WEIGHTS DOWNLOAD PER USER REQUEST") elif models_to_download: - logger.info("\n** DOWNLOADING DIFFUSION WEIGHTS **") + logger.info("DOWNLOADING DIFFUSION WEIGHTS") process_and_execute(opt, models_to_download) postscript(errors=errors) diff --git a/invokeai/backend/install/model_install_backend.py b/invokeai/backend/install/model_install_backend.py index b6f6d62d97..c1fa30c3b7 100644 --- a/invokeai/backend/install/model_install_backend.py +++ b/invokeai/backend/install/model_install_backend.py @@ -119,6 +119,7 @@ class ModelInstall(object): # supplement with entries in models.yaml installed_models = self.mgr.list_models() + for md in installed_models: base = md['base_model'] model_type = md['model_type'] @@ -136,6 +137,12 @@ class ModelInstall(object): ) return {x : model_dict[x] for x in sorted(model_dict.keys(),key=lambda y: model_dict[y].name.lower())} + def list_models(self, model_type): + installed = self.mgr.list_models(model_type=model_type) + print(f'Installed models of type `{model_type}`:') + for i in installed: + print(f"{i['model_name']}\t{i['base_model']}\t{i['path']}") + def starter_models(self)->Set[str]: models = set() for key, value in self.datasets.items(): diff --git a/invokeai/backend/model_management/model_manager.py b/invokeai/backend/model_management/model_manager.py index 6b9d085885..a38fcf6c24 100644 --- a/invokeai/backend/model_management/model_manager.py +++ b/invokeai/backend/model_management/model_manager.py @@ -849,7 +849,6 @@ class ModelManager(object): if autodir is None: continue - self.logger.info(f'Scanning {autodir} for models to import') installed = dict() autodir = self.app_config.root_path / autodir @@ -884,9 +883,9 @@ class ModelManager(object): except ValueError as e: self.logger.warning(str(e)) - self.logger.info(f'Scanned {items_scanned} files and directories, imported {len(new_models_found)} models') installed.update(new_models_found) + self.logger.info(f'Scanned {items_scanned} files and directories, imported {len(new_models_found)} models') return installed def heuristic_import(self, diff --git a/invokeai/frontend/install/model_install.py b/invokeai/frontend/install/model_install.py index b268e59649..787da5724f 100644 --- a/invokeai/frontend/install/model_install.py +++ b/invokeai/frontend/install/model_install.py @@ -675,7 +675,9 @@ def select_and_download_models(opt: Namespace): # pass installer = ModelInstall(config, prediction_type_helper=helper) - if opt.add or opt.delete: + if opt.list_models: + installer.list_models(opt.list_models) + elif opt.add or opt.delete: selections = InstallSelections( install_models = opt.add or [], remove_models = opt.delete or [] @@ -748,7 +750,7 @@ def main(): ) parser.add_argument( "--list-models", - choices=["diffusers","loras","controlnets","tis"], + choices=[x.value for x in ModelType], help="list installed models", ) parser.add_argument(