From d0a936ebd4deadcdc7cff4e07e8b93baaa416cb9 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:51:26 +1100 Subject: [PATCH] fix(mm): do not write config file when migrating models.yaml --- invokeai/app/services/model_install/model_install_default.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py index dd70e135fc..6d71caf28b 100644 --- a/invokeai/app/services/model_install/model_install_default.py +++ b/invokeai/app/services/model_install/model_install_default.py @@ -350,9 +350,8 @@ class ModelInstallService(ModelInstallServiceBase): # Rename `models.yaml` to `models.yaml.bak` to prevent re-migration legacy_models_yaml_path.rename(legacy_models_yaml_path.with_suffix(".yaml.bak")) - # Remove `legacy_models_yaml_path` from the config file - we are done with it either way + # Unset the path - we are done with it either way self._app_config.legacy_models_yaml_path = None - self._app_config.write_file(self._app_config.config_file_path) def scan_directory(self, scan_dir: Path, install: bool = False) -> List[str]: # noqa D102 self._cached_model_paths = {Path(x.path).resolve() for x in self.record_store.all_models()}