{"record":{"id":"1d6e492be6a6d86a","repo":"invoke-ai/InvokeAI","slug":"lora-lora-lora-key-is-for-stored-config-base","errorCode":null,"errorMessage":"LoRA '{lora.lora.key}' is for {stored_config.base.value if stored_config.base else 'unknown'} models, not Krea-2 models. Ensure you are using a Krea-2 compatible LoRA.","messagePattern":"LoRA '(.+?)' is for (.+?) models, not Krea-2 models\\. Ensure you are using a Krea-2 compatible LoRA\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/krea2_lora_loader.py","lineNumber":151,"sourceCode":"        output = Krea2LoRALoaderOutput()\n        loras = self.loras if isinstance(self.loras, list) else [self.loras]\n        if self.transformer is not None:\n            output.transformer = self.transformer.model_copy(deep=True)\n        if self.qwen3_vl_encoder is not None:\n            output.qwen3_vl_encoder = self.qwen3_vl_encoder.model_copy(deep=True)\n\n        for lora in loras:\n            if lora is None:\n                continue\n            if not context.models.exists(lora.lora.key):\n                raise ValueError(f\"Unknown lora: {lora.lora.key}!\")\n            stored_config = context.models.get_config(lora.lora.key)\n            if (\n                lora.lora.base is not BaseModelType.Krea2\n                or stored_config.base is not BaseModelType.Krea2\n                or stored_config.type is not ModelType.LoRA\n            ):\n                raise ValueError(\n                    f\"LoRA '{lora.lora.key}' is for \"\n                    f\"{stored_config.base.value if stored_config.base else 'unknown'} models, \"\n                    \"not Krea-2 models. Ensure you are using a Krea-2 compatible LoRA.\"\n                )\n\n            transformer_lora = (\n                next((item for item in output.transformer.loras if item.lora.key == lora.lora.key), None)\n                if output.transformer is not None\n                else None\n            )\n            encoder_lora = (\n                next((item for item in output.qwen3_vl_encoder.loras if item.lora.key == lora.lora.key), None)\n                if output.qwen3_vl_encoder is not None\n                else None\n            )\n            if (\n                transformer_lora is not None\n                and encoder_lora is not None","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/krea2_lora_loader.py#L133-L169","documentation":"In the per-lora loop of invoke(), after confirming the model exists, it validates that lora.lora.base is BaseModelType.Krea2, the stored config's base is Krea2, and the stored type is ModelType.LoRA. Any mismatch raises this ValueError, telling the user the referenced model is not a Krea-2 compatible LoRA (wrong architecture or wrong model type).","triggerScenarios":"invoke() where any entry in the loras list has base != BaseModelType.Krea2, or its stored_config.base != BaseModelType.Krea2, or stored_config.type != ModelType.LoRA.","commonSituations":"Mixing LoRAs trained for SD1.5/SDXL/Flux into a Krea-2 stack; models misdetected at import so metadata (base/type) is wrong; stale model configs after InvokeAI upgrades that changed base type names.","solutions":["Replace the offending LoRA with one trained for Krea-2 (base=Krea2, type=LoRA).","Re-import the model so the Model Manager re-detects correct base/type metadata.","Edit the model's stored config in the Model Manager if the file is Krea2 but was misclassified.","Filter the loras list before invoking, keeping only entries whose base is Krea2, or surface a warning to the user instead of failing."],"exampleFix":"// before\nloras = [LoRAField(lora=ModelIdentifierField(key=\"sdxl-lora\"), weight=0.6)]\n// after: only Krea2 LoRAs\nloras = [l for l in loras if l.lora.base == BaseModelType.Krea2]","handlingStrategy":"validation","validationCode":"from invokeai.backend.model_manager.config import BaseModelType, ModelType\nfor lora in loras:\n    if lora is None:\n        continue\n    if lora.lora.base is not BaseModelType.Krea2:\n        raise ValueError(f\"{lora.lora.key} base={lora.lora.base}, expected Krea2\")\n    cfg = context.models.get_config(lora.lora.key)\n    if cfg.base is not BaseModelType.Krea2 or cfg.type is not ModelType.LoRA:\n        raise ValueError(f\"{lora.lora.key} is {cfg.base.value}/{cfg.type.value}, not a Krea2 LoRA\")","typeGuard":"def is_krea2_lora_entry(lora) -> bool:\n    if lora is None:\n        return True\n    cfg = get_stored_config(lora.lora.key)\n    return (\n        lora.lora.base is BaseModelType.Krea2\n        and cfg is not None\n        and cfg.base is BaseModelType.Krea2\n        and cfg.type is ModelType.LoRA\n    )","tryCatchPattern":"try:\n    output = loader.invoke(context)\nexcept ValueError as e:\n    if \"not Krea-2 models\" in str(e):\n        raise UserInputError(\"One of the LoRAs in this stack is not Krea-2 compatible; remove or replace it\") from e\n    raise","preventionTips":["Keep Krea-2 LoRAs in a dedicated folder and import only from it","Verify base/type metadata in the Model Manager after bulk imports","Reject non-Krea2 models at graph-build time rather than at runtime","Re-scan model directories after InvokeAI upgrades to refresh classifications"],"tags":["lora","model-compatibility","base-model-mismatch","valueerror"],"backgroundTag":"model-architecture-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}