{"record":{"id":"96d55cf27c8c4bbb","repo":"invoke-ai/InvokeAI","slug":"lora-lora-lora-key-is-for-lora-lora-base-valu-96d55c","errorCode":null,"errorMessage":"LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.lora.base else 'unknown'} models, not FLUX.2 [dev] models. Ensure you are using a FLUX.2 [dev] compatible LoRA.","messagePattern":"LoRA '(.+?)' is for (.+?) models, not FLUX\\.2 \\[dev\\] models\\. Ensure you are using a FLUX\\.2 \\[dev\\] compatible LoRA\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux2_dev_lora_loader.py","lineNumber":168,"sourceCode":"        if self.transformer is not None:\n            output.transformer = self.transformer.model_copy(deep=True)\n        if self.mistral_encoder is not None:\n            output.mistral_encoder = self.mistral_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            if not context.models.exists(lora.lora.key):\n                raise Exception(f\"Unknown lora: {lora.lora.key}!\")\n\n            # A FLUX.1 LoRA (base `flux`) has no variant field, so `_assert_dev_lora` below\n            # would pass it through to model patching where it fails late. Fail fast here with\n            # a clear error instead, matching the Klein collection loader. (A bare `assert`\n            # would also be stripped under `python -O`.)\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 [dev] models. Ensure you are using a FLUX.2 [dev] compatible LoRA.\"\n                )\n\n            lora_config = context.models.get_config(lora.lora.key)\n            # Reject variant-mismatched LoRAs, matching the single-LoRA loader above.\n            _assert_dev_lora(context, lora_config)\n\n            added_loras.append(lora.lora.key)\n\n            if self.transformer is not None and output.transformer is not None:\n                output.transformer.loras.append(lora)\n            if self.mistral_encoder is not None and output.mistral_encoder is not None:\n                output.mistral_encoder.loras.append(lora)\n\n        return output\n","sourceCodeStart":150,"sourceCodeEnd":185,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux2_dev_lora_loader.py#L150-L185","documentation":"Within the collection loader, each LoRA's base model type is checked before patching: only BaseModelType.Flux2 LoRAs are valid. FLUX.1 LoRAs (base 'flux') lack a variant field, so the later _assert_dev_lora check would miss them and they would fail late during model patching; this fail-fast ValueError gives a clear message instead (a bare assert would be stripped under python -O).","triggerScenarios":"Feeding a FLUX.1 LoRA (base=flux) into a Flux2DevLoRALoaderInvocation or into the transformer/encoder loras consumed by the dev collection loader.","commonSituations":"Reusing an old FLUX.1 dev workflow graph with FLUX.2 nodes; downloading a FLUX.1 LoRA and selecting it in a FLUX.2 dev loader; mixing LoRAs across model generations in one chain.","solutions":["Replace the LoRA with one trained for FLUX.2 [dev] (base=flux2)","Rebuild the workflow using FLUX.1 nodes (FluxLoRALoaderInvocation and friends) if the LoRA is FLUX.1-only","Check each LoRA's base model type in Model Manager before adding to FLUX.2 chains"],"exampleFix":"# before\nloader = Flux2DevLoRALoaderInvocation(lora=flux1_lora_key, transformer=x)\n# after\nloader = FluxLoRALoaderInvocation(lora=flux1_lora_key, model=flux1_unet)  # FLUX.1 pipeline\n# or use a flux2-based lora key with the dev loader","handlingStrategy":"validation","validationCode":"for l in loras:\n    if l is not None and l.lora.base is not BaseModelType.Flux2:\n        raise ValueError(f'{l.lora.key} is {l.lora.base.value}, not flux2')","typeGuard":"def is_flux2_lora(field) -> bool:\n    return field.lora.base is BaseModelType.Flux2","tryCatchPattern":"try:\n    out = pager.invoke(context)\nexcept ValueError as e:\n    if 'not FLUX.2 [dev] models' in str(e):\n        loras = [l for l in loras if l.lora.base is BaseModelType.Flux2]\n        out = pager.invoke(context)\n    else:\n        raise","preventionTips":["Filter chain LoRAs by base == flux2 before feeding dev loaders","Never mix FLUX.1 and FLUX.2 LoRAs in one chain","Label/organize downloaded LoRAs by base model family"],"tags":["lora","flux2","base-model-mismatch","validation"],"backgroundTag":"lora-variant-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}