{"record":{"id":"d29d113928baa980","repo":"invoke-ai/InvokeAI","slug":"unexpected-t2i-adapter-base-model-type-t2i-ada","errorCode":null,"errorMessage":"Unexpected T2I-Adapter base model type: '${t2i_adapter_model_config.base}'.","messagePattern":"Unexpected T2I-Adapter base model type: '(.+?)'\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/denoise_latents.py","lineNumber":690,"sourceCode":"        if len(t2i_adapter) == 0:\n            return None\n\n        t2i_adapter_data = []\n        for t2i_adapter_field in t2i_adapter:\n            t2i_adapter_model_config = context.models.get_config(t2i_adapter_field.t2i_adapter_model.key)\n            image = context.images.get_pil(t2i_adapter_field.image.image_name, mode=\"RGB\")\n\n            # The max_unet_downscale is the maximum amount that the UNet model downscales the latent image internally.\n            if t2i_adapter_model_config.base == BaseModelType.StableDiffusion1:\n                max_unet_downscale = 8\n            elif t2i_adapter_model_config.base == BaseModelType.StableDiffusionXL:\n                max_unet_downscale = 4\n\n                # SDXL adapters are trained on cv2's BGR outputs\n                r, g, b = image.split()\n                image = Image.merge(\"RGB\", (b, g, r))\n            else:\n                raise ValueError(f\"Unexpected T2I-Adapter base model type: '{t2i_adapter_model_config.base}'.\")\n\n            t2i_adapter_model: T2IAdapter\n            with context.models.load(t2i_adapter_field.t2i_adapter_model) as t2i_adapter_model:\n                total_downscale_factor = t2i_adapter_model.total_downscale_factor\n\n                # Note: We have hard-coded `do_classifier_free_guidance=False`. This is because we only want to prepare\n                # a single image. If CFG is enabled, we will duplicate the resultant tensor after applying the\n                # T2I-Adapter model.\n                #\n                # Note: We re-use the `prepare_control_image(...)` from ControlNet for T2I-Adapter, because it has many\n                # of the same requirements (e.g. preserving binary masks during resize).\n\n                # Assuming fixed dimensional scaling of LATENT_SCALE_FACTOR.\n                _, _, latent_height, latent_width = latents_shape\n                control_height_resize = latent_height * LATENT_SCALE_FACTOR\n                control_width_resize = latent_width * LATENT_SCALE_FACTOR\n                t2i_image = prepare_control_image(\n                    image=image,","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/denoise_latents.py#L672-L708","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use a T2I-Adapter built for the same architecture family as the running UNet (SD1.x/SD2.x or SDXL)","Re-convert/re-download the adapter so its config `base` field is set correctly","Remove the T2I-Adapter field from the graph if it's not needed for this model"],"exampleFix":"// before\nt2i_field = T2IAdapterField(t2i_adapter_model=\"flux-adapter.safetensors\", ...)\n// after\nt2i_field = T2IAdapterField(t2i_adapter_model=\"t2iadapter-sdxl-canny.safetensors\", ...)","handlingStrategy":"validation","validationCode":"with context.models.load(t2i_field.t2i_adapter_model) as m:\n    cfg = m.config\nSUPPORTED = {BaseModelType.StableDiffusion1, BaseModelType.StableDiffusion2, BaseModelType.StableDiffusionXL}\nif cfg.base not in SUPPORTED:\n    raise ValueError(f\"T2I-Adapter base {cfg.base} unsupported\")","typeGuard":"def is_supported_t2i_adapter(model_config) -> bool:\n    return model_config.base in {\n        BaseModelType.StableDiffusion1,\n        BaseModelType.StableDiffusion2,\n        BaseModelType.StableDiffusionXL,\n    }","tryCatchPattern":"try:\n    out = invocation.invoke(context)\nexcept ValueError as e:\n    if \"T2I-Adapter base model type\" in str(e):\n        graph.remove_t2i_adapters()\n        out = invocation.invoke(context)\n    else:\n        raise","preventionTips":["Match adapter architecture to the base model (SD1/SD2 vs SDXL)","Check the adapter's config `base` metadata after downloading/converting","Skip T2I adapters entirely when running unsupported architectures like FLUX/SD3"],"tags":["python","valueerror","t2i-adapter","model-config","stable-diffusion"],"backgroundTag":"incompatible-model-architecture","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}