{"record":{"id":"719174a918d891f1","repo":"invoke-ai/InvokeAI","slug":"unknown-lora-lora-lora-key","errorCode":null,"errorMessage":"Unknown lora: {lora.lora.key}!","messagePattern":"Unknown lora: (.+?)!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/anima_lora_loader.py","lineNumber":150,"sourceCode":"            return output\n\n        loras = self.loras if isinstance(self.loras, list) else [self.loras]\n        added_loras: list[str] = []\n\n        if self.transformer is not None:\n            output.transformer = self.transformer.model_copy(deep=True)\n\n        if self.qwen3_encoder is not None:\n            output.qwen3_encoder = self.qwen3_encoder.model_copy(deep=True)\n\n        for lora in loras:\n            if lora is None:\n                continue\n            if lora.lora.key in added_loras:\n                continue\n\n            if not context.models.exists(lora.lora.key):\n                raise ValueError(f\"Unknown lora: {lora.lora.key}!\")\n\n            if lora.lora.base is not BaseModelType.Anima:\n                raise ValueError(\n                    f\"LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.lora.base else 'unknown'} models, \"\n                    \"not Anima models. Ensure you are using an Anima compatible LoRA.\"\n                )\n\n            added_loras.append(lora.lora.key)\n\n            if self.transformer is not None and output.transformer is not None:\n                output.transformer.loras.append(lora)\n\n            if self.qwen3_encoder is not None and output.qwen3_encoder is not None:\n                output.qwen3_encoder.loras.append(lora)\n\n        return output\n","sourceCodeStart":132,"sourceCodeEnd":167,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/anima_lora_loader.py#L132-L167","documentation":"While iterating over LoRAs to apply, the loader verifies each LoRA model still exists in the model manager via context.models.exists(key). If the key is not found, it raises. This means the graph references a LoRA model that has been deleted, renamed, or belongs to another installation.","triggerScenarios":"Invoking AnimaLoRALoader (or a loader iterating self.transformer.loras) when context.models.exists(lora.lora.key) returns False — the model record is missing from the database or files are gone.","commonSituations":"Sharing workflows between machines where the LoRA was never installed; deleting a model in the UI while a workflow still references it; a stale model key after re-scanning or re-configuring the models directory.","solutions":["Install the missing LoRA model into InvokeAI so its key resolves, or re-scan the models directory.","Remove the dangling LoRA node from the workflow, or re-select the LoRA in the UI to bind a valid model.","If the key came from an old workflow, update it to the re-imported model's new key."],"exampleFix":"// before\nfor lora in loras: apply(lora)  # may hit missing model\n// after\nfor lora in loras:\n    if context.models.exists(lora.lora.key):\n        apply(lora)\n    else:\n        logger.warning(f\"Skipping missing LoRA {lora.lora.key}\")","handlingStrategy":"validation","validationCode":"for lora in loras:\n    if not context.models.exists(lora.lora.key):\n        print(f\"LoRA missing from model manager: {lora.lora.key}\")","typeGuard":null,"tryCatchPattern":"try:\n    output = lora_loader.invoke(context)\nexcept ValueError as e:\n    if str(e).startswith(\"Unknown lora\"):\n        reinstall_or_remove_lora(e)\n    else:\n        raise","preventionTips":["Re-scan/re-import models after moving the models directory or switching installs.","Remove or update LoRA nodes in shared workflows that reference models you don't have installed.","Verify each LoRA key resolves in the model manager UI before running a graph."],"tags":["lora","missing-model","invokeai","model-manager"],"backgroundTag":"model-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}