{"record":{"id":"85024259aa4499ac","repo":"invoke-ai/InvokeAI","slug":"unknown-lora-self-lora-key","errorCode":null,"errorMessage":"Unknown lora: {self.lora.key}!","messagePattern":"Unknown lora: (.+?)!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux_control_lora_loader.py","lineNumber":43,"sourceCode":"    tags=[\"lora\", \"model\", \"flux\"],\n    category=\"model\",\n    version=\"1.1.1\",\n)\nclass FluxControlLoRALoaderInvocation(BaseInvocation):\n    \"\"\"LoRA model and Image to use with FLUX transformer generation.\"\"\"\n\n    lora: ModelIdentifierField = InputField(\n        description=FieldDescriptions.control_lora_model,\n        title=\"Control LoRA\",\n        ui_model_base=BaseModelType.Flux,\n        ui_model_type=ModelType.ControlLoRa,\n    )\n    image: ImageField = InputField(description=\"The image to encode.\")\n    weight: float = InputField(description=\"The weight of the LoRA.\", default=1.0)\n\n    def invoke(self, context: InvocationContext) -> FluxControlLoRALoaderOutput:\n        if not context.models.exists(self.lora.key):\n            raise ValueError(f\"Unknown lora: {self.lora.key}!\")\n\n        return FluxControlLoRALoaderOutput(\n            control_lora=ControlLoRAField(\n                lora=self.lora,\n                img=self.image,\n                weight=self.weight,\n            )\n        )\n","sourceCodeStart":25,"sourceCodeEnd":52,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux_control_lora_loader.py#L25-L52","documentation":"The FLUX Control LoRA loader checks context.models.exists(self.lora.key) before loading; when the key is not in the model manager it raises this ValueError. It means the LoRA model record referenced by the ModelIdentifierField no longer exists (deleted, renamed, or from another install).","triggerScenarios":"self.lora.key not found in context.models at invoke time; passing a stale ModelIdentifierField captured before model deletion; loading a saved workflow referencing LoRAs not installed on the machine.","commonSituations":"Sharing workflows between machines with different model installs; LoRA deleted/renamed after the workflow was saved; key format changes after an InvokeAI upgrade or model-manager migration.","solutions":["Re-select the LoRA in the workflow so the node gets a fresh valid key","Install the referenced LoRA via the model manager on this machine","Verify the key exists with the model manager UI/API before running","Re-scan the models directory if records are out of sync"],"exampleFix":"// before: stale key from another install\nlora=ModelIdentifierField(key='abc-old-install-key')\n// after: re-selected in UI on current install\nlora=ModelIdentifierField(key='flux-control-lora-local-123')","handlingStrategy":"validation","validationCode":"if not context.models.exists(lora_field.key):\n    raise ValueError(f'LoRA {lora_field.key} not installed; re-select it in the workflow')","typeGuard":"def lora_is_available(context, lora_field) -> bool:\n    return context.models.exists(lora_field.key)","tryCatchPattern":"try:\n    result = control_lora_loader.invoke(context)\nexcept ValueError as e:\n    if 'Unknown lora' in str(e):\n        reinstall_or_reselect_lora()\n    raise","preventionTips":["Re-select LoRAs after upgrading InvokeAI or migrating models","Validate all model keys before running shared workflows","Keep LoRA installs consistent across machines running the same workflow"],"tags":["lora","model-not-found","workflow"],"backgroundTag":"model-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}