{"record":{"id":"14d170f0ff84ac5d","repo":"invoke-ai/InvokeAI","slug":"model-state-dict-does-not-look-like-a-flux-control","errorCode":null,"errorMessage":"model state dict does not look like a Flux Control LoRA","messagePattern":"model state dict does not look like a Flux Control LoRA","errorType":"exception","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/lora.py","lineNumber":1216,"sourceCode":"\n    trigger_phrases: set[str] | None = Field(None)\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        cls._validate_looks_like_control_lora(mod)\n\n        return cls(**override_fields)\n\n    @classmethod\n    def _validate_looks_like_control_lora(cls, mod: ModelOnDisk) -> None:\n        state_dict = mod.load_state_dict()\n\n        if not is_state_dict_likely_flux_control(state_dict):\n            raise NotAMatchError(\"model state dict does not look like a Flux Control LoRA\")\n\n\nclass LoRA_Diffusers_Config_Base(LoRA_Config_Base):\n    \"\"\"Model config for LoRA/Diffusers models.\"\"\"\n\n    # TODO(psyche): Needs base handling. For FLUX, the Diffusers format does not indicate a folder model; it indicates\n    # the weights format. FLUX Diffusers LoRAs are single files.\n\n    format: Literal[ModelFormat.Diffusers] = Field(default=ModelFormat.Diffusers)\n\n    @classmethod\n    def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:\n        raise_if_not_dir(mod)\n\n        raise_for_override_fields(cls, override_fields)\n\n        cls._validate_base(mod)\n","sourceCodeStart":1198,"sourceCodeEnd":1234,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/lora.py#L1198-L1234","documentation":"NotAMatchError raised by ControlLoRA_LyCORIS_FLUX_Config._validate_looks_like_control_lora when the loaded state dict fails is_state_dict_likely_flux_control, i.e. the file does not carry the distinctive key/shape signature of a FLUX Control LoRA (a ControlNet-style adapter, not an ordinary style LoRA). Thrown from from_model_on_disk so the probe falls through to other LoRA configs.","triggerScenarios":"Probing a single-file LoRA via ControlLoRA_LyCORIS_FLUX_Config.from_model_on_disk where mod.load_state_dict() keys do not satisfy is_state_dict_likely_flux_control — typically an ordinary FLUX LoRA, a non-FLUX Control LoRA, or a ControlNet model saved in a different layout.","commonSituations":"Installing a regular FLUX LoRA that the router tries against the Control-LoRA class first (the error is expected fall-through behavior); downloading a 'control' LoRA trained for SD/SDXL rather than FLUX; a FLUX Control LoRA re-saved by a tool that renamed its distinctive keys.","solutions":["If the file is a plain style LoRA, this error is benign probe fall-through — ensure the correct config class eventually matches it; check that installation completes with the right type (LoRA, not ControlLoRa).","Confirm you downloaded the FLUX variant of the Control LoRA (not SD/SDXL), and from a source using the expected key layout.","Inspect state-dict keys and compare with is_state_dict_likely_flux_control's expectations; re-save with original tooling if a converter renamed keys.","Set the model type explicitly during install (e.g. override_fields type) if auto-detection misroutes a known file."],"exampleFix":"// before: installing an SDXL control-LoRA file into a FLUX install\n// after: download the FLUX control lora, e.g.\n// invokeai-install --model https://.../flux-control-lora.safetensors  # FLUX variant, not sdxl_control.safetensors","handlingStrategy":"validation","validationCode":"from safetensors.torch import load_file\nfrom invokeai.backend.model_manager.util import is_state_dict_likely_flux_control  # wherever exported\nsd = load_file(path)\nif not is_state_dict_likely_flux_control(sd):\n    raise ValueError(f'{path} is not a FLUX Control LoRA; install as a regular LoRA or check the variant')","typeGuard":"def is_flux_control_lora_file(path: str) -> bool:\n    from invokeai.backend.model_manager.util import is_state_dict_likely_flux_control\n    sd = load_file(path)\n    return is_state_dict_likely_flux_control(sd)","tryCatchPattern":"try:\n    install_as_control_lora(path)\nexcept NotAMatchError:\n    logger.info('%s is not a FLUX Control LoRA; falling back to regular LoRA install', path)\n    install_as_lora(path)","preventionTips":["Download the FLUX-specific Control LoRA variant (not SD/SDXL).","Keep control LoRAs in a separate folder from style LoRAs to make intent explicit.","Inspect state-dict keys when a download's provenance is unclear.","Prefer original releases (Black Forest Labs / official repos) over re-saved conversions."],"tags":["model-manager","control-lora","flux","invokeai"],"backgroundTag":"model-format-not-matched","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}