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 models. Ensure you are using a FLUX compatible LoRA.

What it means

The loader validates that every collected LoRA has base model type BaseModelType.Flux. If the LoRA was trained/registered for another architecture (SD1, SDXL, etc.) it raises ValueError explaining the LoRA is not FLUX compatible. Cross-architecture LoRAs cannot be applied to a FLUX transformer.

Source

Thrown at invokeai/app/invocations/flux_lora_loader.py:170

            output.transformer = self.transformer.model_copy(deep=True)

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

        if self.t5_encoder is not None:
            output.t5_encoder = self.t5_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}!")

            if lora.lora.base is not BaseModelType.Flux:
                raise ValueError(
                    f"LoRA '{lora.lora.key}' is for {lora.lora.base.value if lora.lora.base else 'unknown'} models, "
                    "not FLUX models. Ensure you are using a FLUX compatible LoRA."
                )

            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.clip is not None and output.clip is not None:
                output.clip.loras.append(lora)

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

        return output

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Use a FLUX-specific LoRA trained for the FLUX architecture
  2. Check the LoRA's base model type in the Model Manager before adding it to a FLUX graph
  3. Remove the incompatible LoRA node from the FLUX workflow
  4. Re-import the LoRA ensuring the correct base model type is detected/configured

Example fix

// before
lora=ModelIdentifierField(key='sdxl_detail_lora')  # base=SDXL
// after
lora=ModelIdentifierField(key='flux_detail_lora')  # base=Flux
Defensive patterns

Strategy: validation

Validate before calling

cfg = context.models.get_config(lora_key)
if cfg.base is not BaseModelType.Flux:
    raise ValueError(f"{lora_key} is {cfg.base}, not Flux")

Type guard

def is_flux_lora(config) -> bool:
    return config.base is BaseModelType.Flux

Try / catch

try:
    output = collector.invoke(context)
except ValueError as e:
    if 'not FLUX models' in str(e):
        # swap in a FLUX-compatible LoRA
        pass
    else:
        raise

Prevention

When it happens

Trigger: invoke() collects a LoRA whose lora.lora.base is not BaseModelType.Flux (e.g., an SDXL LoRA node feeding a FLUX graph, or a LoRA record with a null/unknown base).

Common situations: Downloading an SD1.5/SDXL LoRA and wiring it into a FLUX workflow; a malformed model record where base type is missing; mixing pipelines from different model families in one graph.

Related errors


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