{"record":{"id":"892bb3b76b836cc1","repo":"invoke-ai/InvokeAI","slug":"lora-lora-key-has-conflicting-weights-on-the-t","errorCode":null,"errorMessage":"LoRA '{lora_key}' has conflicting weights on the transformer ({transformer_lora.weight}) and Qwen3-VL encoder ({encoder_lora.weight}).","messagePattern":"LoRA '(.+?)' has conflicting weights on the transformer \\((.+?)\\) and Qwen3-VL encoder \\((.+?)\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/krea2_lora_loader.py","lineNumber":92,"sourceCode":"        output = Krea2LoRALoaderOutput()\n\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        transformer_lora = (\n            next((item for item in output.transformer.loras if item.lora.key == 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_key), None)\n            if output.qwen3_vl_encoder is not None\n            else None\n        )\n        if transformer_lora is not None and encoder_lora is not None and transformer_lora.weight != encoder_lora.weight:\n            raise ValueError(\n                f\"LoRA '{lora_key}' has conflicting weights on the transformer ({transformer_lora.weight}) and \"\n                f\"Qwen3-VL encoder ({encoder_lora.weight}).\"\n            )\n        effective_lora = transformer_lora or encoder_lora or LoRAField(lora=self.lora, weight=self.weight)\n\n        if output.transformer is not None and transformer_lora is None:\n            output.transformer.loras.append(effective_lora.model_copy(deep=True))\n        if output.qwen3_vl_encoder is not None and encoder_lora is None:\n            output.qwen3_vl_encoder.loras.append(effective_lora.model_copy(deep=True))\n\n        return output\n\n\n@invocation(\n    \"krea2_lora_collection_loader\",\n    title=\"Apply LoRA Collection - Krea-2\",\n    tags=[\"lora\", \"model\", \"krea2\", \"krea-2\"],\n    category=\"model\",","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/krea2_lora_loader.py#L74-L110","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: same LoRA applied twice with different weights\nloaderA.weight = 0.8; loaderB.weight = 0.4  // both target lora key X\n// after\nloaderA.weight = 0.8; loaderB.weight = 0.8  // consistent weight for key X (or delete loaderB)","handlingStrategy":"validation","validationCode":"def lora_weights_consistent(transformer, encoder, lora_key):\n    t = next((i for i in transformer.loras if i.lora.key == lora_key), None) if transformer else None\n    e = next((i for i in encoder.loras if i.lora.key == lora_key), None) if encoder else None\n    if t and e and t.weight != e.weight:\n        raise ValueError(f\"LoRA {lora_key} has weights {t.weight} vs {e.weight} - align them\")\n    return True","typeGuard":null,"tryCatchPattern":"try:\n    output = loader.invoke(context)\nexcept ValueError as e:\n    if \"conflicting weights\" in str(e):\n        raise UserInputError(\"Apply the same weight for this LoRA on both transformer and Qwen3-VL encoder, or use one loader node\") from e\n    raise","preventionTips":["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"],"tags":["lora","conflicting-weights","graph-validation","valueerror"],"backgroundTag":"conflicting-lora-weights","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}