{"record":{"id":"7dec3e347aa27b72","repo":"invoke-ai/InvokeAI","slug":"no-vae-source-provided-standalone-safetensors-ggu","errorCode":null,"errorMessage":"No VAE source provided. Standalone safetensors/GGUF models require a separate VAE. Options:\n  1. Set 'VAE' to a standalone FLUX VAE model\n  2. Set 'Qwen3 Source' to a Diffusers Flux2 Klein model to extract the VAE from","messagePattern":"No VAE source provided\\. Standalone safetensors/GGUF models require a separate VAE\\. Options:\n  1\\. Set 'VAE' to a standalone FLUX VAE model\n  2\\. Set 'Qwen3 Source' to a Diffusers Flux2 Klein model to extract the VAE from","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/flux2_klein_model_loader.py","lineNumber":157,"sourceCode":"        # that don't exist. Single-file SDNQ/GGUF checkpoints have no submodels and also fall through.\n        main_config = context.models.get_config(self.model)\n        main_is_diffusers = main_config.format == ModelFormat.Diffusers or is_self_contained_sdnq_pipeline(main_config)\n\n        # Determine VAE source\n        # IMPORTANT: FLUX.2 Klein uses a 32-channel VAE (AutoencoderKLFlux2), not the 16-channel FLUX.1 VAE.\n        # The VAE should come from the FLUX.2 Klein Diffusers model, not a separate FLUX VAE.\n        if self.vae_model is not None:\n            # Use standalone VAE (user explicitly selected one)\n            vae = self.vae_model.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        elif main_is_diffusers:\n            # Extract VAE from main model (recommended for FLUX.2)\n            vae = self.model.model_copy(update={\"submodel_type\": SubModelType.VAE})\n        elif self.qwen3_source_model is not None:\n            # Extract from Qwen3 source Diffusers 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        else:\n            raise ValueError(\n                \"No VAE source provided. Standalone safetensors/GGUF models require a separate VAE. \"\n                \"Options:\\n\"\n                \"  1. Set 'VAE' to a standalone FLUX VAE model\\n\"\n                \"  2. Set 'Qwen3 Source' to a Diffusers Flux2 Klein model to extract the VAE from\"\n            )\n\n        # Determine Qwen3 Encoder source\n        if self.qwen3_encoder_model is not None:\n            # Use standalone Qwen3 Encoder - validate it matches the FLUX.2 Klein variant\n            self._validate_qwen3_encoder_variant(context, main_config)\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 main_is_diffusers:\n            # Extract from main model (recommended for FLUX.2 Klein)\n            qwen3_tokenizer = self.model.model_copy(update={\"submodel_type\": SubModelType.Tokenizer})\n            qwen3_encoder = self.model.model_copy(update={\"submodel_type\": SubModelType.TextEncoder})\n        elif self.qwen3_source_model is not None:\n            # Extract from separate Diffusers model","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux2_klein_model_loader.py#L139-L175","documentation":"The FLUX.2 Klein model loader raised ValueError because the main model is a standalone safetensors/GGUF checkpoint and neither a VAE model nor a Diffusers Qwen3 source pipeline was provided. Standalone checkpoints ship no VAE, so the loader cannot assemble a complete model. It lists the two supported remedies in the message.","triggerScenarios":"invoke() runs with self.model in safetensors/GGUF format while self.vae_model is None and self.qwen3_source_model is None, hitting the final else branch of VAE resolution.","commonSituations":"Loading a single-file FLUX.2 Klein checkpoint downloaded alone; forgetting to add the standalone FLUX VAE to the workflow; assuming the checkpoint bundles a VAE like Diffusers pipelines do.","solutions":["Set the loader's 'VAE' input to a standalone FLUX VAE model installed in the model manager","Set 'Qwen3 Source' to a Diffusers FLUX.2 Klein pipeline so the VAE is extracted from it","Install a FLUX VAE via the model manager if none is present","Catch ValueError and prompt the user to configure one of the two VAE sources"],"exampleFix":"// before\nloader = Flux2KleinModelLoader(model=gguf_checkpoint)  # no VAE, no qwen3_source\n// after\nloader = Flux2KleinModelLoader(\n    model=gguf_checkpoint,\n    vae_model=standalone_flux_vae,            # option 1\n    # or: qwen3_source_model=diffusers_klein  # option 2\n)\noutput = loader.invoke(context)","handlingStrategy":"validation","validationCode":"cfg = context.models.get_config(loader.model)\nif cfg.format != ModelFormat.Diffusers and loader.vae_model is None and loader.qwen3_source_model is None:\n    raise ValueError(\"standalone checkpoint needs VAE or Qwen3 Source\")","typeGuard":"def has_vae_source(loader) -> bool:\n    return loader.vae_model is not None or loader.qwen3_source_model is not None","tryCatchPattern":"try:\n    output = loader.invoke(context)\nexcept ValueError as e:\n    if 'No VAE source provided' in str(e):\n        loader.vae_model = prompt_user_for_flux_vae()\n        output = loader.invoke(context)\n    else:\n        raise","preventionTips":["Always wire a VAE input when using safetensors/GGUF Klein checkpoints","Install a standalone FLUX VAE before loading single-file models","Prefer Diffusers pipelines, which bundle the VAE"],"tags":["vae","missing-input","flux2-klein","invokeai"],"backgroundTag":"missing-vae-source","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}