invoke-ai/InvokeAI · error · ValueError

Unexpected T2I-Adapter base model type: '${t2i_adapter_model

Error message

Unexpected T2I-Adapter base model type: '${t2i_adapter_model_config.base}'.

What it means

run_t2i_adapters branches on the base model architecture of each loaded T2I-Adapter to decide image preprocessing (e.g. SDXL adapters expect BGR channel order). If the adapter's base model config is neither the supported SD1/SD2 nor SDXL type, this ValueError is raised.

Source

Thrown at invokeai/app/invocations/denoise_latents.py:690

        if len(t2i_adapter) == 0:
            return None

        t2i_adapter_data = []
        for t2i_adapter_field in t2i_adapter:
            t2i_adapter_model_config = context.models.get_config(t2i_adapter_field.t2i_adapter_model.key)
            image = context.images.get_pil(t2i_adapter_field.image.image_name, mode="RGB")

            # The max_unet_downscale is the maximum amount that the UNet model downscales the latent image internally.
            if t2i_adapter_model_config.base == BaseModelType.StableDiffusion1:
                max_unet_downscale = 8
            elif t2i_adapter_model_config.base == BaseModelType.StableDiffusionXL:
                max_unet_downscale = 4

                # SDXL adapters are trained on cv2's BGR outputs
                r, g, b = image.split()
                image = Image.merge("RGB", (b, g, r))
            else:
                raise ValueError(f"Unexpected T2I-Adapter base model type: '{t2i_adapter_model_config.base}'.")

            t2i_adapter_model: T2IAdapter
            with context.models.load(t2i_adapter_field.t2i_adapter_model) as t2i_adapter_model:
                total_downscale_factor = t2i_adapter_model.total_downscale_factor

                # Note: We have hard-coded `do_classifier_free_guidance=False`. This is because we only want to prepare
                # a single image. If CFG is enabled, we will duplicate the resultant tensor after applying the
                # T2I-Adapter model.
                #
                # Note: We re-use the `prepare_control_image(...)` from ControlNet for T2I-Adapter, because it has many
                # of the same requirements (e.g. preserving binary masks during resize).

                # Assuming fixed dimensional scaling of LATENT_SCALE_FACTOR.
                _, _, latent_height, latent_width = latents_shape
                control_height_resize = latent_height * LATENT_SCALE_FACTOR
                control_width_resize = latent_width * LATENT_SCALE_FACTOR
                t2i_image = prepare_control_image(
                    image=image,

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Use a T2I-Adapter built for the same architecture family as the running UNet (SD1.x/SD2.x or SDXL)
  2. Re-convert/re-download the adapter so its config `base` field is set correctly
  3. Remove the T2I-Adapter field from the graph if it's not needed for this model

Example fix

// before
t2i_field = T2IAdapterField(t2i_adapter_model="flux-adapter.safetensors", ...)
// after
t2i_field = T2IAdapterField(t2i_adapter_model="t2iadapter-sdxl-canny.safetensors", ...)
Defensive patterns

Strategy: validation

Validate before calling

with context.models.load(t2i_field.t2i_adapter_model) as m:
    cfg = m.config
SUPPORTED = {BaseModelType.StableDiffusion1, BaseModelType.StableDiffusion2, BaseModelType.StableDiffusionXL}
if cfg.base not in SUPPORTED:
    raise ValueError(f"T2I-Adapter base {cfg.base} unsupported")

Type guard

def is_supported_t2i_adapter(model_config) -> bool:
    return model_config.base in {
        BaseModelType.StableDiffusion1,
        BaseModelType.StableDiffusion2,
        BaseModelType.StableDiffusionXL,
    }

Try / catch

try:
    out = invocation.invoke(context)
except ValueError as e:
    if "T2I-Adapter base model type" in str(e):
        graph.remove_t2i_adapters()
        out = invocation.invoke(context)
    else:
        raise

Prevention

When it happens

Trigger: Attaching a T2I-Adapter whose model config `base` field is an unsupported architecture (e.g. SD3, FLUX, or a corrupted/missing base metadata) to a DenoiseLatents run.

Common situations: Using adapters converted from other formats without correct config metadata; main-model/adapter architecture mismatch (SDXL base model with an SD1-only adapter tagged oddly); older model files predating the base field convention.

Related errors


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