{"record":{"id":"06437aa84a7c8cc8","repo":"invoke-ai/InvokeAI","slug":"model-is-a-flux-2-model-not-flux-1","errorCode":null,"errorMessage":"model is a FLUX.2 model, not FLUX.1","messagePattern":"model is a FLUX\\.2 model, not FLUX\\.1","errorType":"exception","errorClass":"NotAMatchError","httpStatus":null,"severity":"info","filePath":"invokeai/backend/model_manager/configs/main.py","lineNumber":658,"sourceCode":"        variant = override_fields.pop(\"variant\", None) or cls._get_variant_or_raise(mod)\n\n        return cls(**override_fields, variant=variant)\n\n    @classmethod\n    def _validate_is_flux(cls, mod: ModelOnDisk) -> None:\n        state_dict = mod.load_state_dict()\n        if not state_dict_has_any_keys_exact(\n            state_dict,\n            {\n                \"double_blocks.0.img_attn.norm.key_norm.scale\",\n                \"model.diffusion_model.double_blocks.0.img_attn.norm.key_norm.scale\",\n            },\n        ):\n            raise NotAMatchError(\"state dict does not look like a FLUX checkpoint\")\n\n        # Exclude FLUX.2 models - they have their own config class\n        if _is_flux2_model(state_dict):\n            raise NotAMatchError(\"model is a FLUX.2 model, not FLUX.1\")\n\n    @classmethod\n    def _get_variant_or_raise(cls, mod: ModelOnDisk) -> FluxVariantType:\n        # FLUX Model variant types are distinguished by input channels and the presence of certain keys.\n        state_dict = mod.load_state_dict()\n        variant = _get_flux_variant(state_dict)\n\n        if variant is None:\n            # TODO(psyche): Should we have a graceful fallback here? Previously we fell back to the \"normal\" variant,\n            # but this variant is no longer used for FLUX models. If we get here, but the model is definitely a FLUX\n            # model, we should figure out a good fallback value.\n            raise NotAMatchError(\"unable to determine model variant from state dict\")\n\n        return variant\n\n    @classmethod\n    def _validate_looks_like_main_model(cls, mod: ModelOnDisk) -> None:\n        has_main_model_keys = _has_main_keys(mod.load_state_dict())","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/main.py#L640-L676","documentation":"After confirming the state dict is a FLUX checkpoint, _validate_is_flux explicitly excludes FLUX.2 models (detected via _is_flux2_model) because FLUX.2 has its own config class. Encountering this error means the file is a FLUX.2 checkpoint being matched against the FLUX.1 config; the probe will (or should) fall through to the FLUX.2 config class.","triggerScenarios":"from_model_on_disk on a FLUX.2 (Klein) checkpoint whose keys satisfy FLUX-style signatures but fail _is_flux2_model exclusion in the FLUX.1 config.","commonSituations":"Importing new FLUX.2 releases into an older InvokeAI where the FLUX.2 config class does not exist, so the probe ends at this error; ambiguous model files; documentation/version confusion between FLUX.1 and FLUX.2 downloads.","solutions":["Upgrade InvokeAI to a version with FLUX.2 support (LoRA_Diffusers_Flux2_Config / FLUX.2 main config) so the probe chain accepts the model.","If you intended FLUX.1, re-download the correct FLUX.1 checkpoint.","Check _is_flux2_model signatures in the state dict to confirm which generation the file is.","If stuck on an old version, manually categorize the model or convert it, but upgrading is the proper fix."],"exampleFix":"// before: old InvokeAI, FLUX.2 file -> 'model is a FLUX.2 model, not FLUX.1'\n// after: upgrade\npip install -U invokeai   # then rescan; FLUX.2 configs handle the model","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"def is_flux2_model(sd: dict) -> bool:\n    from invokeai.backend.model_manager.configs.main import _is_flux2_model\n    return _is_flux2_model(sd)","tryCatchPattern":"try:\n    cfg = probe_model(path)\nexcept NotAMatchError as e:\n    if 'FLUX.2' in str(e):\n        print('FLUX.2 checkpoint detected — requires InvokeAI with FLUX.2 support')","preventionTips":["Upgrade InvokeAI before importing FLUX.2 models","Label model downloads by generation (FLUX.1 vs FLUX.2)","Confirm generation via state-dict signatures before import"],"tags":["flux","flux2","version-mismatch"],"backgroundTag":"model-base-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}