invoke-ai/InvokeAI · error · ValueError

LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.

Error message

LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.lora.base else 'unknown'} models, not FLUX.2 [dev] models. Ensure you are using a FLUX.2 [dev] compatible LoRA.

What it means

Within the collection loader, each LoRA's base model type is checked before patching: only BaseModelType.Flux2 LoRAs are valid. FLUX.1 LoRAs (base 'flux') lack a variant field, so the later _assert_dev_lora check would miss them and they would fail late during model patching; this fail-fast ValueError gives a clear message instead (a bare assert would be stripped under python -O).

Source

Thrown at invokeai/app/invocations/flux2_dev_lora_loader.py:168

        if self.transformer is not None:
            output.transformer = self.transformer.model_copy(deep=True)
        if self.mistral_encoder is not None:
            output.mistral_encoder = self.mistral_encoder.model_copy(deep=True)

        for lora in loras:
            if lora is None:
                continue
            if lora.lora.key in added_loras:
                continue
            if not context.models.exists(lora.lora.key):
                raise Exception(f"Unknown lora: {lora.lora.key}!")

            # A FLUX.1 LoRA (base `flux`) has no variant field, so `_assert_dev_lora` below
            # would pass it through to model patching where it fails late. Fail fast here with
            # a clear error instead, matching the Klein collection loader. (A bare `assert`
            # would also be stripped under `python -O`.)
            if lora.lora.base is not BaseModelType.Flux2:
                raise ValueError(
                    f"LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.lora.base else 'unknown'} models, "
                    "not FLUX.2 [dev] models. Ensure you are using a FLUX.2 [dev] compatible LoRA."
                )

            lora_config = context.models.get_config(lora.lora.key)
            # Reject variant-mismatched LoRAs, matching the single-LoRA loader above.
            _assert_dev_lora(context, lora_config)

            added_loras.append(lora.lora.key)

            if self.transformer is not None and output.transformer is not None:
                output.transformer.loras.append(lora)
            if self.mistral_encoder is not None and output.mistral_encoder is not None:
                output.mistral_encoder.loras.append(lora)

        return output

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Replace the LoRA with one trained for FLUX.2 [dev] (base=flux2)
  2. Rebuild the workflow using FLUX.1 nodes (FluxLoRALoaderInvocation and friends) if the LoRA is FLUX.1-only
  3. Check each LoRA's base model type in Model Manager before adding to FLUX.2 chains

Example fix

# before
loader = Flux2DevLoRALoaderInvocation(lora=flux1_lora_key, transformer=x)
# after
loader = FluxLoRALoaderInvocation(lora=flux1_lora_key, model=flux1_unet)  # FLUX.1 pipeline
# or use a flux2-based lora key with the dev loader
Defensive patterns

Strategy: validation

Validate before calling

for l in loras:
    if l is not None and l.lora.base is not BaseModelType.Flux2:
        raise ValueError(f'{l.lora.key} is {l.lora.base.value}, not flux2')

Type guard

def is_flux2_lora(field) -> bool:
    return field.lora.base is BaseModelType.Flux2

Try / catch

try:
    out = pager.invoke(context)
except ValueError as e:
    if 'not FLUX.2 [dev] models' in str(e):
        loras = [l for l in loras if l.lora.base is BaseModelType.Flux2]
        out = pager.invoke(context)
    else:
        raise

Prevention

When it happens

Trigger: Feeding a FLUX.1 LoRA (base=flux) into a Flux2DevLoRALoaderInvocation or into the transformer/encoder loras consumed by the dev collection loader.

Common situations: Reusing an old FLUX.1 dev workflow graph with FLUX.2 nodes; downloading a FLUX.1 LoRA and selecting it in a FLUX.2 dev loader; mixing LoRAs across model generations in one chain.

Related errors


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