{"record":{"id":"877dd21454b4010b","repo":"invoke-ai/InvokeAI","slug":"unrecognized-lllite-module-name-name","errorCode":null,"errorMessage":"Unrecognized LLLite module name: '{name}'","messagePattern":"Unrecognized LLLite module name: '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/anima/control_net_lllite.py","lineNumber":406,"sourceCode":"        self.cond_in_channels = cond_in_channels\n        # Training-time RGB-masking policy for cond image preparation; does not\n        # alter the forward pass.\n        self.inpaint_masked_input = inpaint_masked_input\n        self.multiplier = multiplier\n\n        self.conditioning1 = _Conditioning1(\n            cond_dim,\n            cond_emb_dim,\n            cond_resblocks,\n            use_aspp=use_aspp,\n            aspp_dilations=aspp_dilations,\n            cond_in_channels=cond_in_channels,\n        )\n\n        modules = []\n        for name, in_dim in module_specs:\n            if MODULE_NAME_PATTERN.match(name) is None:\n                raise ValueError(f\"Unrecognized LLLite module name: '{name}'\")\n            modules.append(LLLiteModuleDiT(name, in_dim, cond_emb_dim, mlp_dim, multiplier=multiplier))\n        self.lllite_modules = nn.ModuleList(modules)\n\n    @classmethod\n    def from_state_dict(\n        cls, state_dict: dict[str, torch.Tensor], metadata: dict[str, str] | None\n    ) -> AnimaControlNetLLLite:\n        \"\"\"Build the adapter from a saved v2 named-key state dict.\n\n        Hyperparams come from ``lllite.*`` metadata when present, with\n        state-dict-shape fallbacks. ``inpaint_masked_input`` is metadata-only\n        (not derivable from shapes; defaults to False).\n        \"\"\"\n        meta = metadata or {}\n\n        if any(k.startswith(_LEGACY_MODULES_PREFIX) for k in state_dict):\n            raise ValueError(\n                f\"State dict appears to be in a legacy ControlNet-LLLite weight format (keys starting \"","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/anima/control_net_lllite.py#L388-L424","documentation":"ControlNet-LLLite module names must match MODULE_NAME_PATTERN (lllite_dit_blocks_<index>_<suffix>). The __init__ raises ValueError when a spec name doesn't match, because target resolution and weight ordering depend on parsing the name. This guards against corrupted or hand-edited model definitions.","triggerScenarios":"Constructing the LLLite wrapper (or from_state_dict, which derives module_specs from names) with names like 'lllite_blocks_0_down', typo'd suffixes, or names from an incompatible model family.","commonSituations":"Loading a checkpoint trained for a different model/layer naming scheme, manually editing state-dict keys, using weights from the legacy or third-party format whose key names differ.","solutions":["Use checkpoint keys matching 'lllite_dit_blocks_<n>_<suffix>' exactly; inspect with a quick key dump.","Re-export/rename the checkpoint keys to the v2 named-key format.","Confirm the ControlNet was trained for this model (Anima DiT) not another architecture.","Check for version mismatch between the checkpoint exporter and this library."],"exampleFix":"# before\nmodules = [(\"lllite_blocks_0_down\", 3072)]  # typo: missing 'dit'\n# after\nmodules = [(\"lllite_dit_blocks_0_down\", 3072)]","handlingStrategy":"validation","validationCode":"import re\nMODULE_NAME_PATTERN = re.compile(r\"^lllite_dit_blocks_(\\d+)_(\\w+)$\")\ndef validate_module_names(names: list[str]) -> None:\n    bad = [n for n in names if MODULE_NAME_PATTERN.match(n) is None]\n    if bad:\n        raise ValueError(f\"unrecognized LLLite module names: {bad}\")","typeGuard":"import re\n_PATTERN = re.compile(r\"lllite_dit_blocks_(\\d+)_(\\w+)\")\ndef is_valid_lllite_name(name: str) -> bool:\n    return _PATTERN.match(name) is not None","tryCatchPattern":"try:\n    cnet = ControlNetLLLiteDiT(..., module_specs=module_specs)\nexcept ValueError as e:\n    raise ValueError(f\"checkpoint uses unsupported module names: {e}; re-export in v2 format\") from e","preventionTips":["Dump and eyeball checkpoint keys before loading.","Use the official trainer/exporter so names follow the pattern.","Never hand-edit key names without updating the pattern expectations.","Pin trainer and library versions together."],"tags":["controlnet","naming","validation","checkpoint"],"backgroundTag":"unrecognized-module-name","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}