invoke-ai/InvokeAI · error · ValueError
LoRA '{lora_key}' is for {stored_config.base.value if stored
Error message
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. What it means
After fetching the stored model config, invoke() validates that both the caller-supplied lora.base and the stored config are BaseModelType.Krea2 and the config type is ModelType.LoRA. A mismatch (LoRA trained for SDXL/Flux/other architectures, or the stored model is not actually a LoRA) raises this ValueError explaining the LoRA is not Krea-2 compatible.
Source
Thrown at invokeai/app/invocations/krea2_lora_loader.py:69
default=None,
title="Qwen3-VL Encoder",
description=FieldDescriptions.qwen3_vl_encoder,
input=Input.Connection,
)
def invoke(self, context: InvocationContext) -> Krea2LoRALoaderOutput:
lora_key = self.lora.key
if not context.models.exists(lora_key):
raise ValueError(f"Unknown lora: {lora_key}!")
stored_config = context.models.get_config(lora_key)
if (
self.lora.base is not BaseModelType.Krea2
or stored_config.base is not BaseModelType.Krea2
or stored_config.type is not ModelType.LoRA
):
raise ValueError(
f"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."
)
output = Krea2LoRALoaderOutput()
if self.transformer is not None:
output.transformer = self.transformer.model_copy(deep=True)
if self.qwen3_vl_encoder is not None:
output.qwen3_vl_encoder = self.qwen3_vl_encoder.model_copy(deep=True)
transformer_lora = (
next((item for item in output.transformer.loras if item.lora.key == lora_key), None)
if output.transformer is not None
else None
)
encoder_lora = (
next((item for item in output.qwen3_vl_encoder.loras if item.lora.key == lora_key), None)View on GitHub (pinned to 0b6a024f2f)
Solutions
- Use a LoRA trained for Krea-2 (base must be Krea2) or find a Krea-2 compatible equivalent.
- Re-import/re-scan the model in the Model Manager so its base and type metadata are detected correctly.
- Remove the incompatible LoRA node from the workflow or re-point it to a Krea2 model.
- If the file is genuinely Krea2 but misclassified, fix the model's config (base/type) in the model manager record.
Example fix
// before loader.lora = ModelIdentifierField(key="abc123") # SDXL LoRA // after loader.lora = ModelIdentifierField(key="def456") # Krea2 LoRA (base=Krea2, type=LoRA)
Defensive patterns
Strategy: validation
Validate before calling
from invokeai.backend.model_manager.config import BaseModelType, ModelType
key = loader.lora.key
if loader.lora.base is not BaseModelType.Krea2:
raise ValueError(f"{key} is not tagged Krea2")
cfg = context.models.get_config(key)
if cfg.base is not BaseModelType.Krea2 or cfg.type is not ModelType.LoRA:
raise ValueError(f"{key} is {cfg.base.value}/{cfg.type.value}, not a Krea2 LoRA") Type guard
def is_krea2_lora(stored_config) -> bool:
return (
stored_config.base is BaseModelType.Krea2
and stored_config.type is ModelType.LoRA
) Try / catch
try:
output = loader.invoke(context)
except ValueError as e:
if "not Krea-2 models" in str(e):
raise UserInputError("Choose a Krea-2 trained LoRA; this file targets a different architecture") from e
raise Prevention
- Only import LoRA checkpoints explicitly trained for Krea-2
- Check the model's base/type in the Model Manager before wiring it into a Krea-2 graph
- Re-scan models after upgrades so metadata stays accurate
- Filter candidate LoRAs by base==Krea2 when building graphs programmatically
When it happens
Trigger: invoke() where self.lora.base != BaseModelType.Krea2, or stored_config.base != BaseModelType.Krea2, or stored_config.type != ModelType.LoRA.
Common situations: Attaching an SDXL or Flux LoRA to a Krea-2 pipeline; a model folder misclassified during import so its base/type metadata is wrong; using an old workflow whose LoRA metadata predates Krea-2 support.
Related errors
- LoRA '{lora.lora.key}' is for {stored_config.base.value if s
- LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.
- LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.
- LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.
- Unknown lora: {lora_key}!
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/7ef6b6635e441b25.
Report an issue: GitHub.