{"record":{"id":"42082201cceadcbf","repo":"invoke-ai/InvokeAI","slug":"unsupported-model-format-config-format","errorCode":null,"errorMessage":"Unsupported model format: {config.format}","messagePattern":"Unsupported model format: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux_denoise.py","lineNumber":447,"sourceCode":"            )\n            assert isinstance(transformer, Flux)\n            config = transformer_config\n            assert config is not None\n\n            # Determine if the model is quantized.\n            # If the model is quantized, then we need to apply the LoRA weights as sidecar layers. This results in\n            # slower inference than direct patching, but is agnostic to the quantization format.\n            if config.format in [ModelFormat.Checkpoint]:\n                model_is_quantized = False\n            elif config.format in [\n                ModelFormat.BnbQuantizedLlmInt8b,\n                ModelFormat.BnbQuantizednf4b,\n                ModelFormat.GGUFQuantized,\n                ModelFormat.SDNQQuantized,\n            ]:\n                model_is_quantized = True\n            else:\n                raise ValueError(f\"Unsupported model format: {config.format}\")\n\n            # Apply LoRA models to the transformer.\n            # Note: We apply the LoRA after the transformer has been moved to its target device for faster patching.\n            exit_stack.enter_context(\n                LayerPatcher.apply_smart_model_patches(\n                    model=transformer,\n                    patches=self._lora_iterator(context),\n                    prefix=FLUX_LORA_TRANSFORMER_PREFIX,\n                    dtype=inference_dtype,\n                    cached_weights=cached_weights,\n                    force_sidecar_patching=model_is_quantized,\n                )\n            )\n\n            # Prepare IP-Adapter extensions.\n            pos_ip_adapter_extensions, neg_ip_adapter_extensions = self._prep_ip_adapter_extensions(\n                pos_image_prompt_clip_embeds=pos_image_prompt_clip_embeds,\n                neg_image_prompt_clip_embeds=neg_image_prompt_clip_embeds,","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux_denoise.py#L429-L465","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Convert/re-export the model to a supported format (e.g. diffusers format, or bnb-nf4/GGUF/SDNQ quantization).","Update InvokeAI to the latest version, which may have added support for the format.","Check config.format of the model in the model manager and re-import the model with the correct format detected."],"exampleFix":"// before\n// model imported as unknown/custom format -> Unsupported model format\n// after\n// re-import the FLUX transformer as diffusers format or GGUF/bnb-nf4/SDNQ quantization","handlingStrategy":"try-catch","validationCode":"SUPPORTED = {ModelFormat.Diffusers, ModelFormat.BnbQuantizednf4b, ModelFormat.GGUFQuantized, ModelFormat.SDNQQuantized}\nif model_config.format not in SUPPORTED:\n    raise ValueError(f\"Model format {model_config.format} not supported for FLUX denoise\")","typeGuard":"def is_supported_flux_format(config) -> bool:\n    return config.format in {ModelFormat.Diffusers, ModelFormat.BnbQuantizednf4b, ModelFormat.GGUFQuantized, ModelFormat.SDNQQuantized}","tryCatchPattern":"try:\n    result = invoke(denoise)\nexcept ValueError as e:\n    if 'Unsupported model format' in str(e):\n        model_config = reimport_model_supported_format(model_config)\n        result = invoke(denoise)\n    else:\n        raise","preventionTips":["Keep InvokeAI updated for new quantization format support","Verify the detected format after importing models into the model manager","Convert third-party checkpoints to a standard supported format before use"],"tags":["flux","model-format","quantization","unsupported"],"backgroundTag":"unsupported-model-format","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}