{"record":{"id":"c76094afe07c0c75","repo":"invoke-ai/InvokeAI","slug":"base-is-recognized-base-not-expected-base-c76094","errorCode":null,"errorMessage":"base is {recognized_base}, not {expected_base}","messagePattern":"base is (.+?), not (.+?)","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"warning","filePath":"invokeai/backend/model_manager/configs/t2i_adapter.py","lineNumber":57,"sourceCode":"\n        raise_for_class_name(\n            common_config_paths(mod.path),\n            {\n                \"T2IAdapter\",\n            },\n        )\n\n        cls._validate_base(mod)\n\n        return cls(**override_fields)\n\n    @classmethod\n    def _validate_base(cls, mod: ModelOnDisk) -> None:\n        \"\"\"Raise `NotAMatch` if the model base does not match this config class.\"\"\"\n        expected_base = cls.model_fields[\"base\"].default\n        recognized_base = cls._get_base_or_raise(mod)\n        if expected_base is not recognized_base:\n            raise NotAMatchError(f\"base is {recognized_base}, not {expected_base}\")\n\n    @classmethod\n    def _get_base_or_raise(cls, mod: ModelOnDisk) -> BaseModelType:\n        config_dict = get_config_dict_or_raise(common_config_paths(mod.path))\n\n        adapter_type = config_dict.get(\"adapter_type\")\n\n        match adapter_type:\n            case \"full_adapter_xl\":\n                return BaseModelType.StableDiffusionXL\n            case \"full_adapter\" | \"light_adapter\":\n                return BaseModelType.StableDiffusion1\n            case _:\n                raise NotAMatchError(f\"unrecognized adapter_type '{adapter_type}'\")\n\n\nclass T2IAdapter_Diffusers_SD1_Config(T2IAdapter_Diffusers_Config_Base, Config_Base):\n    base: Literal[BaseModelType.StableDiffusion1] = Field(default=BaseModelType.StableDiffusion1)","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/t2i_adapter.py#L39-L75","documentation":"`NotAMatchError` from `T2IAdapterDiffusersConfig._validate_base`: the adapter's `adapter_type` (read from its diffusers config.json) resolved to a base model that does not match the `base` literal declared by this specific config class. It is part of normal probing — each SD1/SDXL config class validates the resolved base and declines non-matching adapters so the right class (e.g. `T2IAdapter_Diffusers_SD1_Config` vs the XL variant) picks the model up.","triggerScenarios":"`from_model_on_disk` on a diffusers T2I-Adapter folder whose `config.json` `adapter_type` maps to a different `BaseModelType` than the class being probed (e.g. `full_adapter_xl` probed by the SD1 config class).","commonSituations":"Auto-import scanning where the SD1 class sees an XL adapter (expected; the XL class will match instead), manually registering a model with an explicit config class that disagrees with `adapter_type`, adapters converted with a mismatched `adapter_type` field.","solutions":["No action needed during auto-import — the matching base's config class will accept the model","If you forced a specific config class, switch to the one whose `base` matches `adapter_type` (`full_adapter`/`light_adapter` → SD1, `full_adapter_xl` → SDXL)","Fix a wrong `adapter_type` in the adapter's config.json if the checkpoint was mislabeled during conversion"],"exampleFix":"// before: registering full_adapter_xl with T2IAdapter_Diffusers_SD1_Config\n// after: use the SDXL config class (base=StableDiffusionXL) or fix config.json adapter_type","handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\ndef adapter_base(model_dir: Path) -> str | None:\n    cfg = json.loads(next(model_dir.glob(\"**/config.json\")).read_text())\n    t = cfg.get(\"adapter_type\")\n    return {\"full_adapter_xl\": \"sdxl\", \"full_adapter\": \"sd1\", \"light_adapter\": \"sd1\"}.get(t)","typeGuard":null,"tryCatchPattern":"try:\n    cfg = T2IAdapter_Diffusers_SD1_Config.from_model_on_disk(mod, override_fields)\nexcept NotAMatchError as e:\n    if str(e).startswith(\"base is\"):\n        print(\"Adapter belongs to a different base — let the prober pick the right class\")\n    raise","preventionTips":["Prefer auto-detection over forcing an explicit config class","Keep adapter_type in config.json consistent with the checkpoint's true base","Group SD1 and SDXL adapters in separate import folders to reduce confusion"],"tags":["t2i-adapter","base-model","model-detection"],"backgroundTag":"model-base-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}