{"record":{"id":"d4c83719d6540dc3","repo":"invoke-ai/InvokeAI","slug":"unexpected-t2i-adapter-base-model-type-model-co","errorCode":null,"errorMessage":"Unexpected T2I-Adapter base model type: '{model_config.base}'.","messagePattern":"Unexpected T2I-Adapter base model type: '(.+?)'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/stable_diffusion/extensions/t2i_adapter.py","lineNumber":54,"sourceCode":"        super().__init__()\n        self._node_context = node_context\n        self._model_id = model_id\n        self._image = image\n        self._weight = weight\n        self._resize_mode = resize_mode\n        self._begin_step_percent = begin_step_percent\n        self._end_step_percent = end_step_percent\n\n        self._adapter_state: Optional[List[torch.Tensor]] = None\n\n        # The max_unet_downscale is the maximum amount that the UNet model downscales the latent image internally.\n        model_config = self._node_context.models.get_config(self._model_id.key)\n        if model_config.base == BaseModelType.StableDiffusion1:\n            self._max_unet_downscale = 8\n        elif model_config.base == BaseModelType.StableDiffusionXL:\n            self._max_unet_downscale = 4\n        else:\n            raise ValueError(f\"Unexpected T2I-Adapter base model type: '{model_config.base}'.\")\n\n    @callback(ExtensionCallbackType.SETUP)\n    def setup(self, ctx: DenoiseContext):\n        t2i_model: T2IAdapter\n        with self._node_context.models.load(self._model_id) as t2i_model:\n            _, _, latents_height, latents_width = ctx.inputs.orig_latents.shape\n\n            self._adapter_state = self._run_model(\n                model=t2i_model,\n                image=self._image,\n                latents_height=latents_height,\n                latents_width=latents_width,\n            )\n\n    def _run_model(\n        self,\n        model: T2IAdapter,\n        image: Image,","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/stable_diffusion/extensions/t2i_adapter.py#L36-L72","documentation":"T2IAdapterExtension computes a max UNet downscale factor based on the adapter model's base model type, and only StableDiffusion1 (÷8) and StableDiffusionXL (÷4) are handled. Any other BaseModelType falls through to ValueError in __init__.","triggerScenarios":"Building a T2I-Adapter extension whose model_config.base is neither StableDiffusion1 nor StableDiffusionXL — e.g. a StableDiffusion2, SD3, or Flux base — via the extension's __init__.","commonSituations":"Attaching a T2I-Adapter in an SD2/SD3/other-base workflow; adapter model registered under the wrong base type in the model manager; copying an SDXL T2I-Adapter node into an SD1/SD2 graph without changing the model.","solutions":["Use a T2I-Adapter trained for the base model in use (SD1 adapters with SD1, SDXL adapters with SDXL).","Avoid T2I-Adapter on unsupported bases (SD2/SD3/Flux) or add a mapping for that base in t2i_adapter.py.","Check the adapter's registered BaseModelType in the model manager and correct it if mislabeled.","Downgrade/switch the workflow's base model to SD1 or SDXL when using T2I-Adapters."],"exampleFix":"// before\nt2i_node(model=sd2_t2i_adapter)  # base = StableDiffusion2\n// after\nt2i_node(model=sd1_t2i_adapter)  # base must be SD1 or SDXL","handlingStrategy":"validation","validationCode":"cfg = models.get_config(t2i_model_id.key)\nif cfg.base not in (BaseModelType.StableDiffusion1, BaseModelType.StableDiffusionXL):\n    raise ValueError(f\"T2I-Adapter unsupported for base {cfg.base}\")","typeGuard":"def t2i_adapter_supported(cfg) -> bool:\n    return cfg.base in (BaseModelType.StableDiffusion1, BaseModelType.StableDiffusionXL)","tryCatchPattern":"try:\n    ext = T2IAdapterExtension(model_id=t2i_id, ...)\nexcept ValueError as e:\n    if \"Unexpected T2I-Adapter base model type\" in str(e):\n        log.warning(\"T2I-Adapter skipped: %s\", e)\n        ext = None\n    else:\n        raise","preventionTips":["Match T2I-Adapter checkpoints to the UNet base model","Check BaseModelType before adding adapter nodes","Avoid T2I-Adapters on SD2/SD3/Flux workflows","Correct mislabeled adapter registrations in the model manager"],"tags":["python","valueerror","t2i-adapter","base-model"],"backgroundTag":"unsupported-base-model","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}