invoke-ai/InvokeAI · error · ValueError

The Component Source model must be in Diffusers format. The

Error message

The Component Source model must be in Diffusers format. The selected model '{source_config.name}' is in {source_config.format.value} format.

What it means

Even when the Component Source is a Wan Main model, submodel extraction (VAE/tokenizer/text-encoder via model_copy) only works for Diffusers folder layouts. _validate_component_source_format raises this ValueError if source_config.format != ModelFormat.Diffusers, reporting the actual format found.

Source

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

                transformer_low_noise=transformer_low_noise,
                boundary_ratio=boundary_ratio,
            ),
            wan_t5_encoder=WanT5EncoderField(tokenizer=tokenizer, text_encoder=text_encoder),
            vae=VAEField(vae=vae),
        )

    @staticmethod
    def _validate_main_config(config: object, label: str) -> None:
        if getattr(config, "base", None) != BaseModelType.Wan or getattr(config, "type", None) != ModelType.Main:
            raise ValueError(f"The {label} model must resolve to a Wan main model.")

    @staticmethod
    def _validate_component_source_format(context: InvocationContext, model: ModelIdentifierField) -> None:
        source_config = context.models.get_config(model)
        if source_config.base != BaseModelType.Wan or source_config.type != ModelType.Main:
            raise ValueError("The Component Source model must resolve to a Wan main model.")
        if source_config.format != ModelFormat.Diffusers:
            raise ValueError(
                f"The Component Source model must be in Diffusers format. "
                f"The selected model '{source_config.name}' is in {source_config.format.value} format."
            )

    @staticmethod
    def _validate_component_source_vae(
        context: InvocationContext, model: ModelIdentifierField, main_variant: WanVariantType
    ) -> None:
        WanModelLoaderInvocation._validate_component_source_format(context, model)
        source_config = context.models.get_config(model)
        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."
            )

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Select a Diffusers-format Wan Main model as Component Source
  2. Download/import the model as a Diffusers folder and re-register it
  3. If only a single-file main model exists, provide standalone VAE and T5 encoder overrides instead of Component Source

Example fix

// before
component_source=ModelIdentifierField(key='wan-main-gguf', submodel_type=SubModelType.Transformer)
// after
component_source=ModelIdentifierField(key='wan-main-diffusers', submodel_type=SubModelType.Transformer)
Defensive patterns

Strategy: validation

Validate before calling

cfg = context.models.get_config(invocation.component_source)
if cfg.format != ModelFormat.Diffusers:
    raise ValueError(f"component_source must be Diffusers format, got {cfg.format.value}")

Type guard

def is_diffusers_wan_main(field, ctx) -> bool:
    cfg = ctx.models.get_config(field)
    return cfg.base == BaseModelType.Wan and cfg.type == ModelType.Main and cfg.format == ModelFormat.Diffusers

Try / catch

try:
    output = invocation.invoke(context)
except ValueError as e:
    if 'Component Source model must be in Diffusers format' in str(e):
        invocation.component_source = select_diffusers_wan_main()

Prevention

When it happens

Trigger: invoke() with component_source set to a Wan Main model registered as GGUF or checkpoint (single-file safetensors) rather than a Diffusers folder.

Common situations: Pointing Component Source at a single-file Wan checkpoint or GGUF main model, which has no subfolders to extract VAE/tokenizer from; importing a main model from a single archive file.

Related errors


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