{"record":{"id":"871171ee817f88f6","repo":"invoke-ai/InvokeAI","slug":"state-dict-has-no-undecorated-transformer-block-we","errorCode":null,"errorMessage":"state dict has no undecorated transformer block weights — it looks like a Wan LoRA or adapter rather than a full transformer","messagePattern":"state dict has no undecorated transformer block weights — it looks like a Wan LoRA or adapter rather than a full transformer","errorType":"exception","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/main.py","lineNumber":2205,"sourceCode":"    expert: Literal[\"high\", \"low\", \"none\"] = Field(\n        default=\"none\",\n        description=\"For Wan 2.2 A14B's dual-expert MoE: 'high' for the high-noise expert, \"\n        \"'low' for the low-noise expert. 'none' for single-transformer models (TI2V-5B).\",\n    )\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        raise_for_override_fields(cls, override_fields)\n\n        sd = mod.load_state_dict()\n\n        if not _has_ggml_tensors(sd):\n            raise NotAMatchError(\"state dict does not look like GGUF quantized\")\n        if not _has_wan_keys(sd):\n            raise NotAMatchError(\"state dict does not look like a Wan transformer\")\n        if not _has_wan_transformer_block_weights(sd):\n            raise NotAMatchError(\n                \"state dict has no undecorated transformer block weights — it looks like a Wan LoRA \"\n                \"or adapter rather than a full transformer\"\n            )\n        unsupported_reason = _find_unsupported_wan_variant_marker(sd)\n        if unsupported_reason is not None:\n            raise NotAMatchError(unsupported_reason)\n        gguf_name = mod.metadata().get(\"general.name\", \"\")\n        normalized_identity = \"\".join(\n            character for character in f\"{mod.path.stem} {gguf_name}\".lower() if character.isalnum()\n        )\n        if \"wan21\" in normalized_identity:\n            raise NotAMatchError(\"Wan 2.1 GGUF models are not supported by the Wan 2.2 loader\")\n        # A misnamed Wan 2.1 GGUF slips past the name check above; the architectural\n        # markers don't care what the file is called.\n        wan_2_1_reason = _find_wan_2_1_marker(sd)\n        if wan_2_1_reason is not None:\n            raise NotAMatchError(f\"Wan 2.1 GGUF models are not supported by the Wan 2.2 loader: {wan_2_1_reason}\")\n","sourceCodeStart":2187,"sourceCodeEnd":2223,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/main.py#L2187-L2223","documentation":"Raised by Main_GGUF_Wan_Config.from_model_on_disk when the state dict has GGML tensors and Wan-like keys but lacks undecorated transformer block weights (_has_wan_transformer_block_weights fails). The message says the file looks like a Wan LoRA or adapter: its keys are decorated with LoRA/adapter prefixes (lora_A/lora_B, delta-style naming) rather than the plain block weight keys a full DiT carries.","triggerScenarios":"Importing a Wan LoRA shipped as GGUF/quantized instead of a full transformer checkpoint; importing a Wan speed-up adapter (lightx2v/ACC-style) GGUF; converting a Wan LoRA to GGUF and placing it in main-model autoimport.","commonSituations":"Downloading Wan 2.2 LoRAs (low-noise/high-noise distill adapters) alongside main model GGUFs and mixing them in one folder; CivitAI Wan LoRA files mislabeled as models.","solutions":["Move the file to the LoRA models folder / import it as a LoRA model type instead of a Main model","Download the actual full Wan 2.2 transformer GGUF (e.g. Wan2.2-T2V-A14B-high-noise-*.gguf) if you intended to install the base model","Check key names in the file (look for lora_A/lora_B prefixes) to confirm it is an adapter before importing"],"exampleFix":"// before\n# wan2.2_lightx2v_T2V_14B_high_noise_lora.gguf placed in autoimport/ as a main model\n// after\n# copy it to autoimport/lora/ (or choose Model Type = LoRA during manual import)","handlingStrategy":"validation","validationCode":"sd = ModelOnDisk(path).load_state_dict()\nkeys = [k for k in sd if isinstance(k, str)]\nif any('.lora_' in k or 'lora_A' in k for k in keys):\n    print(f'{path.name} looks like a LoRA; import it as a LoRA, not a main model')","typeGuard":"def is_full_wan_transformer(sd: dict) -> bool:\n    return _has_wan_keys(sd) and _has_wan_transformer_block_weights(sd)","tryCatchPattern":"try:\n    import_model(path, model_type='main')\nexcept NotAMatchError as e:\n    if 'LoRA' in str(e):\n        import_model(path, model_type='lora')\n    else:\n        raise","preventionTips":["Keep LoRA downloads out of the main/checkpoint autoimport folder","Wan speed-up adapters (lightx2v etc.) are LoRAs — file them under LoRA","Peek at key prefixes (lora_A/lora_B/delta) before bulk-importing unknown GGUFs"],"tags":["model-manager","gguf","wan","lora","model-identification"],"backgroundTag":"lora-mistaken-for-basemodel","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}