{"record":{"id":"b2713484680bf38a","repo":"invoke-ai/InvokeAI","slug":"files-for-model-model-config-name-not-found-at","errorCode":null,"errorMessage":"Files for model '{model_config.name}' not found at {model_path}","messagePattern":"Files for model '(.+?)' not found at (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/load/load_default.py","lineNumber":222,"sourceCode":"        self._ram_cache = ram_cache\n        self._torch_dtype = TorchDevice.choose_torch_dtype()\n        self._torch_device = TorchDevice.choose_torch_device()\n\n    def load_model(self, model_config: AnyModelConfig, submodel_type: Optional[SubModelType] = None) -> LoadedModel:\n        \"\"\"\n        Return a model given its configuration.\n\n        Given a model's configuration as returned by the ModelRecordConfigStore service,\n        return a LoadedModel object that can be used for inference.\n\n        :param model config: Configuration record for this model\n        :param submodel_type: an ModelType enum indicating the portion of\n               the model to retrieve (e.g. ModelType.Vae)\n        \"\"\"\n        model_path = self._get_model_path(model_config)\n\n        if not model_path.exists():\n            raise FileNotFoundError(f\"Files for model '{model_config.name}' not found at {model_path}\")\n\n        cache_record = self._load_and_cache(model_config, submodel_type)\n        return LoadedModel(config=model_config, cache_record=cache_record, cache=self._ram_cache)\n\n    @property\n    def ram_cache(self) -> ModelCache:\n        \"\"\"Return the ram cache associated with this loader.\"\"\"\n        return self._ram_cache\n\n    def _get_model_path(self, config: AnyModelConfig) -> Path:\n        model_base = self._app_config.models_path\n        return (model_base / config.path).resolve()\n\n    def _get_execution_device(\n        self, config: AnyModelConfig, submodel_type: Optional[SubModelType] = None\n    ) -> Optional[torch.device]:\n        \"\"\"Determine the execution device for a model based on its configuration.\n","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/load/load_default.py#L204-L240","documentation":"ModelLoadDefaultAPI.load_model resolves the model's on-disk path via _get_model_path and raises FileNotFoundError when that path does not exist. This means the database record for the model points at files that are missing from disk, so loading cannot proceed.","triggerScenarios":"Calling load_model(config, submodel_type) where model_config's converted/checkpoint path was deleted or moved after registration; loading a submodel of a main model whose folder is incomplete.","commonSituations":"User deleted or moved files in invokeai/models/ manually; models dir was migrated to a new machine or drive without copying files; interrupted download left the record registered but files absent.","solutions":["Re-import/re-download the model so files exist at the recorded path.","Delete the stale model record in Model Manager UI and re-install it.","Restore the missing files or fix the models_root path in invokeai.yaml to point at the location that actually holds the files."],"exampleFix":"// before: assuming a registered model is always on disk\nloaded = loader.load_model(config, SubModelType.Vae)\n// after: check the path first\nif not Path(config.path).exists():\n    raise RuntimeError(f\"Model files missing: {config.name}; re-install in Model Manager\")\nloaded = loader.load_model(config, SubModelType.Vae)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nmodel_path = Path(config.path)\nif not model_path.exists():\n    raise RuntimeError(f\"Model '{config.name}' is registered but files are missing at {model_path}; re-install it\")","typeGuard":"def model_files_present(config) -> bool:\n    return Path(config.path).exists()","tryCatchPattern":"try:\n    loaded = loader.load_model(config, submodel_type)\nexcept FileNotFoundError as e:\n    logger.error(\"Model files missing, re-installing: %s\", e)\n    model_installer.install_by_key(config.key)","preventionTips":["Never move/delete files under the models root without updating the Model Manager record","Use the Model Manager UI to delete models so DB records and files stay in sync","After migrating machines, verify models_root in invokeai.yaml matches the copied location"],"tags":["file-not-found","model-manager","filesystem"],"backgroundTag":"file-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}