invoke-ai/InvokeAI · error · ValueError

Unsupported base model: {base_model}

Error message

Unsupported base model: {base_model}

What it means

diffusion_step_callback decodes intermediate latents to RGB previews using per-base-model latent-to-RGB factor/bias matrices. If the run's base_model has no known latent RGB factors table, it raises ValueError listing the unsupported base model.

Source

Thrown at invokeai/app/util/step_callback.py:370

    elif base_model == BaseModelType.ErnieImage:
        # ERNIE-Image uses AutoencoderKLFlux2 (same as FLUX.2) with 32 latent channels, and the
        # denoise loop unpatches before previewing, so the shapes line up. The values do not:
        # ERNIE denoises in BN-normalized latent space (denormalized only at VAE decode) and the
        # BN stats live on the VAE, which isn't loaded here. Previews are therefore approximate
        # in color/contrast.
        latent_rgb_factors = FLUX2_LATENT_RGB_FACTORS
        latent_rgb_bias = FLUX2_LATENT_RGB_BIAS
    elif base_model == BaseModelType.Wan:
        # A14B (16-ch standard Wan VAE, 8x spatial) vs TI2V-5B (48-ch Wan2.2-VAE,
        # 16x spatial). The latent channel count uniquely identifies the variant.
        if sample.shape[-3] == 48:
            latent_rgb_factors = WAN22_LATENT_RGB_FACTORS
            latent_rgb_bias = WAN22_LATENT_RGB_BIAS
        else:
            latent_rgb_factors = WAN_LATENT_RGB_FACTORS
            latent_rgb_bias = WAN_LATENT_RGB_BIAS
    else:
        raise ValueError(f"Unsupported base model: {base_model}")

    latent_rgb_factors_torch = torch.tensor(latent_rgb_factors, dtype=sample.dtype, device=sample.device)
    smooth_matrix_torch = (
        torch.tensor(smooth_matrix, dtype=sample.dtype, device=sample.device) if smooth_matrix else None
    )
    latent_rgb_bias_torch = (
        torch.tensor(latent_rgb_bias, dtype=sample.dtype, device=sample.device) if latent_rgb_bias else None
    )
    image = sample_to_lowres_estimated_image(
        samples=sample,
        latent_rgb_factors=latent_rgb_factors_torch,
        smooth_matrix=smooth_matrix_torch,
        latent_rgb_bias=latent_rgb_bias_torch,
    )

    # Spatial downscale ratio: 8x is the SD/SDXL/FLUX/Wan-A14B default;
    # Wan TI2V-5B's Wan2.2-VAE uses 16x.
    spatial_scale = 8

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Upgrade InvokeAI to a version whose step_callback supports your model's base type
  2. Disable intermediate previews for that model so the callback's latent decoding path is not hit
  3. Check invokeai/app/util/step_callback.py and add the latent RGB factors for the new base model if contributing a patch
  4. Verify the graph/denoise params reference the correct model with a supported base

Example fix

// before (adding a new base)
# no factors defined -> ValueError: Unsupported base model: BaseModelType.NewModel
// after
NEW_LATENT_RGB_FACTORS = [[...], ...]
NEW_LATENT_RGB_BIAS = [...]
# add an elif branch mapping BaseModelType.NewModel to these tables
Defensive patterns

Strategy: try-catch

Validate before calling

from invokeai.backend.model_manager.config import BaseModelType
SUPPORTED_PREVIEWS = {b for b in BaseModelType}  # verify against step_callback.py tables

def previews_supported(base_model):
    return base_model in SUPPORTED_PREVIEWS

Try / catch

try:
    result_images = sampling_result_latents_images(...)
except ValueError as e:
    if 'Unsupported base model' in str(e):
        disable_intermediate_previews()
        result_images = sampling_result_latents_images(..., with_preview=False)
    else:
        raise

Prevention

When it happens

Trigger: A diffusion step callback fires (preview image generation) while base_model is a value not covered by the factor tables in step_callback.py (e.g. a newly added model family like Flux2 or a custom/unknown enum value).

Common situations: New model type supported elsewhere in InvokeAI but not yet in the preview-latent decoder; older/patched builds where the step_callback module lags behind supported models; corrupted enum value in the denoise parameters.

Related errors


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