{"record":{"id":"1abafd4f034663bf","repo":"invoke-ai/InvokeAI","slug":"type-config-name-is-a-single-file-config-i","errorCode":null,"errorMessage":"{type(config).__name__} is a single-file config; it does not belong to this loader.","messagePattern":"(.+?) is a single-file config; it does not belong to this loader\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/load/model_loaders/wan.py","lineNumber":64,"sourceCode":"\n@ModelLoaderRegistry.register(base=BaseModelType.Wan, type=ModelType.Main, format=ModelFormat.Diffusers)\nclass WanDiffusersModel(GenericDiffusersLoader):\n    \"\"\"Loader for Wan 2.2 diffusers-format models (T2V-A14B and TI2V-5B).\n\n    Forces bfloat16 for the transformer and VAE — fp16 is unstable on Wan VAE\n    (same issue affects the Flux VAE). Resolves the appropriate Hugging Face\n    class for each submodel via the parent loader's ``get_hf_load_class``.\n    \"\"\"\n\n    def _load_model(\n        self,\n        config: AnyModelConfig,\n        submodel_type: Optional[SubModelType] = None,\n    ) -> AnyModel:\n        if isinstance(config, Checkpoint_Config_Base):\n            # Defensive: the registry keys on format, so single-file configs are\n            # routed to WanGGUFCheckpointModel / WanCheckpointModel, not here.\n            raise TypeError(f\"{type(config).__name__} is a single-file config; it does not belong to this loader.\")\n\n        if submodel_type is None:\n            raise Exception(\"A submodel type must be provided when loading Wan main pipelines.\")\n\n        if submodel_type is SubModelType.VAE:\n            from invokeai.backend.wan.rocm_causal_conv3d import patch_wan_causal_conv3d_for_rocm\n\n            patch_wan_causal_conv3d_for_rocm()\n\n        model_path = Path(config.path)\n        load_class = self.get_hf_load_class(model_path, submodel_type)\n        repo_variant = config.repo_variant if isinstance(config, Diffusers_Config_Base) else None\n        variant = repo_variant.value if repo_variant else None\n        model_path = model_path / submodel_type.value\n\n        def _load_with_variant_fallback(dtype_kwarg: dict[str, torch.dtype]) -> AnyModel:\n            # Some Wan repos ship without a fp16 variant suffix on every submodel.\n            # If the requested variant isn't on disk, fall back to the default weights.","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/load/model_loaders/wan.py#L46-L82","documentation":"The Wan (diffusers-style) loader refuses single-file checkpoint configs (Checkpoint_Config_Base subclasses). The model registry keys on format, so single-file Wan checkpoints should be routed to WanCheckpointModel or WanGGUFCheckpointModel instead of this loader; hitting this means routing/registry metadata is wrong.","triggerScenarios":"A Wan model registered with format=diffusers (folder) whose config object is actually a Checkpoint_Config_Base subclass reaches WanModel._load_model; custom code instantiates the loader directly with a checkpoint config.","commonSituations":"Model imported with the wrong format/type so the registry dispatches to the wrong loader; stale model record after InvokeAI version upgrade changed loader routing; hand-edited model config.","solutions":["Re-import or edit the model so its format/type match reality (single-file Wan checkpoint should use the checkpoint or GGUF Wan config, not the diffusers-pipeline config).","Update InvokeAI; this defensive check depends on registry format routing that may have been fixed in newer releases.","If calling the loader directly in code, pass a diffusers-style Wan pipeline config or use WanCheckpointModel/WanGGUFCheckpointModel instead."],"exampleFix":"// before\nloader = WanModel(...)  # given Main_Checkpoint_Wan_Config\n\n// after\nif isinstance(config, Checkpoint_Config_Base):\n    loader = WanCheckpointModel(...)  # or WanGGUFCheckpointModel for GGUF","handlingStrategy":"type-guard","validationCode":"from invokeai.backend.model_manager.config import Checkpoint_Config_Base\ndef pick_wan_loader(config):\n    return ('checkpoint', config) if isinstance(config, Checkpoint_Config_Base) else ('diffusers', config)","typeGuard":"def is_single_file_wan_config(config) -> bool:\n    return isinstance(config, Checkpoint_Config_Base)","tryCatchPattern":"try:\n    model = wan_loader.load_model(config, submodel_type)\nexcept TypeError as e:\n    if 'single-file config' in str(e):\n        model = wan_checkpoint_loader.load_model(config, submodel_type)\n    else:\n        raise","preventionTips":["Always import Wan models through the model manager UI/CLI so format routing picks the right loader.","Do not hand-edit model record format fields.","Keep InvokeAI updated so registry config classes match loaders."],"tags":["type-mismatch","model-loading","wan"],"backgroundTag":"wrong-loader-for-config-type","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}