{"record":{"id":"a286f8c558508f28","repo":"invoke-ai/InvokeAI","slug":"lora-lora-config-name-is-a-flux-2-dev-lora-a","errorCode":null,"errorMessage":"LoRA '{lora_config.name}' is a FLUX.2 [dev] LoRA and cannot be applied via the FLUX.2 Klein LoRA loader. Use the FLUX.2 [dev] LoRA loader for dev LoRAs.","messagePattern":"LoRA '(.+?)' is a FLUX\\.2 \\[dev\\] LoRA and cannot be applied via the FLUX\\.2 Klein LoRA loader\\. Use the FLUX\\.2 \\[dev\\] LoRA loader for dev LoRAs\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux2_klein_lora_loader.py","lineNumber":32,"sourceCode":"    invocation_output,\n)\nfrom invokeai.app.invocations.fields import FieldDescriptions, Input, InputField, OutputField\nfrom invokeai.app.invocations.model import LoRAField, ModelIdentifierField, Qwen3EncoderField, TransformerField\nfrom invokeai.app.services.shared.invocation_context import InvocationContext\nfrom invokeai.backend.model_manager.taxonomy import BaseModelType, Flux2VariantType, ModelType\n\n\ndef _assert_not_dev_lora(context: InvocationContext, lora_config) -> None:\n    \"\"\"Reject a FLUX.2 [dev] LoRA applied via the FLUX.2 Klein loaders.\n\n    A dev LoRA (hidden 5120/6144) on a Klein transformer/encoder (hidden 3072/4096) is\n    guaranteed to raise a shape-mismatch ``RuntimeError`` during denoise. Fail fast here,\n    independent of which input the LoRA is wired to. (The frontend filters these out before\n    they reach the graph; this is the backstop for hand-built workflow graphs.) Intra-Klein\n    4B-vs-9B mismatches remain a soft warning below.\n    \"\"\"\n    if getattr(lora_config, \"variant\", None) == Flux2VariantType.Dev:\n        raise ValueError(\n            f\"LoRA '{lora_config.name}' is a FLUX.2 [dev] LoRA and cannot be applied via the \"\n            \"FLUX.2 Klein LoRA loader. Use the FLUX.2 [dev] LoRA loader for dev LoRAs.\"\n        )\n\n\n@invocation_output(\"flux2_klein_lora_loader_output\")\nclass Flux2KleinLoRALoaderOutput(BaseInvocationOutput):\n    \"\"\"FLUX.2 Klein LoRA Loader Output\"\"\"\n\n    transformer: Optional[TransformerField] = OutputField(\n        default=None, description=FieldDescriptions.transformer, title=\"Transformer\"\n    )\n    qwen3_encoder: Optional[Qwen3EncoderField] = OutputField(\n        default=None, description=FieldDescriptions.qwen3_encoder, title=\"Qwen3 Encoder\"\n    )\n\n\n@invocation(","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux2_klein_lora_loader.py#L14-L50","documentation":"_assert_not_dev_lora in the FLUX.2 Klein LoRA loader raises this ValueError when the selected LoRA is tagged as a FLUX.2 [dev] LoRA. Dev LoRAs target the [dev] transformer architecture; applying them via the Klein loader would guarantee a shape-mismatch RuntimeError during denoise. This fail-fast backstop exists for hand-built workflow graphs, since the frontend normally filters such combinations.","triggerScenarios":"invoke() of flux2_klein_lora_loader calls _assert_not_dev_lora(context, lora_config) and getattr(lora_config, 'variant') == Flux2VariantType.Dev, regardless of which loader input the LoRA is wired to.","commonSituations":"A user hand-wires a FLUX.2 [dev] LoRA into a Klein workflow graph (bypassing frontend filtering), or picks a dev LoRA from the model list while assembling a Klein pipeline.","solutions":["Replace the LoRA with a FLUX.2 Klein-compatible LoRA in the Klein LoRA loader.","If the intent is to use a dev LoRA, switch the workflow to the FLUX.2 [dev] pipeline and the FLUX.2 [dev] LoRA loader.","If the LoRA is actually a Klein LoRA, fix its model manager metadata so its variant is not tagged 'dev'."],"exampleFix":"// before\nklein_loader = Flux2KleinLoRALoader(lora=flux2_dev_lora)\n// after\nklein_loader = Flux2KleinLoRALoader(lora=flux2_klein_4b_lora)","handlingStrategy":"validation","validationCode":"lora_config = context.models.get_config(lora_key)\nif getattr(lora_config, \"variant\", None) == Flux2VariantType.Dev:\n    raise ValueError(\"This is a FLUX.2 [dev] LoRA; use the [dev] LoRA loader\")","typeGuard":"def is_dev_lora(config) -> bool:\n    return getattr(config, \"variant\", None) == Flux2VariantType.Dev","tryCatchPattern":"try:\n    output = klein_lora_loader.invoke(context)\nexcept ValueError as e:\n    if \"is a FLUX.2 [dev] LoRA\" in str(e):\n        dev_loader = Flux2DevLoRALoader(lora=lora_ref)\n        output = dev_loader.invoke(context)\n    else:\n        raise","preventionTips":["Check the LoRA's variant tag in the Model Manager before wiring it into a Klein graph.","Match loader nodes to LoRA families: dev LoRAs -> dev loader, Klein LoRAs -> Klein loader.","Prefer frontend-built graphs, which filter cross-family LoRAs automatically."],"tags":["invokeai","lora","variant-mismatch","validation","flux2"],"backgroundTag":"incompatible-model-variant","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}