invoke-ai/InvokeAI · error · ValueError

The standalone VAE is incompatible with the selected transfo

Error message

The standalone VAE is incompatible with the selected transformer. TI2V-5B requires the 48-channel Wan 2.2 VAE; A14B models require the 16-channel Wan 2.1 VAE.

What it means

After confirming the standalone VAE is a Wan VAE, _validate_standalone_vae checks latent_channels against the main variant: 48 for TI2V-5B (Wan 2.2), 16 for A14B (Wan 2.1). A mismatch means the VAE was trained for the other Wan generation, so invoke() raises this ValueError.

Source

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

        source_variant = getattr(source_config, "variant", None)
        main_is_ti2v = main_variant == WanVariantType.TI2V_5B
        source_is_ti2v = source_variant == WanVariantType.TI2V_5B
        if main_is_ti2v != source_is_ti2v:
            raise ValueError(
                "The Component Source VAE is incompatible with the selected transformer. "
                "TI2V-5B requires the 48-channel Wan 2.2 VAE; A14B models require the 16-channel Wan 2.1 VAE."
            )

    @staticmethod
    def _validate_standalone_vae(
        context: InvocationContext, model: ModelIdentifierField, main_variant: WanVariantType
    ) -> None:
        vae_config = context.models.get_config(model)
        if vae_config.base != BaseModelType.Wan or vae_config.type != ModelType.VAE:
            raise ValueError("The VAE must resolve to a standalone Wan VAE model.")
        expected_channels = 48 if main_variant == WanVariantType.TI2V_5B else 16
        if vae_config.latent_channels != expected_channels:
            raise ValueError(
                "The standalone VAE is incompatible with the selected transformer. "
                "TI2V-5B requires the 48-channel Wan 2.2 VAE; A14B models require the 16-channel Wan 2.1 VAE."
            )

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Select the VAE matching the transformer: 48-channel Wan 2.2 VAE for TI2V-5B, 16-channel Wan 2.1 VAE for A14B
  2. Clear the VAE override so the loader picks a matching VAE from a Diffusers main model or Component Source
  3. Download and install the correct-generation Wan VAE into the Model Manager

Example fix

// before: TI2V-5B transformer with Wan 2.1 VAE (16ch)
vae=ModelIdentifierField(key='wan21-vae-16ch', submodel_type=SubModelType.VAE)
// after
vae=ModelIdentifierField(key='wan22-ti2v-vae-48ch', submodel_type=SubModelType.VAE)
Defensive patterns

Strategy: validation

Validate before calling

vae_cfg = context.models.get_config(invocation.vae_model)
main_cfg = context.models.get_config(invocation.model)
expected = 48 if getattr(main_cfg, 'variant', None) == WanVariantType.TI2V_5B else 16
if vae_cfg.latent_channels != expected:
    raise ValueError(f'VAE has {vae_cfg.latent_channels} latent channels, need {expected}')

Type guard

def vae_matches_variant(vae_cfg, main_variant) -> bool:
    expected = 48 if main_variant == WanVariantType.TI2V_5B else 16
    return vae_cfg.latent_channels == expected

Try / catch

try:
    output = invocation.invoke(context)
except ValueError as e:
    if 'standalone VAE is incompatible with the selected transformer' in str(e):
        invocation.vae_model = select_vae_for_variant(main_variant)

Prevention

When it happens

Trigger: invoke() where the standalone VAE passes the type check but vae_config.latent_channels != expected_channels — i.e. a 16-channel Wan 2.1 VAE paired with a TI2V-5B transformer, or a 48-channel Wan 2.2 VAE paired with an A14B transformer.

Common situations: Mixing Wan 2.1 and Wan 2.2 models in one workflow; upgrading a workflow to Wan 2.2 5B while keeping the old 2.1 VAE override; downloading the wrong-generation VAE file.

Related errors


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