invoke-ai/InvokeAI · error · RuntimeError

{source} has {len(unexpected)} weights that WanTransformer3D

Error message

{source} has {len(unexpected)} weights that WanTransformer3DModel has nowhere to put (modules: {', '.join(modules[:8])}). This is a Wan variant with extra conditioning branches — Animate, S2V, Fun-Camera and similar — which InvokeAI cannot run faithfully; loading it anyway would silently ignore that conditioning.

What it means

The checkpoint contains extra weights that the target WanTransformer3DModel has no parameters for, and they are not benign (bundled VAE/text-encoder or merged-LoRA residue). InvokeAI deliberately refuses to load, because silently dropping extra conditioning branches (Animate, S2V, Fun-Camera, etc.) would ignore conditioning the model was trained with.

Source

Thrown at invokeai/backend/model_manager/load/model_loaders/wan.py:301

    correctly-shaped ``WanTransformer3DModel``, report zero missing keys, and then
    generate with the entire branch they were built around silently absent.

    ``configs.main._find_unsupported_wan_variant_marker`` turns away the families we
    know by name; this is the generic backstop, so a derivative nobody has enumerated
    yet produces an error instead of quietly degraded output.

    Benign extras — bundled VAE/text-encoder weights and merged-LoRA residue — have
    already been removed by ``_drop_benign_extra_keys``, so anything reaching here is
    genuinely unplaceable.
    """
    if incompatible_keys.missing_keys:
        raise RuntimeError(f"{source} is missing model parameters: {sorted(incompatible_keys.missing_keys)[:10]}")

    unexpected = [key for key in incompatible_keys.unexpected_keys if isinstance(key, str)]
    if unexpected:
        # Report the distinct top-level module names rather than hundreds of keys.
        modules = sorted({key.split(".")[0] for key in unexpected})
        raise RuntimeError(
            f"{source} has {len(unexpected)} weights that WanTransformer3DModel has nowhere to put "
            f"(modules: {', '.join(modules[:8])}). This is a Wan variant with extra conditioning "
            "branches — Animate, S2V, Fun-Camera and similar — which InvokeAI cannot run faithfully; "
            "loading it anyway would silently ignore that conditioning."
        )


def _tensor_shape(tensor: Any) -> tuple[int, ...]:
    """Logical shape of a tensor, unwrapping GGMLTensor's packed storage.

    A GGMLTensor's ``.shape`` describes the packed quantized blob, not the weight,
    so the logical dimensions live on ``.tensor_shape``.
    """
    shape = tensor.tensor_shape if isinstance(tensor, GGMLTensor) else tensor.shape
    return tuple(int(dim) for dim in shape)


def _build_wan_transformer_config(sd: dict, source: str) -> dict:

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Use a base Wan checkpoint (no extra conditioning branches) instead of the Animate/S2V/Fun variant.
  2. Check InvokeAI release notes for supported Wan variants; upgrade if your variant is newly supported.
  3. Extract only the base transformer weights from the combined checkpoint if the variant is truly incompatible.
  4. Run the variant with the original toolchain (e.g., the official Wan repo) that implements those branches.

Example fix

// before
model_path = "wan2.1_fun_camera_14b.safetensors"  # extra conditioning branches

// after
model_path = "wan2.1_t2v_14b.safetensors"  # base variant InvokeAI supports
Defensive patterns

Strategy: validation

Validate before calling

EXTRA_BRANCH_MODULES = {'control_adapter', 'pose_branch', 'camera_embedding', 'ref_conv'}  # example top-level names
from safetensors import safe_open

def validate_no_extra_branches(path):
    with safe_open(path, framework='pt') as f:
        modules = {k.split('.')[0] for k in f.keys()}
    extra = modules - KNOWN_WAN_MODULES
    if extra:
        raise ValueError(f"{path} contains unsupported Wan variant modules: {sorted(extra)}")

Try / catch

try:
    model = loader.load_model(config, SubModelType.Transformer)
except RuntimeError as e:
    if 'nowhere to put' in str(e):
        raise UnsupportedWanVariant(str(e))  # surface to user; do not retry
    raise

Prevention

When it happens

Trigger: Loading a Wan Animate / S2V / Fun-Camera / Fun-Control variant checkpoint that contains additional conditioning branch modules not present in base WanTransformer3DModel, via the single-file checkpoint loader.

Common situations: Downloading a community Wan Animate or S2V combined checkpoint and importing it as a plain Wan checkpoint; using a checkpoint trained for a Wan variant InvokeAI does not yet support.

Related errors


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