invoke-ai/InvokeAI · error · ValueError
LoRA '{lora_key}' has conflicting weights on the transformer
Error message
LoRA '{lora_key}' has conflicting weights on the transformer ({transformer_lora.weight}) and Qwen3-VL encoder ({encoder_lora.weight}). What it means
When the same LoRA key is already applied to both the transformer and the Qwen3-VL encoder sub-models, invoke() compares the two recorded weights. If they differ, applying it again with a single weight would be ambiguous, so a ValueError naming both conflicting weights is raised. The loader requires one consistent weight per LoRA across both attached components.
Source
Thrown at invokeai/app/invocations/krea2_lora_loader.py:92
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)
if output.qwen3_vl_encoder is not None
else None
)
if transformer_lora is not None and encoder_lora is not None and transformer_lora.weight != encoder_lora.weight:
raise ValueError(
f"LoRA '{lora_key}' has conflicting weights on the transformer ({transformer_lora.weight}) and "
f"Qwen3-VL encoder ({encoder_lora.weight})."
)
effective_lora = transformer_lora or encoder_lora or LoRAField(lora=self.lora, weight=self.weight)
if output.transformer is not None and transformer_lora is None:
output.transformer.loras.append(effective_lora.model_copy(deep=True))
if output.qwen3_vl_encoder is not None and encoder_lora is None:
output.qwen3_vl_encoder.loras.append(effective_lora.model_copy(deep=True))
return output
@invocation(
"krea2_lora_collection_loader",
title="Apply LoRA Collection - Krea-2",
tags=["lora", "model", "krea2", "krea-2"],
category="model",View on GitHub (pinned to 0b6a024f2f)
Solutions
- Set the same weight for this LoRA on every loader node that targets it (transformer and encoder paths).
- Remove duplicate loader nodes applying the same LoRA key; keep a single loader invocation.
- Inspect the incoming transformer/encoder LoRAField weights (workflow editor) and align them before invoking.
- If different weights are intentionally needed, split into separate LoRA copies with distinct keys rather than one shared key.
Example fix
// before: same LoRA applied twice with different weights loaderA.weight = 0.8; loaderB.weight = 0.4 // both target lora key X // after loaderA.weight = 0.8; loaderB.weight = 0.8 // consistent weight for key X (or delete loaderB)
Defensive patterns
Strategy: validation
Validate before calling
def lora_weights_consistent(transformer, encoder, lora_key):
t = next((i for i in transformer.loras if i.lora.key == lora_key), None) if transformer else None
e = next((i for i in encoder.loras if i.lora.key == lora_key), None) if encoder else None
if t and e and t.weight != e.weight:
raise ValueError(f"LoRA {lora_key} has weights {t.weight} vs {e.weight} - align them")
return True Try / catch
try:
output = loader.invoke(context)
except ValueError as e:
if "conflicting weights" in str(e):
raise UserInputError("Apply the same weight for this LoRA on both transformer and Qwen3-VL encoder, or use one loader node") from e
raise Prevention
- Use a single LoRA loader node per LoRA key instead of duplicating loaders
- When editing workflow JSON, update the weight everywhere the same key appears
- Centralize LoRA weight configuration in one variable in scripts
- Review chained Krea2 loader nodes for repeated keys before running
When it happens
Trigger: invoke() where output.transformer and output.qwen3_vl_encoder both contain an entry with lora.key == lora_key but transformer_lora.weight != encoder_lora.weight (e.g. from earlier loader invocations using different weights), and a new loader call targets the same key.
Common situations: Chaining multiple Krea2 LoRA loader nodes that apply the same LoRA with different weights; programmatically mutating the LoRAField weights on one sub-model but not the other; copying/pasting graph nodes and editing only one weight.
Related errors
- Unknown lora: {lora_key}!
- Unknown lora: {lora_key}!
- LoRA '{lora_key}' is for {stored_config.base.value if stored
- Unknown lora: {lora.lora.key}!
- LoRA '{lora.lora.key}' is for {stored_config.base.value if s
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/892bb3b76b836cc1.
Report an issue: GitHub.