invoke-ai/InvokeAI · error · ValueError

LoRA '{lora.lora.key}' has conflicting weights on the transf

Error message

LoRA '{lora.lora.key}' has conflicting weights on the transformer ({transformer_lora.weight}) and Qwen3-VL encoder ({encoder_lora.weight}).

What it means

The Krea-2 LoRA loader allows a single LoRA to be applied to both the transformer and the Qwen3-VL text encoder, but only when both applications use the same weight. If a LoRA entry resolves to weights on both components with different values, InvokeAI cannot pick one unambiguously and raises this ValueError during invoke().

Source

Thrown at invokeai/app/invocations/krea2_lora_loader.py:172

                    "not Krea-2 models. Ensure you are using a Krea-2 compatible LoRA."
                )

            transformer_lora = (
                next((item for item in output.transformer.loras if item.lora.key == lora.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.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.lora.key}' has conflicting weights on the transformer "
                    f"({transformer_lora.weight}) and Qwen3-VL encoder ({encoder_lora.weight})."
                )
            effective_lora = transformer_lora or encoder_lora or lora

            if self.transformer is not None and output.transformer is not None:
                if transformer_lora is None:
                    output.transformer.loras.append(effective_lora.model_copy(deep=True))
            if self.qwen3_vl_encoder is not None and output.qwen3_vl_encoder is not None:
                if encoder_lora is None:
                    output.qwen3_vl_encoder.loras.append(effective_lora.model_copy(deep=True))

        return output

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Set the LoRA's transformer weight and Qwen3-VL encoder weight to the same value for that entry.
  2. If only one target is wanted, load the LoRA so it only applies to the transformer (or encoder), not both.
  3. Duplicate the LoRA entry in the list: one targeting only the transformer, one targeting only the encoder, each with its own weight.
  4. Downgrade/verify the LoRA file — some checkpoints embed mismatched per-component metadata; re-export or patch it.

Example fix

// before
Krea2LoRALoader(lora=[LoRA(model=lora_model, weight=0.8)], transformer_weight=0.8, encoder_weight=0.5)
// after
Krea2LoRALoader(lora=[LoRA(model=lora_model, weight=0.8)], transformer_weight=0.8, encoder_weight=0.8)
Defensive patterns

Strategy: validation

Validate before calling

from invokeai.app.invocations.krea2_lora_loader import Krea2LoRALoaderInput

for lora in lora_loader_input.lora:
    t_w, e_w = lora.transformer_weight, lora.encoder_weight
    if t_w is not None and e_w is not None and t_w != e_w:
        raise ValueError(f"LoRA {lora.model.key}: align transformer ({t_w}) and encoder ({e_w}) weights")

Type guard

def weights_aligned(t_w: float | None, e_w: float | None) -> bool:
    return t_w is None or e_w is None or t_w == e_w

Try / catch

try:
    output = lora_loader.invoke(context)
except ValueError as e:
    if "conflicting weights" in str(e):
        logger.warning(str(e)); output = fallback_with_uniform_weights(context)
    else:
        raise

Prevention

When it happens

Trigger: Calling Krea2LoRALoaderInput invoke() with a LoRA list containing a LoRA whose model has both a transformer-side and Qwen3-VL-encoder-side state dict (or is applied to both), while the resolved transformer_lora.weight differs from encoder_lora.weight (e.g. weight 0.8 on transformer, 0.5 on encoder).

Common situations: Users setting different strength values for the same LoRA on transformer vs encoder via UI/API fields; multi-LoRA workflows where one entry supports both submodels; migrating prompts from other tools where encoder strength was scaled independently.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/7e7334f880912246. Report an issue: GitHub.