{"record":{"id":"bae361e2e939d479","repo":"invoke-ai/InvokeAI","slug":"state-dict-does-not-look-like-an-anima-controlnet","errorCode":null,"errorMessage":"state dict does not look like an Anima ControlNet-LLLite model","messagePattern":"state dict does not look like an Anima ControlNet-LLLite model","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/controlnet.py","lineNumber":342,"sourceCode":"        return cls(**args)\n\n    @classmethod\n    def _get_cond_in_channels(cls, mod: ModelOnDisk) -> int:\n        # Mirrors AnimaControlNetLLLite.from_state_dict: prefer the saved `lllite.*` hyperparam, falling back to\n        # the conv1 weight shape (ch_half, cond_in_channels, 4, 4).\n        meta_value = mod.metadata().get(\"lllite.cond_in_channels\")\n        if meta_value is not None:\n            return int(meta_value)\n        conv1_weight = mod.load_state_dict().get(\"lllite_conditioning1.conv1.weight\")\n        if conv1_weight is None:\n            raise NotAMatchError(\"state dict has Anima ControlNet-LLLite keys but no lllite_conditioning1.conv1.weight\")\n        return int(conv1_weight.shape[1])\n\n    @classmethod\n    def _validate_looks_like_anima_lllite(cls, mod: ModelOnDisk) -> None:\n        state_dict = mod.load_state_dict()\n        if not _has_anima_lllite_keys(state_dict):\n            raise NotAMatchError(\"state dict does not look like an Anima ControlNet-LLLite model\")\n","sourceCodeStart":324,"sourceCodeEnd":343,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/controlnet.py#L324-L343","documentation":"_validate_looks_like_anima_lllite is a guard called from from_model_on_disk that requires the state dict to contain the characteristic Anima ControlNet-LLLite keys (checked via _has_anima_lllite_keys). When the keys are absent entirely, the prober concludes the file is not an Anima LLLite model and raises NotAMatchError so other config types can try.","triggerScenarios":"from_model_on_disk probing a ControlNet checkpoint that lacks any Anima LLLite key pattern — a standard SD ControlNet, a kohya LLLite with different naming, or an unrelated safetensors file placed in the models directory.","commonSituations":"Pointing InvokeAI at a generic ControlNet .safetensors expecting LLLite support; downloading a file for a different backend; auto-scan picking up unrelated weight files in a watched folder.","solutions":["Verify the file is genuinely an Anima ControlNet-LLLite checkpoint (check for lllite_conditioning1.* keys)","Use the correct config type / import route for a standard ControlNet model instead","Re-download from the official Anima LLLite release if the file is corrupted or renamed","Exclude the file from the InvokeAI models directory/scan if it belongs to another tool"],"exampleFix":"// before\n# standard SD controlnet.safetensors registered as anima lllite\ninvokeai-Web import ./controlnet.safetensors\n// after\n# import standard controlnets via the controlnet config family\ninvokeai-web import ./controlnet.safetensors  # matched as ControlNet, not Anima LLLite","handlingStrategy":"validation","validationCode":"from safetensors import safe_open\n\ndef looks_like_anima_lllite(path) -> bool:\n    with safe_open(path, framework=\"pt\") as f:\n        return any(k.startswith(\"lllite_conditioning\") for k in f.keys())","typeGuard":null,"tryCatchPattern":"try:\n    config = probe(mod)\nexcept NotAMatchError as e:\n    if \"does not look like an Anima ControlNet-LLLite\" in str(e):\n        config = probe_as_standard_controlnet(mod)  # try other config family\n    else:\n        raise","preventionTips":["Download ControlNet-LLLite models only from trusted Anima releases","Keep standard ControlNets separate from LLLite model folders","Let InvokeAI auto-probe rather than forcing the LLLite config class","Inspect safetensors keys before import to classify the model"],"tags":["python","controlnet","lllite","model-probing"],"backgroundTag":"model-format-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}