{"record":{"id":"a4bb88091e32c820","repo":"invoke-ai/InvokeAI","slug":"only-the-transformer-submodel-is-available-from-a-a4bb88","errorCode":null,"errorMessage":"Only the Transformer submodel is available from a single-file Wan checkpoint. Pair with a standalone Wan VAE and Wan T5 encoder for the other components.","messagePattern":"Only the Transformer submodel is available from a single-file Wan checkpoint\\. Pair with a standalone Wan VAE and Wan T5 encoder for the other components\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/load/model_loaders/wan.py","lineNumber":487,"sourceCode":"    ``model.diffusion_model.`` key prefix, the native upstream key layout as well\n    as the diffusers one, ComfyUI ``fp8_scaled`` weights (dequantized to the\n    compute dtype at load time), and plain ``float8_e4m3fn`` weights with no\n    scales (cast the same way as any other non-bf16 dtype).\n\n    Like the GGUF loader, one file is one expert; A14B pairing happens at the\n    WanModelLoaderInvocation layer.\n    \"\"\"\n\n    def _load_model(\n        self,\n        config: AnyModelConfig,\n        submodel_type: Optional[SubModelType] = None,\n    ) -> AnyModel:\n        if not isinstance(config, Main_Checkpoint_Wan_Config):\n            raise TypeError(f\"Expected Main_Checkpoint_Wan_Config, got {type(config).__name__}.\")\n\n        if submodel_type != SubModelType.Transformer:\n            raise ValueError(\n                \"Only the Transformer submodel is available from a single-file Wan checkpoint. \"\n                \"Pair with a standalone Wan VAE and Wan T5 encoder for the other components.\"\n            )\n\n        return self._load_from_singlefile(config)\n\n    def _load_from_singlefile(self, config: Main_Checkpoint_Wan_Config) -> AnyModel:\n        import accelerate\n        from diffusers import WanTransformer3DModel\n        from safetensors.torch import load_file\n\n        from invokeai.backend.util.logging import InvokeAILogger\n\n        logger = InvokeAILogger.get_logger(self.__class__.__name__)\n\n        model_path = Path(config.path)\n        target_device = TorchDevice.choose_torch_device()\n        model_dtype = TorchDevice.choose_bfloat16_safe_dtype(target_device)","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/load/model_loaders/wan.py#L469-L505","documentation":"Like the GGUF loader, the regular single-file Wan checkpoint contains only transformer weights; VAE and T5 text encoder must come from standalone models. Any submodel_type other than Transformer is rejected with this ValueError.","triggerScenarios":"Requesting SubModelType.VAE, SubModelType.TextEncoder, or None while loading a Main_Checkpoint_Wan_Config model record; automation iterating all submodels against the single-file checkpoint.","commonSituations":"Assuming a .safetensors Wan checkpoint is a full pipeline; config listing the checkpoint as the source for VAE/text-encoder submodels; scripts copied from diffusers-pipeline loading flows.","solutions":["Request only SubModelType.Transformer from the single-file Wan checkpoint record.","Register standalone Wan VAE and T5 encoder models and use them for the other components.","Use a full Wan diffusers-pipeline model if you want VAE/text-encoder included."],"exampleFix":"// before\nt5 = manager.load_model(wan_ckpt_config, submodel_type=SubModelType.TextEncoder)\n\n// after\ntransformer = manager.load_model(wan_ckpt_config, submodel_type=SubModelType.Transformer)\nt5 = manager.load_model(wan_t5_config, submodel_type=SubModelType.TextEncoder)","handlingStrategy":"validation","validationCode":"from invokeai.backend.model_manager import SubModelType\n\ndef validate_ckpt_submodel(submodel_type):\n    if submodel_type != SubModelType.Transformer:\n        raise ValueError(\"Single-file Wan checkpoints provide only the Transformer; pair with standalone VAE/T5 models\")","typeGuard":null,"tryCatchPattern":"try:\n    model = manager.load_model(wan_ckpt_config, submodel_type)\nexcept ValueError as e:\n    if 'Only the Transformer submodel' in str(e):\n        model = manager.load_model(wan_ckpt_config, submodel_type=SubModelType.Transformer)\n    else:\n        raise","preventionTips":["Load only the Transformer submodel from single-file Wan checkpoints.","Register separate Wan VAE and T5 encoder records for the other components.","Use full Wan diffusers-pipeline models when you need bundled VAE/text-encoder.","Avoid blanket code that requests every SubModelType from every model record."],"tags":["checkpoint","wan","unsupported-operation","model-loading"],"backgroundTag":"unsupported-submodel-request","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}