{"record":{"id":"81d08ebe32d42cbd","repo":"invoke-ai/InvokeAI","slug":"unsupported-reason","errorCode":null,"errorMessage":"{unsupported_reason}","messagePattern":"\\{unsupported_reason\\}","errorType":"exception","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/main.py","lineNumber":2211,"sourceCode":"    @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\n        explicit_variant = override_fields.pop(\"variant\", None)\n        variant = explicit_variant or _detect_wan_variant_from_state_dict(sd)\n        if variant is None:\n            raise NotAMatchError(\"could not determine Wan variant from state dict\")\n        if variant in (WanVariantType.T2V_A14B, WanVariantType.I2V_A14B) and \"wan22\" not in normalized_identity:\n            raise NotAMatchError(\"Wan A14B GGUF filename or metadata must identify the model as Wan 2.2\")","sourceCodeStart":2193,"sourceCodeEnd":2229,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/main.py#L2193-L2229","documentation":"Raised when _find_unsupported_wan_variant_marker(sd) returns a non-None reason string, which is re-raised verbatim as a NotAMatchError. This detects architectural markers in the GGUF state dict indicating a Wan variant the Wan 2.2 GGUF loader does not cover (gated by inspecting tensor shapes/keys, not just names).","triggerScenarios":"Importing a Wan GGUF whose state dict carries a marker for an unsupported variant (outside the T2V/I2V-A14B and TI2V-5B set the loader handles); novel or repackaged GGUF builds emitting nonstandard transformer layouts.","commonSituations":"Trying brand-new Wan releases right after launch, before InvokeAI adds support; community-repacked GGUFs with hybrid/modified architectures.","solutions":["Read the raised reason string to see which variant marker was detected and check InvokeAI release notes for support status","Update InvokeAI to the latest version, which may have added support for that Wan variant","Use the variant via ComfyUI or another loader that supports it until InvokeAI support lands"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    import_model(path)\nexcept NotAMatchError as e:\n    reason = str(e)\n    if 'not supported' in reason or 'variant' in reason:\n        logger.warning('Wan GGUF rejected: %s — check InvokeAI release notes for variant support', reason)\n    else:\n        raise","preventionTips":["Read the raised reason string — it names the exact unsupported marker detected","Track InvokeAI changelogs when new Wan variants ship","Avoid repackaged/experimental GGUF builds; prefer official releases"],"tags":["model-manager","gguf","wan","unsupported-variant"],"backgroundTag":"unsupported-model-variant","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}