diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py index 755e5f7685..04d2d5fd39 100644 --- a/invokeai/app/services/model_install/model_install_default.py +++ b/invokeai/app/services/model_install/model_install_default.py @@ -390,10 +390,10 @@ class ModelInstallService(ModelInstallServiceBase): def unconditionally_delete(self, key: str) -> None: # noqa D102 model = self.record_store.get_model(key) model_path = self.app_config.models_path / model.path - if model_path.is_dir(): - rmtree(model_path) - else: + if model_path.is_file() or model_path.is_symlink(): model_path.unlink() + elif model_path.is_dir(): + rmtree(model_path) self.unregister(key) def download_and_cache(