{"record":{"id":"f4c10c310e4026d6","repo":"invoke-ai/InvokeAI","slug":"unknown-lora-lora-key-f4c10c","errorCode":null,"errorMessage":"Unknown lora: {lora_key}!","messagePattern":"Unknown lora: (.+?)!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux2_dev_lora_loader.py","lineNumber":92,"sourceCode":"    )\n    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=\"Transformer\",\n    )\n    mistral_encoder: MistralEncoderField | None = InputField(\n        default=None,\n        title=\"Mistral Encoder\",\n        description=FieldDescriptions.mistral_encoder,\n        input=Input.Connection,\n    )\n\n    def invoke(self, context: InvocationContext) -> Flux2DevLoRALoaderOutput:\n        lora_key = self.lora.key\n        if not context.models.exists(lora_key):\n            raise ValueError(f\"Unknown lora: {lora_key}!\")\n\n        lora_config = context.models.get_config(lora_key)\n\n        # Reject variant-mismatched LoRAs regardless of which input they're wired to. A Klein\n        # LoRA on a dev transformer/encoder is guaranteed to shape-error during denoise.\n        _assert_dev_lora(context, lora_config)\n\n        # Check for duplicate keys.\n        if self.transformer and any(existing.lora.key == lora_key for existing in self.transformer.loras):\n            raise ValueError(f'LoRA \"{lora_key}\" already applied to transformer.')\n        if self.mistral_encoder and any(existing.lora.key == lora_key for existing in self.mistral_encoder.loras):\n            raise ValueError(f'LoRA \"{lora_key}\" already applied to Mistral encoder.')\n\n        output = Flux2DevLoRALoaderOutput()\n        if self.transformer is not None:\n            output.transformer = self.transformer.model_copy(deep=True)\n            output.transformer.loras.append(LoRAField(lora=self.lora, weight=self.weight))\n        if self.mistral_encoder is not None:","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux2_dev_lora_loader.py#L74-L110","documentation":"The FLUX.2 dev LoRA loader looks up the supplied LoRA by its model key in the model manager. If context.models.exists(lora_key) is False, the LoRA is not registered/installed and invoke() raises ValueError with the unknown key.","triggerScenarios":"Passing a lora ModelIdentifierField whose key is absent from the model record store — model uninstalled, key from another install, stale serialized graph, or wrong hash/key.","commonSituations":"Restoring a workflow shared by another user who has different models installed; model deleted from Model Manager while the graph still references it; copying graphs between machines.","solutions":["Install the LoRA via Model Manager (add by URL or folder scan) so its key exists, then re-run","Re-select the LoRA in the loader node so the field points at an installed model","Run a model scan/import and verify the key with context.models.exists(key) before invoking"],"exampleFix":"# before\nloader.lora = old_lora_field  # key no longer installed\n# after\nloader.lora = context.models.search_by_attrs(base='flux2', type='lora', name='my-lora')[0]  # installed model","handlingStrategy":"validation","validationCode":"key = loader.lora.key\nif not context.models.exists(key):\n    raise ValueError(f'LoRA {key} not installed')","typeGuard":null,"tryCatchPattern":"try:\n    out = loader.invoke(context)\nexcept ValueError as e:\n    if str(e).startswith('Unknown lora:'):\n        install_or_reselect_lora(loader)\n        out = loader.invoke(context)\n    else:\n        raise","preventionTips":["Re-select LoRAs in nodes after importing shared workflows","Run a Model Manager scan to confirm all referenced models are installed","Keep model installs in sync across machines that share graphs"],"tags":["model-manager","lora","missing-model"],"backgroundTag":"model-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}