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 FLUX LoRA loader invocation refuses to apply a LoRA whose model key is already present on the target model. InvokeAI tracks loaded LoRAs per-component (transformer, CLIP, T5) and raises ValueError to prevent double-applying weights, which would distort generation. It is a guard against duplicate LoRA application, not a load failure.
Source
Thrown at invokeai/app/invocations/flux_lora_loader.py:72
description=FieldDescriptions.clip,
input=Input.Connection,
)
t5_encoder: T5EncoderField | None = InputField(
default=None,
title="T5 Encoder",
description=FieldDescriptions.t5_encoder,
input=Input.Connection,
)
def invoke(self, context: InvocationContext) -> FluxLoRALoaderOutput:
lora_key = self.lora.key
if not context.models.exists(lora_key):
raise ValueError(f"Unknown lora: {lora_key}!")
# Check for existing LoRAs with the same 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.clip and any(lora.lora.key == lora_key for lora in self.clip.loras):
raise ValueError(f'LoRA "{lora_key}" already applied to CLIP encoder.')
if self.t5_encoder and any(lora.lora.key == lora_key for lora in self.t5_encoder.loras):
raise ValueError(f'LoRA "{lora_key}" already applied to T5 encoder.')
output = FluxLoRALoaderOutput()
# Attach LoRA layers to the models.
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.clip is not None:
output.clip = self.clip.model_copy(deep=True)View on GitHub (pinned to 0b6a024f2f)
Solutions
- Remove the duplicate LoRA loader node or the duplicate edge so the LoRA key is applied only once
- Ensure different LoRA keys are used when stacking LoRAs (each LoRA model must be a distinct model record)
- If you intentionally want re-application, clear/replace the transformer between loads instead of reusing the loaded model
- Update any custom graph-building code to deduplicate LoRA keys before invoking
Example fix
// before: two FluxLoRALoader nodes both referencing lora key 'my_flux_lora' // after: single FluxLoRALoader node; set weight as needed loader = FluxLoRALoader(lora=ModelIdentifierField(key='my_flux_lora'), weight=0.8)
Defensive patterns
Strategy: validation
Validate before calling
keys = [l.lora.key for l in transformer.loras]
assert lora_key not in keys, f"LoRA {lora_key} already applied"
assert context.models.exists(lora_key), f"Unknown lora: {lora_key}" Type guard
def is_not_yet_applied(transformer, lora_key: str) -> bool:
return not transformer or not any(l.lora.key == lora_key for l in transformer.loras) Try / catch
try:
output = loader.invoke(context)
except ValueError as e:
if 'already applied' in str(e):
output = None # treat as already-loaded, skip
else:
raise Prevention
- Never wire the same LoRA loader node twice into one graph
- Deduplicate LoRA keys in programmatic graph builders
- Give each LoRA model a unique key in the Model Manager
When it happens
Trigger: Calling FluxLoRALoader.invoke (i.e., running a graph containing this node) when self.transformer is set and any entry in self.transformer.loras already has lora.key == lora_key — typically because the same FLUX LoRA node output is wired into the graph twice or the loader runs in a loop over the same key.
Common situations: Duplicating a LoRA loader node in the workflow canvas; a linear graph that applies the same LoRA at multiple strengths; programmatic graph construction that appends the same LoRA key twice.
Related errors
- LoRA "{lora_key}" already applied to CLIP encoder.
- LoRA "{lora_key}" already applied to T5 encoder.
- Unknown lora: {lora.lora.key}!
- LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.
- model is not a FLUX.2 LoRA
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/d855c8f6f4ea073e.
Report an issue: GitHub.