{"record":{"id":"90cf6289141e8bb4","repo":"invoke-ai/InvokeAI","slug":"lora-lora-lora-key-is-for-lora-lora-base-valu-90cf62","errorCode":null,"errorMessage":"LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.lora.base else 'unknown'} models, not FLUX.2 Klein models. Ensure you are using a FLUX.2 compatible LoRA.","messagePattern":"LoRA '(.+?)' is for (.+?) models, not FLUX\\.2 Klein models\\. Ensure you are using a FLUX\\.2 compatible LoRA\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux2_klein_lora_loader.py","lineNumber":184,"sourceCode":"        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 Exception(f\"Unknown lora: {lora.lora.key}!\")\n\n            if lora.lora.base is not BaseModelType.Flux2:\n                raise ValueError(\n                    f\"LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.lora.base else 'unknown'} models, \"\n                    \"not FLUX.2 Klein models. Ensure you are using a FLUX.2 compatible LoRA.\"\n                )\n\n            lora_config = context.models.get_config(lora.lora.key)\n            # Reject cross-family (dev) LoRAs, matching the single-LoRA loader above.\n            _assert_not_dev_lora(context, lora_config)\n\n            # Warn if LoRA variant doesn't match transformer variant (intra-Klein 4B/9B).\n            lora_variant = getattr(lora_config, \"variant\", None)\n            if lora_variant and self.transformer is not None:\n                transformer_config = context.models.get_config(self.transformer.transformer.key)\n                transformer_variant = getattr(transformer_config, \"variant\", None)\n                if transformer_variant and lora_variant != transformer_variant:\n                    context.logger.warning(\n                        f\"LoRA variant mismatch: LoRA '{lora_config.name}' is for {lora_variant.value} \"\n                        f\"but transformer is {transformer_variant.value}. This may cause shape errors.\"\n                    )","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux2_klein_lora_loader.py#L166-L202","documentation":"invoke() raised ValueError because the LoRA's base model type is not BaseModelType.Flux2. The loader only accepts FLUX.2-family LoRAs and rejects anything trained for another architecture (SD1/SDXL/FLUX.1 dev etc.), matching the single-LoRA loader's guard. This prevents shape/dtype errors from applying incompatible weights.","triggerScenarios":"A LoRA whose lora.lora.base is any BaseModelType other than Flux2 is included in the loader input during invoke(); if base is None it reports 'unknown'.","commonSituations":"User downloaded an SDXL or FLUX.1-dev LoRA and attached it to a FLUX.2 Klein workflow; old workflow referencing a LoRA re-imported under a different base type; cross-family (dev) LoRA mistaken for a Klein-compatible one.","solutions":["Replace the LoRA with one trained for FLUX.2 Klein (base model Flux2)","Check the LoRA's base model in the model manager and remove incompatible entries from the workflow","Re-download the LoRA from a source that offers a FLUX.2 build","Catch ValueError and skip/filter LoRAs whose base != Flux2 before invoking"],"exampleFix":"// before\nloader.loras = [sdxl_lora, flux2_lora]\n// after\nloader.loras = [l for l in loader.loras if l.lora.base == BaseModelType.Flux2]\noutput = loader.invoke(context)","handlingStrategy":"validation","validationCode":"bad = [l for l in loader.loras\n       if getattr(l.lora, 'base', None) != BaseModelType.Flux2]\nif bad:\n    raise ValueError(f\"Non-FLUX.2 LoRAs: {[l.lora.key for l in bad]}\")","typeGuard":"def is_flux2_lora(lora) -> bool:\n    return lora.lora.base is BaseModelType.Flux2","tryCatchPattern":"try:\n    output = loader.invoke(context)\nexcept ValueError as e:\n    if 'not FLUX.2 Klein models' in str(e):\n        loader.loras = [l for l in loader.loras if l.lora.base is BaseModelType.Flux2]\n        output = loader.invoke(context)\n    else:\n        raise","preventionTips":["Check a LoRA's base model type in the model manager before adding it to Klein workflows","Keep FLUX.2 LoRAs in a separate model folder/tag from FLUX.1/SDXL LoRAs","Filter loader inputs by BaseModelType.Flux2 as a habit"],"tags":["lora","base-model-mismatch","flux2-klein","invokeai"],"backgroundTag":"lora-base-model-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}