invoke-ai/InvokeAI · error · ValueError
LoRA '{lora_config.name}' is a FLUX.2 [dev] LoRA and cannot
Error message
LoRA '{lora_config.name}' is a FLUX.2 [dev] LoRA and cannot be applied via the FLUX.2 Klein LoRA loader. Use the FLUX.2 [dev] LoRA loader for dev LoRAs. What it means
_assert_not_dev_lora in the FLUX.2 Klein LoRA loader raises this ValueError when the selected LoRA is tagged as a FLUX.2 [dev] LoRA. Dev LoRAs target the [dev] transformer architecture; applying them via the Klein loader would guarantee a shape-mismatch RuntimeError during denoise. This fail-fast backstop exists for hand-built workflow graphs, since the frontend normally filters such combinations.
Source
Thrown at invokeai/app/invocations/flux2_klein_lora_loader.py:32
invocation_output,
)
from invokeai.app.invocations.fields import FieldDescriptions, Input, InputField, OutputField
from invokeai.app.invocations.model import LoRAField, ModelIdentifierField, Qwen3EncoderField, TransformerField
from invokeai.app.services.shared.invocation_context import InvocationContext
from invokeai.backend.model_manager.taxonomy import BaseModelType, Flux2VariantType, ModelType
def _assert_not_dev_lora(context: InvocationContext, lora_config) -> None:
"""Reject a FLUX.2 [dev] LoRA applied via the FLUX.2 Klein loaders.
A dev LoRA (hidden 5120/6144) on a Klein transformer/encoder (hidden 3072/4096) is
guaranteed to raise a shape-mismatch ``RuntimeError`` during denoise. Fail fast here,
independent of which input the LoRA is wired to. (The frontend filters these out before
they reach the graph; this is the backstop for hand-built workflow graphs.) Intra-Klein
4B-vs-9B mismatches remain a soft warning below.
"""
if getattr(lora_config, "variant", None) == Flux2VariantType.Dev:
raise ValueError(
f"LoRA '{lora_config.name}' is a FLUX.2 [dev] LoRA and cannot be applied via the "
"FLUX.2 Klein LoRA loader. Use the FLUX.2 [dev] LoRA loader for dev LoRAs."
)
@invocation_output("flux2_klein_lora_loader_output")
class Flux2KleinLoRALoaderOutput(BaseInvocationOutput):
"""FLUX.2 Klein LoRA Loader Output"""
transformer: Optional[TransformerField] = OutputField(
default=None, description=FieldDescriptions.transformer, title="Transformer"
)
qwen3_encoder: Optional[Qwen3EncoderField] = OutputField(
default=None, description=FieldDescriptions.qwen3_encoder, title="Qwen3 Encoder"
)
@invocation(View on GitHub (pinned to 0b6a024f2f)
Solutions
- Replace the LoRA with a FLUX.2 Klein-compatible LoRA in the Klein LoRA loader.
- If the intent is to use a dev LoRA, switch the workflow to the FLUX.2 [dev] pipeline and the FLUX.2 [dev] LoRA loader.
- If the LoRA is actually a Klein LoRA, fix its model manager metadata so its variant is not tagged 'dev'.
Example fix
// before klein_loader = Flux2KleinLoRALoader(lora=flux2_dev_lora) // after klein_loader = Flux2KleinLoRALoader(lora=flux2_klein_4b_lora)
Defensive patterns
Strategy: validation
Validate before calling
lora_config = context.models.get_config(lora_key)
if getattr(lora_config, "variant", None) == Flux2VariantType.Dev:
raise ValueError("This is a FLUX.2 [dev] LoRA; use the [dev] LoRA loader") Type guard
def is_dev_lora(config) -> bool:
return getattr(config, "variant", None) == Flux2VariantType.Dev Try / catch
try:
output = klein_lora_loader.invoke(context)
except ValueError as e:
if "is a FLUX.2 [dev] LoRA" in str(e):
dev_loader = Flux2DevLoRALoader(lora=lora_ref)
output = dev_loader.invoke(context)
else:
raise Prevention
- Check the LoRA's variant tag in the Model Manager before wiring it into a Klein graph.
- Match loader nodes to LoRA families: dev LoRAs -> dev loader, Klein LoRAs -> Klein loader.
- Prefer frontend-built graphs, which filter cross-family LoRAs automatically.
When it happens
Trigger: invoke() of flux2_klein_lora_loader calls _assert_not_dev_lora(context, lora_config) and getattr(lora_config, 'variant') == Flux2VariantType.Dev, regardless of which loader input the LoRA is wired to.
Common situations: A user hand-wires a FLUX.2 [dev] LoRA into a Klein workflow graph (bypassing frontend filtering), or picks a dev LoRA from the model list while assembling a Klein pipeline.
Related errors
- LoRA "{lora_key}" already applied to transformer.
- LoRA '{lora_config.name}' is a {lora_variant.value} LoRA and
- LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.
- The {model_name} model must be a Diffusers format model. The
- The {model_name} model must be a FLUX.2 [dev] pipeline, but
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/a286f8c558508f28.
Report an issue: GitHub.