invoke-ai/InvokeAI · error · FileNotFoundError
Files for model '{model_config.name}' not found at {model_pa
Error message
Files for model '{model_config.name}' not found at {model_path} What it means
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.
Source
Thrown at invokeai/backend/model_manager/load/load_default.py:222
self._ram_cache = ram_cache
self._torch_dtype = TorchDevice.choose_torch_dtype()
self._torch_device = TorchDevice.choose_torch_device()
def load_model(self, model_config: AnyModelConfig, submodel_type: Optional[SubModelType] = None) -> LoadedModel:
"""
Return a model given its configuration.
Given a model's configuration as returned by the ModelRecordConfigStore service,
return a LoadedModel object that can be used for inference.
:param model config: Configuration record for this model
:param submodel_type: an ModelType enum indicating the portion of
the model to retrieve (e.g. ModelType.Vae)
"""
model_path = self._get_model_path(model_config)
if not model_path.exists():
raise FileNotFoundError(f"Files for model '{model_config.name}' not found at {model_path}")
cache_record = self._load_and_cache(model_config, submodel_type)
return LoadedModel(config=model_config, cache_record=cache_record, cache=self._ram_cache)
@property
def ram_cache(self) -> ModelCache:
"""Return the ram cache associated with this loader."""
return self._ram_cache
def _get_model_path(self, config: AnyModelConfig) -> Path:
model_base = self._app_config.models_path
return (model_base / config.path).resolve()
def _get_execution_device(
self, config: AnyModelConfig, submodel_type: Optional[SubModelType] = None
) -> Optional[torch.device]:
"""Determine the execution device for a model based on its configuration.
View on GitHub (pinned to 0b6a024f2f)
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.
Example fix
// before: assuming a registered model is always on disk
loaded = loader.load_model(config, SubModelType.Vae)
// after: check the path first
if not Path(config.path).exists():
raise RuntimeError(f"Model files missing: {config.name}; re-install in Model Manager")
loaded = loader.load_model(config, SubModelType.Vae) Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
model_path = Path(config.path)
if not model_path.exists():
raise RuntimeError(f"Model '{config.name}' is registered but files are missing at {model_path}; re-install it") Type guard
def model_files_present(config) -> bool:
return Path(config.path).exists() Try / catch
try:
loaded = loader.load_model(config, submodel_type)
except FileNotFoundError as e:
logger.error("Model files missing, re-installing: %s", e)
model_installer.install_by_key(config.key) Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Source image does not exist: {move.old_path}
- The model with key {key} is not a main SD 1/2/XL checkpoint
- Model '{body.model_key}' not found
- Failed to delete video
- Video file not found
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/b2713484680bf38a.
Report an issue: GitHub.