invoke-ai/InvokeAI · error · UnknownModelException

No model found with name {name}, base {base}, and type {type

Error message

No model found with name {name}, base {base}, and type {type}

What it means

Raised by ModelLoaderServiceContext.load_by_attrs when searching the model config store by (name, base, type) returns zero configs. UnknownModelException signals that no registered model matches all three attributes. This is a lookup-by-attribute API, so all three must match exactly a model already registered in InvokeAI.

Source

Thrown at invokeai/app/services/shared/invocation_context.py:573

    def load_by_attrs(
        self, name: str, base: BaseModelType, type: ModelType, submodel_type: Optional[SubModelType] = None
    ) -> LoadedModel:
        """Load a model by its attributes.

        Args:
            name: Name of the model.
            base: The models' base type, e.g. `BaseModelType.StableDiffusion1`, `BaseModelType.StableDiffusionXL`, etc.
            type: Type of the model, e.g. `ModelType.Main`, `ModelType.Vae`, etc.
            submodel_type: The type of submodel to load, e.g. `SubModelType.UNet`, `SubModelType.TextEncoder`, etc. Only main
            models have submodels.

        Returns:
            An object representing the loaded model.
        """

        configs = self._services.model_manager.store.search_by_attr(model_name=name, base_model=base, model_type=type)
        if len(configs) == 0:
            raise UnknownModelException(f"No model found with name {name}, base {base}, and type {type}")

        if len(configs) > 1:
            raise ValueError(f"More than one model found with name {name}, base {base}, and type {type}")

        self._raise_if_external(configs[0])
        message = f"Loading model {name}"
        if submodel_type:
            message += f" ({submodel_type.value})"
        self._util.signal_progress(message)
        return self._services.model_manager.load.load_model(
            configs[0], submodel_type, user_id=self._data.queue_item.user_id
        )

    def offload_from_vram(self, identifier: Union[str, "ModelIdentifierField"]) -> int:
        """Move a model (and all of its submodels) from VRAM to RAM, freeing its VRAM but keeping it cached.

        Use this when an invocation is done with a model for the rest of the run - e.g. a one-shot text encoder -
        so the next, larger load does not have to compete with it for VRAM. The model stays in the RAM cache, so

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Run a model scan / add the model so it is registered in the store
  2. Verify the exact name with the model manager's list/search APIs or the UI model manager
  3. Check base_model and model_type match the installed model's record

Example fix

// before
model = ctx.models.load_by_attrs(name="MyLora", base=BaseModelType.Sdxl, type=ModelType.LoRA)
// after
candidates = ctx._services.model_manager.store.search_by_attr(model_name="MyLora")
if not candidates:
    raise RuntimeError("MyLora not installed; install it or fix the name")
model = ctx.models.load_by_attrs(name="MyLora", base=candidates[0].base, type=candidates[0].type)
Defensive patterns

Strategy: try-catch

Validate before calling

configs = services.model_manager.store.search_by_attr(model_name=name, base_model=base, model_type=type)
if len(configs) == 0:
    raise RuntimeError(f"model {name!r} not registered; install or rescan models")

Try / catch

try:
    model = ctx.models.load_by_attrs(name=name, base=base, type=type)
except UnknownModelException:
    logger.error("Model %s (%s/%s) not installed", name, base, type)
    model = None

Prevention

When it happens

Trigger: Calling load_by_attrs(name=..., base=..., type=...) where no model with that exact name/base_model/model_type combination exists in the model record store; also hit via generate_ti_list when a textual-inversion name is wrong.

Common situations: Typo in model name; model was never installed; model installed under a different base model (e.g. sd-1 vs sdxl) or type (main vs lora vs embedding); models directory not scanned yet.

Related errors


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