{"record":{"id":"6642494b8c59ddbb","repo":"invoke-ai/InvokeAI","slug":"no-model-found-with-name-name-base-base-and","errorCode":null,"errorMessage":"No model found with name {name}, base {base}, and type {type}","messagePattern":"No model found with name (.+?), base (.+?), and type (.+?)","errorType":"exception","errorClass":"UnknownModelException","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/shared/invocation_context.py","lineNumber":573,"sourceCode":"    def load_by_attrs(\n        self, name: str, base: BaseModelType, type: ModelType, submodel_type: Optional[SubModelType] = None\n    ) -> LoadedModel:\n        \"\"\"Load a model by its attributes.\n\n        Args:\n            name: Name of the model.\n            base: The models' base type, e.g. `BaseModelType.StableDiffusion1`, `BaseModelType.StableDiffusionXL`, etc.\n            type: Type of the model, e.g. `ModelType.Main`, `ModelType.Vae`, etc.\n            submodel_type: The type of submodel to load, e.g. `SubModelType.UNet`, `SubModelType.TextEncoder`, etc. Only main\n            models have submodels.\n\n        Returns:\n            An object representing the loaded model.\n        \"\"\"\n\n        configs = self._services.model_manager.store.search_by_attr(model_name=name, base_model=base, model_type=type)\n        if len(configs) == 0:\n            raise UnknownModelException(f\"No model found with name {name}, base {base}, and type {type}\")\n\n        if len(configs) > 1:\n            raise ValueError(f\"More than one model found with name {name}, base {base}, and type {type}\")\n\n        self._raise_if_external(configs[0])\n        message = f\"Loading model {name}\"\n        if submodel_type:\n            message += f\" ({submodel_type.value})\"\n        self._util.signal_progress(message)\n        return self._services.model_manager.load.load_model(\n            configs[0], submodel_type, user_id=self._data.queue_item.user_id\n        )\n\n    def offload_from_vram(self, identifier: Union[str, \"ModelIdentifierField\"]) -> int:\n        \"\"\"Move a model (and all of its submodels) from VRAM to RAM, freeing its VRAM but keeping it cached.\n\n        Use this when an invocation is done with a model for the rest of the run - e.g. a one-shot text encoder -\n        so the next, larger load does not have to compete with it for VRAM. The model stays in the RAM cache, so","sourceCodeStart":555,"sourceCodeEnd":591,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/shared/invocation_context.py#L555-L591","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run a model scan / add the model so it is registered in the store","Verify the exact name with the model manager's list/search APIs or the UI model manager","Check base_model and model_type match the installed model's record"],"exampleFix":"// before\nmodel = ctx.models.load_by_attrs(name=\"MyLora\", base=BaseModelType.Sdxl, type=ModelType.LoRA)\n// after\ncandidates = ctx._services.model_manager.store.search_by_attr(model_name=\"MyLora\")\nif not candidates:\n    raise RuntimeError(\"MyLora not installed; install it or fix the name\")\nmodel = ctx.models.load_by_attrs(name=\"MyLora\", base=candidates[0].base, type=candidates[0].type)","handlingStrategy":"try-catch","validationCode":"configs = services.model_manager.store.search_by_attr(model_name=name, base_model=base, model_type=type)\nif len(configs) == 0:\n    raise RuntimeError(f\"model {name!r} not registered; install or rescan models\")","typeGuard":null,"tryCatchPattern":"try:\n    model = ctx.models.load_by_attrs(name=name, base=base, type=type)\nexcept UnknownModelException:\n    logger.error(\"Model %s (%s/%s) not installed\", name, base, type)\n    model = None","preventionTips":["Confirm the exact model name in the Model Manager UI before referencing it","Run a models scan after adding files to the models directory","Match base_model and type exactly as registered"],"tags":["models","lookup","not-found"],"backgroundTag":"model-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}