{"record":{"id":"a9d7cf59dfd47525","repo":"invoke-ai/InvokeAI","slug":"no-vae-source-provided-either-set-vae-to-a-flux","errorCode":null,"errorMessage":"No VAE source provided. Either set 'VAE' to a FLUX VAE model, or set 'Qwen3 Source' to a Diffusers Z-Image model.","messagePattern":"No VAE source provided\\. Either set 'VAE' to a FLUX VAE model, or set 'Qwen3 Source' to a Diffusers Z-Image model\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/z_image_model_loader.py","lineNumber":116,"sourceCode":"        # Qwen3 encoder and VAE as submodels of the main model. When the user hasn't selected a\n        # standalone VAE / Qwen3 Encoder or a separate Qwen3 Source, fall back to the main model\n        # itself for those submodels. This lets a freshly installed SDNQ Z-Image pipeline generate\n        # without the user having to manually re-select the same model as a component source.\n        self_contained_source = self._get_self_contained_source(context)\n\n        # Determine VAE source\n        if self.vae_model is not None:\n            # Use standalone FLUX VAE\n            vae = self.vae_model.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        elif self.qwen3_source_model is not None:\n            # Extract from Diffusers Z-Image model\n            self._validate_diffusers_format(context, self.qwen3_source_model, \"Qwen3 Source\")\n            vae = self.qwen3_source_model.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        elif self_contained_source is not None:\n            # Extract from the self-contained SDNQ main model\n            vae = self_contained_source.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        else:\n            raise ValueError(\n                \"No VAE source provided. Either set 'VAE' to a FLUX VAE model, \"\n                \"or set 'Qwen3 Source' to a Diffusers Z-Image model.\"\n            )\n\n        # Determine Qwen3 Encoder source\n        if self.qwen3_encoder_model is not None:\n            # Use standalone Qwen3 Encoder\n            qwen3_tokenizer = self.qwen3_encoder_model.model_copy(update={\"submodel_type\": SubModelType.Tokenizer})\n            qwen3_encoder = self.qwen3_encoder_model.model_copy(update={\"submodel_type\": SubModelType.TextEncoder})\n        elif self.qwen3_source_model is not None:\n            # Extract from Diffusers Z-Image model\n            self._validate_diffusers_format(context, self.qwen3_source_model, \"Qwen3 Source\")\n            qwen3_tokenizer = self.qwen3_source_model.model_copy(update={\"submodel_type\": SubModelType.Tokenizer})\n            qwen3_encoder = self.qwen3_source_model.model_copy(update={\"submodel_type\": SubModelType.TextEncoder})\n        elif self_contained_source is not None:\n            # Extract from the self-contained SDNQ main model\n            qwen3_tokenizer = self_contained_source.model_copy(update={\"submodel_type\": SubModelType.Tokenizer})\n            qwen3_encoder = self_contained_source.model_copy(update={\"submodel_type\": SubModelType.TextEncoder})","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/z_image_model_loader.py#L98-L134","documentation":"ZImageModelLoader needs a VAE but found no usable source: neither a standalone VAE model field, a Diffusers Z-Image Qwen3 source to extract the VAE submodel from, nor a self-contained SDNQ main model. It raises a ValueError telling the user which of the three inputs must be provided.","triggerScenarios":"invoke() reaches the VAE resolution block with vae_model None, qwen3_source_model None (no Diffusers-format source), and self_contained_source None - no SDNQ main either.","commonSituations":"Running the loader with only the transformer/main model set and VAE + Qwen3 Source left unconfigured; deleting the FLUX VAE model that previously filled the VAE field; importing a bare loader template without the auxiliary models.","solutions":["Set the 'VAE' input to a FLUX VAE model (Z-Image reuses the Flux VAE).","Or set 'Qwen3 Source' to a Diffusers Z-Image repo so VAE and encoder are derived from it.","Or provide a self-contained SDNQ main model the submodels can be extracted from.","Verify the referenced VAE still exists in the Model Manager if it was previously configured."],"exampleFix":"// before\nloader = ZImageModelLoaderInvocation(transformer=..., vae=None, qwen3_source_model=None)\n// after\nloader = ZImageModelLoaderInvocation(transformer=..., vae=ModelField(id='flux-vae'))","handlingStrategy":"validation","validationCode":"if loader.vae is None and loader.qwen3_source_model is None and loader.main_model_is_sdnq is not True:\n    raise ValueError(\"Provide VAE (FLUX VAE), a Diffusers Z-Image 'Qwen3 Source', or an SDNQ main model\")","typeGuard":null,"tryCatchPattern":"try:\n    out = z_image_model_loader.invoke(context)\nexcept ValueError as e:\n    if \"No VAE source\" in str(e):\n        context.logger.error(\"Set VAE to a FLUX VAE or use a Diffusers Z-Image Qwen3 Source.\")\n    else:\n        raise","preventionTips":["Always configure the VAE input (FLUX VAE) when using the Z-Image model loader.","Prefer loading from a full Diffusers Z-Image repo so all submodels resolve at once.","Verify referenced auxiliary models exist in the Model Manager before running graphs."],"tags":["model-loader","missing-input","vae","z-image"],"backgroundTag":"missing-required-input","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}