invoke-ai/InvokeAI · error · ValueError

No VAE source provided. Standalone safetensors/GGUF models r

Error message

No VAE source provided. Standalone safetensors/GGUF models require a separate VAE. Options:
  1. Set 'VAE' to a standalone FLUX VAE model
  2. Set 'Qwen3 Source' to a Diffusers Flux2 Klein model to extract the VAE from

What it means

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.

Source

Thrown at invokeai/app/invocations/flux2_klein_model_loader.py:157

        # that don't exist. Single-file SDNQ/GGUF checkpoints have no submodels and also fall through.
        main_config = context.models.get_config(self.model)
        main_is_diffusers = main_config.format == ModelFormat.Diffusers or is_self_contained_sdnq_pipeline(main_config)

        # Determine VAE source
        # IMPORTANT: FLUX.2 Klein uses a 32-channel VAE (AutoencoderKLFlux2), not the 16-channel FLUX.1 VAE.
        # The VAE should come from the FLUX.2 Klein Diffusers model, not a separate FLUX VAE.
        if self.vae_model is not None:
            # Use standalone VAE (user explicitly selected one)
            vae = self.vae_model.model_copy(update={"submodel_type": SubModelType.VAE})
        elif main_is_diffusers:
            # Extract VAE from main model (recommended for FLUX.2)
            vae = self.model.model_copy(update={"submodel_type": SubModelType.VAE})
        elif self.qwen3_source_model is not None:
            # Extract from Qwen3 source Diffusers model
            self._validate_diffusers_format(context, self.qwen3_source_model, "Qwen3 Source")
            vae = self.qwen3_source_model.model_copy(update={"submodel_type": SubModelType.VAE})
        else:
            raise ValueError(
                "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"
            )

        # Determine Qwen3 Encoder source
        if self.qwen3_encoder_model is not None:
            # Use standalone Qwen3 Encoder - validate it matches the FLUX.2 Klein variant
            self._validate_qwen3_encoder_variant(context, main_config)
            qwen3_tokenizer = self.qwen3_encoder_model.model_copy(update={"submodel_type": SubModelType.Tokenizer})
            qwen3_encoder = self.qwen3_encoder_model.model_copy(update={"submodel_type": SubModelType.TextEncoder})
        elif main_is_diffusers:
            # Extract from main model (recommended for FLUX.2 Klein)
            qwen3_tokenizer = self.model.model_copy(update={"submodel_type": SubModelType.Tokenizer})
            qwen3_encoder = self.model.model_copy(update={"submodel_type": SubModelType.TextEncoder})
        elif self.qwen3_source_model is not None:
            # Extract from separate Diffusers model

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Set the loader's 'VAE' input to a standalone FLUX VAE model installed in the model manager
  2. Set 'Qwen3 Source' to a Diffusers FLUX.2 Klein pipeline so the VAE is extracted from it
  3. Install a FLUX VAE via the model manager if none is present
  4. Catch ValueError and prompt the user to configure one of the two VAE sources

Example fix

// before
loader = Flux2KleinModelLoader(model=gguf_checkpoint)  # no VAE, no qwen3_source
// after
loader = Flux2KleinModelLoader(
    model=gguf_checkpoint,
    vae_model=standalone_flux_vae,            # option 1
    # or: qwen3_source_model=diffusers_klein  # option 2
)
output = loader.invoke(context)
Defensive patterns

Strategy: validation

Validate before calling

cfg = context.models.get_config(loader.model)
if cfg.format != ModelFormat.Diffusers and loader.vae_model is None and loader.qwen3_source_model is None:
    raise ValueError("standalone checkpoint needs VAE or Qwen3 Source")

Type guard

def has_vae_source(loader) -> bool:
    return loader.vae_model is not None or loader.qwen3_source_model is not None

Try / catch

try:
    output = loader.invoke(context)
except ValueError as e:
    if 'No VAE source provided' in str(e):
        loader.vae_model = prompt_user_for_flux_vae()
        output = loader.invoke(context)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/7dec3e347aa27b72. Report an issue: GitHub.