{"record":{"id":"51ffc659caa25dd7","repo":"invoke-ai/InvokeAI","slug":"the-component-source-vae-is-incompatible-with-the","errorCode":null,"errorMessage":"The Component Source VAE is incompatible with the selected transformer. TI2V-5B requires the 48-channel Wan 2.2 VAE; A14B models require the 16-channel Wan 2.1 VAE.","messagePattern":"The Component Source VAE is incompatible with the selected transformer\\. TI2V-5B requires the 48-channel Wan 2\\.2 VAE; A14B models require the 16-channel Wan 2\\.1 VAE\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/wan_model_loader.py","lineNumber":335,"sourceCode":"        if source_config.base != BaseModelType.Wan or source_config.type != ModelType.Main:\n            raise ValueError(\"The Component Source model must resolve to a Wan main model.\")\n        if source_config.format != ModelFormat.Diffusers:\n            raise ValueError(\n                f\"The Component Source model must be in Diffusers format. \"\n                f\"The selected model '{source_config.name}' is in {source_config.format.value} format.\"\n            )\n\n    @staticmethod\n    def _validate_component_source_vae(\n        context: InvocationContext, model: ModelIdentifierField, main_variant: WanVariantType\n    ) -> None:\n        WanModelLoaderInvocation._validate_component_source_format(context, model)\n        source_config = context.models.get_config(model)\n        source_variant = getattr(source_config, \"variant\", None)\n        main_is_ti2v = main_variant == WanVariantType.TI2V_5B\n        source_is_ti2v = source_variant == WanVariantType.TI2V_5B\n        if main_is_ti2v != source_is_ti2v:\n            raise ValueError(\n                \"The Component Source VAE is incompatible with the selected transformer. \"\n                \"TI2V-5B requires the 48-channel Wan 2.2 VAE; A14B models require the 16-channel Wan 2.1 VAE.\"\n            )\n\n    @staticmethod\n    def _validate_standalone_vae(\n        context: InvocationContext, model: ModelIdentifierField, main_variant: WanVariantType\n    ) -> None:\n        vae_config = context.models.get_config(model)\n        if vae_config.base != BaseModelType.Wan or vae_config.type != ModelType.VAE:\n            raise ValueError(\"The VAE must resolve to a standalone Wan VAE model.\")\n        expected_channels = 48 if main_variant == WanVariantType.TI2V_5B else 16\n        if vae_config.latent_channels != expected_channels:\n            raise ValueError(\n                \"The standalone VAE is incompatible with the selected transformer. \"\n                \"TI2V-5B requires the 48-channel Wan 2.2 VAE; A14B models require the 16-channel Wan 2.1 VAE.\"\n            )\n","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/wan_model_loader.py#L317-L353","documentation":"When the VAE is derived from the Component Source, _validate_component_source_vae compares the source's variant against the main transformer variant. Wan 2.2 TI2V-5B needs the 48-channel VAE while A14B models need the 16-channel Wan 2.1 VAE; if main_is_ti2v != source_is_ti2v the pair is incompatible and invoke() raises this ValueError.","triggerScenarios":"invoke() where main model variant is TI2V-5B but the Component Source is a non-TI2V (A14B) Wan model, or vice versa.","commonSituations":"Mixing Wan 2.1 A14B components with a Wan 2.2 5B transformer (or the reverse); a workflow built for one Wan generation reused with the other's component source.","solutions":["Match the Component Source variant to the transformer: use a TI2V-5B source for TI2V-5B, an A14B source for A14B","Set an explicit standalone 'VAE' with the correct latent channels (48 for TI2V-5B, 16 for A14B) instead of relying on Component Source","Swap the main transformer to the variant matching the component source you already have"],"exampleFix":"// before: TI2V-5B transformer with A14B component source\ncomponent_source=ModelIdentifierField(key='wan21-a14b-main', submodel_type=SubModelType.Transformer)\n// after\ncomponent_source=ModelIdentifierField(key='wan22-ti2v-5b-main', submodel_type=SubModelType.Transformer)","handlingStrategy":"validation","validationCode":"main_cfg = context.models.get_config(invocation.model)\nsrc_cfg = context.models.get_config(invocation.component_source)\nmain_ti2v = getattr(main_cfg, 'variant', None) == WanVariantType.TI2V_5B\nsrc_ti2v = getattr(src_cfg, 'variant', None) == WanVariantType.TI2V_5B\nif main_ti2v != src_ti2v:\n    raise ValueError('Component Source variant must match transformer variant (TI2V-5B vs A14B)')","typeGuard":"def variants_match(main_cfg, src_cfg) -> bool:\n    main_ti2v = getattr(main_cfg, 'variant', None) == WanVariantType.TI2V_5B\n    src_ti2v = getattr(src_cfg, 'variant', None) == WanVariantType.TI2V_5B\n    return main_ti2v == src_ti2v","tryCatchPattern":"try:\n    output = invocation.invoke(context)\nexcept ValueError as e:\n    if 'Component Source VAE is incompatible' in str(e):\n        invocation.component_source = select_source_matching_variant(main_variant)","preventionTips":["Keep Wan 2.1 and Wan 2.2 components in separate workflows","Check the variant label on both transformer and component source before wiring","Prefer explicit standalone VAE overrides with the correct channel count over implicit sources"],"tags":["model-loader","incompatible-models","wan","vae","variant-mismatch"],"backgroundTag":"model-incompatibility","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}