invoke-ai/InvokeAI · error · ValueError

No source for VAE. Either set 'VAE' to a standalone Wan VAE,

Error message

No source for VAE. Either set 'VAE' to a standalone Wan VAE, or set 'Component Source' to a Diffusers Wan main model.

What it means

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.

Source

Thrown at invokeai/app/invocations/wan_model_loader.py:273

                ):
                    boundary_ratio = float(src_boundary)
        else:
            raise ValueError(
                f"Unsupported main model format for Wan: {main_format.value}. "
                "Use a Diffusers folder, a GGUF file, or a single-file safetensors checkpoint."
            )

        # VAE: standalone override > main (if Diffusers) > component source.
        if self.vae_model is not None:
            self._validate_standalone_vae(context, self.vae_model, main_variant)
            vae = self.vae_model.model_copy(update={"submodel_type": SubModelType.VAE})
        elif main_is_diffusers:
            vae = self.model.model_copy(update={"submodel_type": SubModelType.VAE})
        elif self.component_source is not None:
            self._validate_component_source_vae(context, self.component_source, main_variant)
            vae = self.component_source.model_copy(update={"submodel_type": SubModelType.VAE})
        else:
            raise ValueError(
                "No source for VAE. Either set 'VAE' to a standalone Wan VAE, "
                "or set 'Component Source' to a Diffusers Wan main model."
            )

        # Tokenizer + text encoder: standalone override > main (if Diffusers) > component source.
        if self.wan_t5_encoder_model is not None:
            t5_config = context.models.get_config(self.wan_t5_encoder_model)
            if t5_config.type != ModelType.WanT5Encoder or t5_config.format != ModelFormat.WanT5Encoder:
                raise ValueError("The Wan T5 Encoder must resolve to a standalone Wan T5 encoder model.")
            tokenizer = self.wan_t5_encoder_model.model_copy(update={"submodel_type": SubModelType.Tokenizer})
            text_encoder = self.wan_t5_encoder_model.model_copy(update={"submodel_type": SubModelType.TextEncoder})
        elif main_is_diffusers:
            tokenizer = self.model.model_copy(update={"submodel_type": SubModelType.Tokenizer})
            text_encoder = self.model.model_copy(update={"submodel_type": SubModelType.TextEncoder})
        elif self.component_source is not None:
            self._validate_component_source_format(context, self.component_source)
            tokenizer = self.component_source.model_copy(update={"submodel_type": SubModelType.Tokenizer})
            text_encoder = self.component_source.model_copy(update={"submodel_type": SubModelType.TextEncoder})

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Set the 'VAE' input field to a standalone Wan VAE model
  2. Set 'Component Source' to a Diffusers Wan main model so its VAE submodel can be used
  3. Switch the main model to a Diffusers folder, which contains a VAE

Example fix

// before
WanModelLoaderInvocation(model=gguf_model)  # no vae, no component_source
// after
WanModelLoaderInvocation(model=gguf_model, vae=ModelIdentifierField(key='wan-vae', submodel_type=SubModelType.VAE))
Defensive patterns

Strategy: validation

Validate before calling

cfg = context.models.get_config(invocation.model)
needs_vae = cfg.format != ModelFormat.Diffusers
if needs_vae and invocation.vae_model is None and invocation.component_source is None:
    raise ValueError('Set VAE or Component Source: main model is not Diffusers')

Type guard

def has_vae_source(inv) -> bool:
    cfg = get_config(inv.model)
    return cfg.format == ModelFormat.Diffusers or inv.vae_model is not None or inv.component_source is not None

Try / catch

try:
    output = invocation.invoke(context)
except ValueError as e:
    if 'No source for VAE' in str(e):
        invocation.vae_model = load_standalone_wan_vae()

Prevention

When it happens

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

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

Related errors


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