invoke-ai/InvokeAI · error · ValueError

Unrecognized LLLite module name: '{name}'

Error message

Unrecognized LLLite module name: '{name}'

What it means

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.

Source

Thrown at invokeai/backend/anima/control_net_lllite.py:406

        self.cond_in_channels = cond_in_channels
        # Training-time RGB-masking policy for cond image preparation; does not
        # alter the forward pass.
        self.inpaint_masked_input = inpaint_masked_input
        self.multiplier = multiplier

        self.conditioning1 = _Conditioning1(
            cond_dim,
            cond_emb_dim,
            cond_resblocks,
            use_aspp=use_aspp,
            aspp_dilations=aspp_dilations,
            cond_in_channels=cond_in_channels,
        )

        modules = []
        for name, in_dim in module_specs:
            if MODULE_NAME_PATTERN.match(name) is None:
                raise ValueError(f"Unrecognized LLLite module name: '{name}'")
            modules.append(LLLiteModuleDiT(name, in_dim, cond_emb_dim, mlp_dim, multiplier=multiplier))
        self.lllite_modules = nn.ModuleList(modules)

    @classmethod
    def from_state_dict(
        cls, state_dict: dict[str, torch.Tensor], metadata: dict[str, str] | None
    ) -> AnimaControlNetLLLite:
        """Build the adapter from a saved v2 named-key state dict.

        Hyperparams come from ``lllite.*`` metadata when present, with
        state-dict-shape fallbacks. ``inpaint_masked_input`` is metadata-only
        (not derivable from shapes; defaults to False).
        """
        meta = metadata or {}

        if any(k.startswith(_LEGACY_MODULES_PREFIX) for k in state_dict):
            raise ValueError(
                f"State dict appears to be in a legacy ControlNet-LLLite weight format (keys starting "

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Use checkpoint keys matching 'lllite_dit_blocks_<n>_<suffix>' exactly; inspect with a quick key dump.
  2. Re-export/rename the checkpoint keys to the v2 named-key format.
  3. Confirm the ControlNet was trained for this model (Anima DiT) not another architecture.
  4. Check for version mismatch between the checkpoint exporter and this library.

Example fix

# before
modules = [("lllite_blocks_0_down", 3072)]  # typo: missing 'dit'
# after
modules = [("lllite_dit_blocks_0_down", 3072)]
Defensive patterns

Strategy: validation

Validate before calling

import re
MODULE_NAME_PATTERN = re.compile(r"^lllite_dit_blocks_(\d+)_(\w+)$")
def validate_module_names(names: list[str]) -> None:
    bad = [n for n in names if MODULE_NAME_PATTERN.match(n) is None]
    if bad:
        raise ValueError(f"unrecognized LLLite module names: {bad}")

Type guard

import re
_PATTERN = re.compile(r"lllite_dit_blocks_(\d+)_(\w+)")
def is_valid_lllite_name(name: str) -> bool:
    return _PATTERN.match(name) is not None

Try / catch

try:
    cnet = ControlNetLLLiteDiT(..., module_specs=module_specs)
except ValueError as e:
    raise ValueError(f"checkpoint uses unsupported module names: {e}; re-export in v2 format") from e

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/877dd21454b4010b. Report an issue: GitHub.