{"record":{"id":"36369ec30b49e3bf","repo":"invoke-ai/InvokeAI","slug":"unknown-lora-lora-key","errorCode":null,"errorMessage":"Unknown lora: {lora_key}!","messagePattern":"Unknown lora: (.+?)!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/anima_lora_loader.py","lineNumber":63,"sourceCode":"    weight: float = InputField(default=0.75, description=FieldDescriptions.lora_weight)\n    transformer: TransformerField | None = InputField(\n        default=None,\n        description=FieldDescriptions.transformer,\n        input=Input.Connection,\n        title=\"Anima Transformer\",\n    )\n    qwen3_encoder: Qwen3EncoderField | None = InputField(\n        default=None,\n        title=\"Qwen3 Encoder\",\n        description=FieldDescriptions.qwen3_encoder,\n        input=Input.Connection,\n    )\n\n    def invoke(self, context: InvocationContext) -> AnimaLoRALoaderOutput:\n        lora_key = self.lora.key\n\n        if not context.models.exists(lora_key):\n            raise ValueError(f\"Unknown lora: {lora_key}!\")\n\n        if self.transformer and any(lora.lora.key == lora_key for lora in self.transformer.loras):\n            raise ValueError(f'LoRA \"{lora_key}\" already applied to transformer.')\n        if self.qwen3_encoder and any(lora.lora.key == lora_key for lora in self.qwen3_encoder.loras):\n            raise ValueError(f'LoRA \"{lora_key}\" already applied to Qwen3 encoder.')\n\n        output = AnimaLoRALoaderOutput()\n\n        if self.transformer is not None:\n            output.transformer = self.transformer.model_copy(deep=True)\n            output.transformer.loras.append(\n                LoRAField(\n                    lora=self.lora,\n                    weight=self.weight,\n                )\n            )\n        if self.qwen3_encoder is not None:\n            output.qwen3_encoder = self.qwen3_encoder.model_copy(deep=True)","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/anima_lora_loader.py#L45-L81","documentation":"The Anima LoRA loader requires the referenced LoRA key to exist in the model manager. If context.models.exists(lora_key) is False, the loader raises this ValueError. It also raises a related error if the LoRA is already applied to the transformer or Qwen3 encoder.","triggerScenarios":"Referencing a LoRA by key that was deleted, renamed, or never installed; running a saved workflow whose LoRA key no longer matches any model in the manager.","commonSituations":"Moving workflows between machines with different model libraries; deleting or re-importing a LoRA which changes its key; typos in keys when scripting workflows via the API.","solutions":["Install the missing LoRA via the model manager so its key exists, or update the workflow to reference the installed LoRA's key.","Check context.models.exists(key) / the Models tab for the exact key and fix the reference.","Re-link the LoRA loader node's model field in the workflow UI after re-import."],"exampleFix":"// before\nlora_field = LoRAModelField(key=\"char_lora_old_key\")  // deleted/never installed\n// after\nif (context.models.exists(\"char_lora_new_key\")) {\n  lora_field = LoRAModelField(key=\"char_lora_new_key\")\n}","handlingStrategy":"validation","validationCode":"if not context.models.exists(lora_key):\n    raise LookupError(f\"LoRA {lora_key} not installed; install it or fix the workflow reference\")","typeGuard":null,"tryCatchPattern":"try:\n    output = lora_loader.invoke(context)\nexcept ValueError as e:\n    if str(e).startswith(\"Unknown lora:\"):\n        missing = str(e).split(\":\", 1)[1].strip().rstrip(\"!\")\n        install_or_relink_lora(missing)  # import the model, then update the node key\n    else:\n        raise","preventionTips":["Verify LoRA keys exist in the model manager before submitting workflows","Re-link LoRA nodes after re-importing models (keys can change)","When sharing workflows, ship the model list or remap keys on import"],"tags":["lora","model-not-found","invoke"],"backgroundTag":"model-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}