{"record":{"id":"73f18c43b03c0e43","repo":"invoke-ai/InvokeAI","slug":"model-does-not-match-flux-tools-redux-heuristics","errorCode":null,"errorMessage":"model does not match FLUX Tools Redux heuristics","messagePattern":"model does not match FLUX Tools Redux heuristics","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/flux_redux.py","lineNumber":38,"sourceCode":"    ModelType,\n)\n\n\nclass FLUXRedux_Checkpoint_Config(Config_Base):\n    \"\"\"Model config for FLUX Tools Redux model.\"\"\"\n\n    type: Literal[ModelType.FluxRedux] = Field(default=ModelType.FluxRedux)\n    format: Literal[ModelFormat.Checkpoint] = Field(default=ModelFormat.Checkpoint)\n    base: Literal[BaseModelType.Flux] = Field(default=BaseModelType.Flux)\n\n    @classmethod\n    def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:\n        raise_if_not_file(mod)\n\n        raise_for_override_fields(cls, override_fields)\n\n        if not is_state_dict_likely_flux_redux(mod.load_state_dict()):\n            raise NotAMatchError(\"model does not match FLUX Tools Redux heuristics\")\n\n        return cls(**override_fields)\n","sourceCodeStart":20,"sourceCodeEnd":41,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/flux_redux.py#L20-L41","documentation":"The FLUX Tools Redux config prober validates the candidate's state dict against is_state_dict_likely_flux_redux heuristics. Files that don't match the expected Redux key/shape pattern raise NotAMatchError, letting the model manager try other config types. This is a deliberate 'not this type' signal, not a crash.","triggerScenarios":"from_model_on_disk probing a safetensors file whose keys don't satisfy FLUX Redux heuristics — e.g. a regular FLUX Redux variant the heuristic doesn't recognize, a different adapter (IP-Adapter, ControlNet), or a renamed/re-keyed checkpoint.","commonSituations":"Importing a FLUX.1-Redux vs FLUX Tools Redux variant mismatch; downloading a redux-like adapter from a community repo with divergent keys; probing arbitrary adapters expecting the Redux config to match.","solutions":["Confirm the file is specifically a FLUX Tools Redux checkpoint (check keys against the heuristic expectations)","Let the probe continue — other config classes will match non-Redux adapters automatically","If it IS a Tools Redux file failing heuristics, update InvokeAI; key patterns change between releases","Use override_fields / explicit config assignment only if you are certain of the model type"],"exampleFix":"// before\n# black-forest-labs/FLUX.1-Redux-dev imported expecting Tools Redux match\ninstall_model(\"./flux1-redux-dev.safetensors\")  # NotAMatchError\n// after\n# obtain the FLUX Tools Redux weights and import that file instead\ninstall_model(\"./flux-tools-redux.safetensors\")","handlingStrategy":"try-catch","validationCode":"from safetensors import safe_open\n\ndef looks_like_redux(path) -> bool:\n    with safe_open(path, framework=\"pt\") as f:\n        keys = f.keys()\n    return any(\"redux\" in k.lower() or k.startswith(\"proj\") for k in keys)","typeGuard":null,"tryCatchPattern":"try:\n    config = probe(mod)\nexcept NotAMatchError as e:\n    if \"FLUX Tools Redux\" in str(e):\n        config = probe(mod, candidate_classes=None)  # let other configs match\n    else:\n        raise","preventionTips":["Use official FLUX Tools Redux weights, not community renames","Let auto-probe pick the config class instead of forcing Redux","Keep InvokeAI updated as Redux key heuristics evolve","Verify adapter identity via key names before import"],"tags":["python","flux","redux","model-probing"],"backgroundTag":"model-format-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}