{"record":{"id":"8326f8edce95531c","repo":"invoke-ai/InvokeAI","slug":"no-subclass-of-loadedmodel-is-registered-for-base","errorCode":null,"errorMessage":"No subclass of LoadedModel is registered for base={config.base}, type={config.type}, format={config.format}","messagePattern":"No subclass of LoadedModel is registered for base=(.+?), type=(.+?), format=(.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/load/model_loader_registry.py","lineNumber":92,"sourceCode":"                raise Exception(\n                    f\"{subclass.__name__} is trying to register as a loader for {base}/{type}/{format}, but this type of model has already been registered by {cls._registry[key].__name__}\"\n                )\n            cls._registry[key] = subclass\n            return subclass\n\n        return decorator\n\n    @classmethod\n    def get_implementation(\n        cls, config: AnyModelConfig, submodel_type: Optional[SubModelType]\n    ) -> Tuple[Type[ModelLoaderBase], Config_Base, Optional[SubModelType]]:\n        \"\"\"Get subclass of ModelLoaderBase registered to handle base and type.\"\"\"\n\n        key1 = cls._to_registry_key(config.base, config.type, config.format)  # for a specific base type\n        key2 = cls._to_registry_key(BaseModelType.Any, config.type, config.format)  # with wildcard Any\n        implementation = cls._registry.get(key1) or cls._registry.get(key2)\n        if not implementation:\n            raise NotImplementedError(\n                f\"No subclass of LoadedModel is registered for base={config.base}, type={config.type}, format={config.format}\"\n            )\n        return implementation, config, submodel_type\n\n    @staticmethod\n    def _to_registry_key(base: BaseModelType, type: ModelType, format: ModelFormat) -> str:\n        return \"-\".join([base.value, type.value, format.value])\n","sourceCodeStart":74,"sourceCodeEnd":100,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/load/model_loader_registry.py#L74-L100","documentation":"The model loader registry maps (base, type, format) triples to loader classes. get_implementation looks up the exact key and then a wildcard-Any-base key, and raises NotImplementedError when neither is registered — i.e., no loader supports that combination of model base, type, and format.","triggerScenarios":"Calling ModelLoaderRegistry.get_implementation(config, submodel_type) with a config whose (base, type, format) tuple has no registered loader, e.g. a newly added ModelType/ModelFormat or a custom config.","commonSituations":"Running a new InvokeAI version's model database with an older/patched install lacking the loader; custom or experimental model formats (e.g. new quantized formats) before a loader was implemented.","solutions":["Upgrade InvokeAI to a version whose loader registry includes the required (base, type, format) combination.","Check that the model was identified with the intended format; re-convert/re-import it in a supported format (e.g. diffusers instead of a custom single-file format).","If you are a developer, register a ModelLoaderBase subclass for the key via ModelLoaderRegistry.register."],"exampleFix":"// before: loading an unsupported format directly\nimpl, cfg, sub = ModelLoaderRegistry.get_implementation(config, None)\n// after: guard the combination first\nfrom invokeai.backend.model_manager.load.model_loader_registry import ModelLoaderRegistry\nif not (ModelLoaderRegistry._registry.get(ModelLoaderRegistry._to_registry_key(config.base, config.type, config.format)) or ModelLoaderRegistry._registry.get(ModelLoaderRegistry._to_registry_key(BaseModelType.Any, config.type, config.format))):\n    raise RuntimeError(f\"No loader for {config.base}/{config.type}/{config.format}; upgrade InvokeAI or convert the model\")\nimpl, cfg, sub = ModelLoaderRegistry.get_implementation(config, None)","handlingStrategy":"type-guard","validationCode":"from invokeai.backend.model_manager.load.model_loader_registry import ModelLoaderRegistry\nkey1 = ModelLoaderRegistry._to_registry_key(config.base, config.type, config.format)\nkey2 = ModelLoaderRegistry._to_registry_key(BaseModelType.Any, config.type, config.format)\nif not (ModelLoaderRegistry._registry.get(key1) or ModelLoaderRegistry._registry.get(key2)):\n    raise RuntimeError(f\"No loader registered for {config.base}/{config.type}/{config.format}\")","typeGuard":"def loader_exists(config) -> bool:\n    return (ModelLoaderRegistry._registry.get(ModelLoaderRegistry._to_registry_key(config.base, config.type, config.format))\n            or ModelLoaderRegistry._registry.get(ModelLoaderRegistry._to_registry_key(BaseModelType.Any, config.type, config.format))) is not None","tryCatchPattern":"try:\n    impl, cfg, sub = ModelLoaderRegistry.get_implementation(config, submodel_type)\nexcept NotImplementedError as e:\n    raise RuntimeError(f\"This InvokeAI build cannot load {config.type}/{config.format}; upgrade or convert the model\") from e","preventionTips":["Keep InvokeAI upgraded so newly supported model formats have loaders","Convert exotic formats to diffusers layout before importing","Avoid hand-editing the format field of model records in the database"],"tags":["registry","unsupported-model","not-implemented"],"backgroundTag":"unsupported-model-format","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}