invoke-ai/InvokeAI · error · ValueError
LoRA "{lora_key}" already applied to transformer.
Error message
LoRA "{lora_key}" already applied to transformer. What it means
The Anima LoRA loader refuses to apply the same LoRA twice to the transformer. Before applying, it scans the transformer's existing loras list and raises if an entry with the same model key is already present. This guards against duplicated patches, which would double the LoRA's weight effect on the model.
Source
Thrown at invokeai/app/invocations/anima_lora_loader.py:66
description=FieldDescriptions.transformer,
input=Input.Connection,
title="Anima Transformer",
)
qwen3_encoder: Qwen3EncoderField | None = InputField(
default=None,
title="Qwen3 Encoder",
description=FieldDescriptions.qwen3_encoder,
input=Input.Connection,
)
def invoke(self, context: InvocationContext) -> AnimaLoRALoaderOutput:
lora_key = self.lora.key
if not context.models.exists(lora_key):
raise ValueError(f"Unknown lora: {lora_key}!")
if self.transformer and any(lora.lora.key == lora_key for lora in self.transformer.loras):
raise ValueError(f'LoRA "{lora_key}" already applied to transformer.')
if self.qwen3_encoder and any(lora.lora.key == lora_key for lora in self.qwen3_encoder.loras):
raise ValueError(f'LoRA "{lora_key}" already applied to Qwen3 encoder.')
output = AnimaLoRALoaderOutput()
if self.transformer is not None:
output.transformer = self.transformer.model_copy(deep=True)
output.transformer.loras.append(
LoRAField(
lora=self.lora,
weight=self.weight,
)
)
if self.qwen3_encoder is not None:
output.qwen3_encoder = self.qwen3_encoder.model_copy(deep=True)
output.qwen3_encoder.loras.append(
LoRAField(
lora=self.lora,View on GitHub (pinned to 0b6a024f2f)
Solutions
- Remove the duplicate LoRA node or its duplicate connection from the invocation graph so the key appears only once.
- If you need to re-apply LoRAs, start from a fresh transformer image without the LoRA already attached.
- Deduplicate by key before invoking: filter self.transformer.loras for entries with the same key.
Example fix
// before
lora_loader = AnimaLoRALoader(transformer=prev_transformer, lora=my_lora) # my_lora already in prev_transformer.loras
// after
if my_lora.key not in [l.lora.key for l in prev_transformer.loras]:
lora_loader = AnimaLoRALoader(transformer=prev_transformer, lora=my_lora)
else:
transformer = prev_transformer # already applied Defensive patterns
Strategy: validation
Validate before calling
existing = {l.lora.key for l in transformer.loras}
if lora.key in existing:
raise ValueError(f'LoRA "{lora.key}" already applied to transformer.') Prevention
- Keep a set of applied LoRA keys and check membership before adding a loader invocation.
- Reuse the previous loader's output transformer instead of re-running the loader with the same LoRA.
- Audit saved workflows for duplicated LoRA nodes with identical keys.
When it happens
Trigger: Calling invoke on AnimaLoRALoader when self.transformer.loras already contains an entry whose lora.key equals self.lora.key (e.g. the loader was invoked twice in the same graph, or the transformer output was fed back into the loader).
Common situations: Graph/workflow edits that accidentally wire the same LoRA node into the loader twice; re-running a graph that keeps accumulated state; copy-pasted LoRA entries in a saved workflow.
Related errors
- LoRA "{lora_key}" already applied to Qwen3 encoder.
- LoRA "{lora_key}" already applied to transformer.
- LoRA '{lora_config.name}' is a FLUX.2 [dev] LoRA and cannot
- LoRA "{lora_key}" already applied to transformer.
- LoRA "{lora_key}" already applied to Qwen3 encoder.
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/2418280468b0e8ce.
Report an issue: GitHub.