{"record":{"id":"ccfe0d195974d78c","repo":"invoke-ai/InvokeAI","slug":"no-source-for-vae-either-set-vae-to-a-standalon","errorCode":null,"errorMessage":"No source for VAE. Either set 'VAE' to a standalone Wan VAE, or set 'Component Source' to a Diffusers Wan main model.","messagePattern":"No source for VAE\\. Either set 'VAE' to a standalone Wan VAE, or set 'Component Source' to a Diffusers Wan main model\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/wan_model_loader.py","lineNumber":273,"sourceCode":"                ):\n                    boundary_ratio = float(src_boundary)\n        else:\n            raise ValueError(\n                f\"Unsupported main model format for Wan: {main_format.value}. \"\n                \"Use a Diffusers folder, a GGUF file, or a single-file safetensors checkpoint.\"\n            )\n\n        # VAE: standalone override > main (if Diffusers) > component source.\n        if self.vae_model is not None:\n            self._validate_standalone_vae(context, self.vae_model, main_variant)\n            vae = self.vae_model.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        elif main_is_diffusers:\n            vae = self.model.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        elif self.component_source is not None:\n            self._validate_component_source_vae(context, self.component_source, main_variant)\n            vae = self.component_source.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        else:\n            raise ValueError(\n                \"No source for VAE. Either set 'VAE' to a standalone Wan VAE, \"\n                \"or set 'Component Source' to a Diffusers Wan main model.\"\n            )\n\n        # Tokenizer + text encoder: standalone override > main (if Diffusers) > component source.\n        if self.wan_t5_encoder_model is not None:\n            t5_config = context.models.get_config(self.wan_t5_encoder_model)\n            if t5_config.type != ModelType.WanT5Encoder or t5_config.format != ModelFormat.WanT5Encoder:\n                raise ValueError(\"The Wan T5 Encoder must resolve to a standalone Wan T5 encoder model.\")\n            tokenizer = self.wan_t5_encoder_model.model_copy(update={\"submodel_type\": SubModelType.Tokenizer})\n            text_encoder = self.wan_t5_encoder_model.model_copy(update={\"submodel_type\": SubModelType.TextEncoder})\n        elif main_is_diffusers:\n            tokenizer = self.model.model_copy(update={\"submodel_type\": SubModelType.Tokenizer})\n            text_encoder = self.model.model_copy(update={\"submodel_type\": SubModelType.TextEncoder})\n        elif self.component_source is not None:\n            self._validate_component_source_format(context, self.component_source)\n            tokenizer = self.component_source.model_copy(update={\"submodel_type\": SubModelType.Tokenizer})\n            text_encoder = self.component_source.model_copy(update={\"submodel_type\": SubModelType.TextEncoder})","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/wan_model_loader.py#L255-L291","documentation":"The loader needs a Wan VAE to decode latents. It resolves one from, in order: the standalone 'VAE' field override, the main model itself if it is Diffusers (VAE is a subfolder), or the 'Component Source' model. If none of these is available, there is no possible VAE source, so invoke() raises this ValueError.","triggerScenarios":"invoke() with a main model in GGUF or checkpoint (non-Diffusers) format, no 'VAE' field set, and 'component_source' is None — i.e. a single-file transformer with no standalone VAE and no Diffusers component source.","commonSituations":"Loading a GGUF Wan transformer alone and forgetting to attach a standalone Wan VAE; clearing the VAE field; using a checkpoint main model that bundles no VAE and omitting component_source.","solutions":["Set the 'VAE' input field to a standalone Wan VAE model","Set 'Component Source' to a Diffusers Wan main model so its VAE submodel can be used","Switch the main model to a Diffusers folder, which contains a VAE"],"exampleFix":"// before\nWanModelLoaderInvocation(model=gguf_model)  # no vae, no component_source\n// after\nWanModelLoaderInvocation(model=gguf_model, vae=ModelIdentifierField(key='wan-vae', submodel_type=SubModelType.VAE))","handlingStrategy":"validation","validationCode":"cfg = context.models.get_config(invocation.model)\nneeds_vae = cfg.format != ModelFormat.Diffusers\nif needs_vae and invocation.vae_model is None and invocation.component_source is None:\n    raise ValueError('Set VAE or Component Source: main model is not Diffusers')","typeGuard":"def has_vae_source(inv) -> bool:\n    cfg = get_config(inv.model)\n    return cfg.format == ModelFormat.Diffusers or inv.vae_model is not None or inv.component_source is not None","tryCatchPattern":"try:\n    output = invocation.invoke(context)\nexcept ValueError as e:\n    if 'No source for VAE' in str(e):\n        invocation.vae_model = load_standalone_wan_vae()","preventionTips":["Always attach a standalone Wan VAE when using GGUF or single-file Wan checkpoints","Prefer Diffusers main models, which bundle their VAE","Verify workflow node inputs after copying templates between workflows"],"tags":["model-loader","missing-model","wan","vae"],"backgroundTag":"missing-required-model","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}