From 563da9ee8e15050ea8709cbf0f6294e1e50639ef Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:01:29 +1100 Subject: [PATCH] feat(mm): write warning README file to models dir --- .../services/model_install/model_install_default.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py index 1379184ced..118718a2b9 100644 --- a/invokeai/app/services/model_install/model_install_default.py +++ b/invokeai/app/services/model_install/model_install_default.py @@ -135,6 +135,8 @@ class ModelInstallService(ModelInstallServiceBase): for model in self._scan_for_missing_models(): self._logger.warning(f"Missing model file: {model.name} at {model.path}") + self._write_invoke_managed_models_dir_readme() + def stop(self, invoker: Optional[Invoker] = None) -> None: """Stop the installer thread; after this the object can be deleted and garbage collected.""" if not self._running: @@ -147,6 +149,14 @@ class ModelInstallService(ModelInstallServiceBase): self._install_thread.join() self._running = False + def _write_invoke_managed_models_dir_readme(self) -> None: + """Write a README file to the Invoke-managed models directory warning users to not fiddle with it.""" + readme_path = self.app_config.models_path / "README.txt" + with open(readme_path, "wt", encoding=locale.getpreferredencoding()) as f: + f.write( + "This directory is managed by Invoke. Do not add, delete or move files in this directory.\n\nTo manage models, use the web interface.\n" + ) + def _clear_pending_jobs(self) -> None: for job in self.list_jobs(): if not job.in_terminal_state: