{"record":{"id":"288adcc3d6631a34","repo":"invoke-ai/InvokeAI","slug":"unrecognised-unsupported-architecture-for-omi-lora","errorCode":null,"errorMessage":"unrecognised/unsupported architecture for OMI LoRA: {architecture}","messagePattern":"unrecognised/unsupported architecture for OMI LoRA: (.+?)","errorType":"exception","errorClass":"NotAMatchError","httpStatus":null,"severity":"warning","filePath":"invokeai/backend/model_manager/configs/lora.py","lineNumber":557,"sourceCode":"            bool(metadata.get(\"modelspec.sai_model_spec\"))\n            and metadata.get(\"ot_branch\") == \"omi_format\"\n            and metadata.get(\"modelspec.architecture\", \"\").split(\"/\")[1].lower() == \"lora\"\n        )\n\n        if not metadata_looks_like_omi_lora:\n            raise NotAMatchError(\"metadata does not look like OMI LoRA\")\n\n    @classmethod\n    def _get_base_or_raise(cls, mod: ModelOnDisk) -> Literal[BaseModelType.Flux, BaseModelType.StableDiffusionXL]:\n        metadata = mod.metadata()\n        architecture = metadata[\"modelspec.architecture\"]\n\n        if architecture == stable_diffusion_xl_1_lora:\n            return BaseModelType.StableDiffusionXL\n        elif architecture == flux_dev_1_lora:\n            return BaseModelType.Flux\n        else:\n            raise NotAMatchError(f\"unrecognised/unsupported architecture for OMI LoRA: {architecture}\")\n\n\nclass LoRA_OMI_SDXL_Config(LoRA_OMI_Config_Base, Config_Base):\n    base: Literal[BaseModelType.StableDiffusionXL] = Field(default=BaseModelType.StableDiffusionXL)\n\n\nclass LoRA_OMI_FLUX_Config(LoRA_OMI_Config_Base, Config_Base):\n    base: Literal[BaseModelType.Flux] = Field(default=BaseModelType.Flux)\n\n\nclass LoRA_LyCORIS_Config_Base(LoRA_Config_Base):\n    \"\"\"Model config for LoRA/Lycoris models.\"\"\"\n\n    type: Literal[ModelType.LoRA] = Field(default=ModelType.LoRA)\n    format: Literal[ModelFormat.LyCORIS] = Field(default=ModelFormat.LyCORIS)\n\n    @classmethod\n    def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/lora.py#L539-L575","documentation":"When InvokeAI probes an OMI-format LoRA model on disk to determine its base model, `_get_base_or_raise` only recognizes the `stable_diffusion_xl_1_lora` and `flux_dev_1_lora` OMI architecture strings. Any other architecture value means the config matcher cannot map the model to a base model type, so it raises `NotAMatchError`. This is a deliberate 'this config class does not match this model' signal used during model-format sniffing.","triggerScenarios":"Loading or importing a model whose OMI metadata (`architecture` field in its OMI JSON) declares an architecture other than `stable_diffusion_xl_1_lora` or `flux_dev_1_lora` — e.g. a Flux SD3/Flux2, SD1.5, or SDXL-variant OMI LoRA — via `from_model_on_disk` during model scan/import.","commonSituations":"Dropping an OMI LoRA trained for an unsupported base (SD1.5, SD3, Flux2) into the autoimport folder; an OMI tool exporting a new architecture string not yet whitelisted in InvokeAI; OMI spec version drift where architecture names were renamed.","solutions":["Convert or re-export the LoRA to a supported format (Kohya/diffusers) or to an OMI architecture `stable_diffusion_xl_1_lora`/`flux_dev_1_lora`","Check the `architecture` string in the model's OMI JSON for typos and correct it to a recognized value","Upgrade InvokeAI — new OMI architectures are added over time","Register the model manually with the correct base model type instead of relying on auto-detection"],"exampleFix":"// before (model.omi.json)\n{\"architecture\": \"flux_1_dev_lora\"}\n// after\n{\"architecture\": \"flux_dev_1_lora\"}","handlingStrategy":"validation","validationCode":"import json\nSUPPORTED = {\"stable_diffusion_xl_1_lora\", \"flux_dev_1_lora\"}\nmeta = json.load(open(\"model_dir/model.omi.json\"))\nif meta.get(\"architecture\") not in SUPPORTED:\n    raise ValueError(f\"OMI LoRA architecture {meta.get('architecture')!r} not supported\")","typeGuard":"def is_supported_omi_lora(meta: dict) -> bool:\n    return meta.get(\"architecture\") in {\"stable_diffusion_xl_1_lora\", \"flux_dev_1_lora\"}","tryCatchPattern":"from invokeai.backend.model_manager.configs.lora import NotAMatchError\ntry:\n    cfg = LoRA_OMI_Config_Base.from_model_on_disk(mod)\nexcept NotAMatchError:\n    print(\"OMI LoRA architecture unsupported; convert or import manually\")","preventionTips":["Check the OMI JSON architecture field before importing","Keep InvokeAI updated for newly whitelisted OMI architectures","Convert exotic architectures to Kohya/diffusers format first"],"tags":["model-loading","lora","omi","not-a-match"],"backgroundTag":"model-base-detection-failed","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}