invoke-ai/InvokeAI · error · ValueError

Unsupported model format: {config.format}

Error message

Unsupported model format: {config.format}

What it means

The FLUX transformer's model format must be one the invocation knows how to handle (including quantized formats like bnb-nf4, GGUF, and SDNQ). If config.format falls outside the supported list, LayerPatcher/LoRA application cannot be assumed to work, so a ValueError is raised.

Source

Thrown at invokeai/app/invocations/flux_denoise.py:447

            )
            assert isinstance(transformer, Flux)
            config = transformer_config
            assert config is not None

            # Determine if the model is quantized.
            # If the model is quantized, then we need to apply the LoRA weights as sidecar layers. This results in
            # slower inference than direct patching, but is agnostic to the quantization format.
            if config.format in [ModelFormat.Checkpoint]:
                model_is_quantized = False
            elif config.format in [
                ModelFormat.BnbQuantizedLlmInt8b,
                ModelFormat.BnbQuantizednf4b,
                ModelFormat.GGUFQuantized,
                ModelFormat.SDNQQuantized,
            ]:
                model_is_quantized = True
            else:
                raise ValueError(f"Unsupported model format: {config.format}")

            # Apply LoRA models to the transformer.
            # Note: We apply the LoRA after the transformer has been moved to its target device for faster patching.
            exit_stack.enter_context(
                LayerPatcher.apply_smart_model_patches(
                    model=transformer,
                    patches=self._lora_iterator(context),
                    prefix=FLUX_LORA_TRANSFORMER_PREFIX,
                    dtype=inference_dtype,
                    cached_weights=cached_weights,
                    force_sidecar_patching=model_is_quantized,
                )
            )

            # Prepare IP-Adapter extensions.
            pos_ip_adapter_extensions, neg_ip_adapter_extensions = self._prep_ip_adapter_extensions(
                pos_image_prompt_clip_embeds=pos_image_prompt_clip_embeds,
                neg_image_prompt_clip_embeds=neg_image_prompt_clip_embeds,

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Convert/re-export the model to a supported format (e.g. diffusers format, or bnb-nf4/GGUF/SDNQ quantization).
  2. Update InvokeAI to the latest version, which may have added support for the format.
  3. Check config.format of the model in the model manager and re-import the model with the correct format detected.

Example fix

// before
// model imported as unknown/custom format -> Unsupported model format
// after
// re-import the FLUX transformer as diffusers format or GGUF/bnb-nf4/SDNQ quantization
Defensive patterns

Strategy: try-catch

Validate before calling

SUPPORTED = {ModelFormat.Diffusers, ModelFormat.BnbQuantizednf4b, ModelFormat.GGUFQuantized, ModelFormat.SDNQQuantized}
if model_config.format not in SUPPORTED:
    raise ValueError(f"Model format {model_config.format} not supported for FLUX denoise")

Type guard

def is_supported_flux_format(config) -> bool:
    return config.format in {ModelFormat.Diffusers, ModelFormat.BnbQuantizednf4b, ModelFormat.GGUFQuantized, ModelFormat.SDNQQuantized}

Try / catch

try:
    result = invoke(denoise)
except ValueError as e:
    if 'Unsupported model format' in str(e):
        model_config = reimport_model_supported_format(model_config)
        result = invoke(denoise)
    else:
        raise

Prevention

When it happens

Trigger: Loading a FLUX transformer whose ModelFormat is not in the supported set checked in _run_diffusion (e.g. a new/unknown quantization format, checkpoint format not whitelisted, or a diffusers vs checkpoint format mismatch for FLUX).

Common situations: Using a newly released quantization format before InvokeAI adds support; a model converted to an unusual format by a third-party tool; pointing the model loader at a raw checkpoint when the pipeline expects a supported format.

Related errors


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