invoke-ai/InvokeAI · error · OSError

The embedding file at {path} was not found

Error message

The embedding file at {path} was not found

What it means

The textual inversion loader (_get_model_path) resolves the embedding's path: folder-format embeddings expect a learned_embeds.bin file inside the model directory, while single-file formats use the model path directly. If the resolved path does not exist on disk, an OSError is raised. This means the model record points at files that are missing or misnamed.

Source

Thrown at invokeai/backend/model_manager/load/model_loaders/textual_inversion.py:50

        if submodel_type is not None:
            raise ValueError("There are no submodels in a TI model.")
        model = TextualInversionModelRaw.from_checkpoint(
            file_path=config.path,
            dtype=self._torch_dtype,
        )
        return model

    # override
    def _get_model_path(self, config: AnyModelConfig) -> Path:
        model_path = self._app_config.models_path / config.path

        if config.format == ModelFormat.EmbeddingFolder:
            path = model_path / "learned_embeds.bin"
        else:
            path = model_path

        if not path.exists():
            raise OSError(f"The embedding file at {path} was not found")

        return path

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Verify the file exists at the path shown in the message; re-download or re-extract the embedding if missing.
  2. For EmbeddingFolder format, ensure the folder contains learned_embeds.bin (rename your file to that name or re-download the official folder layout).
  3. Delete the model from InvokeAI's model manager and re-import/scan it so the stored path is refreshed.
  4. Check the model record's path field in the models database/directory and correct it to the actual location.

Example fix

// before (folder missing expected file)
my_embedding/
  embed.pt

// after
my_embedding/
  learned_embeds.bin
Defensive patterns

Strategy: validation

Validate before calling

import os
from pathlib import Path
def validate_embedding(config, model_path):
    path = model_path / 'learned_embeds.bin' if str(config.format).endswith('EmbeddingFolder') else model_path
    if not Path(path).exists():
        raise FileNotFoundError(f"Embedding file missing: {path} — re-download or fix the model path")

Try / catch

try:
    path = loader._get_model_path(config, model_path)
except OSError as e:
    logger.warning("Embedding missing, re-importing: %s", e)
    reinstall_model(config)

Prevention

When it happens

Trigger: Installing a textual inversion embedding where config.format == ModelFormat.EmbeddingFolder but the folder lacks learned_embeds.bin; the registered path was moved/renamed; or a scan registered a stale path for a deleted file.

Common situations: Manual download extracted incompletely; user renamed the .bin/.pt file or placed a folder-format embedding without the expected inner filename; model directory moved after registration; network- interrupted download.

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


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/d0163622d510773d. Report an issue: GitHub.