{"record":{"id":"39ce28ceca505287","repo":"invoke-ai/InvokeAI","slug":"missing-ip-adapter-bin-weights-file","errorCode":null,"errorMessage":"missing ip_adapter.bin weights file","messagePattern":"missing ip_adapter\\.bin weights file","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/ip_adapter.py","lineNumber":66,"sourceCode":"        cls._validate_has_image_encoder_metadata_file(mod)\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 _validate_has_weights_file(cls, mod: ModelOnDisk) -> None:\n        weights_file = mod.path / \"ip_adapter.bin\"\n        if not weights_file.exists():\n            raise NotAMatchError(\"missing ip_adapter.bin weights file\")\n\n    @classmethod\n    def _validate_has_image_encoder_metadata_file(cls, mod: ModelOnDisk) -> None:\n        image_encoder_metadata_file = mod.path / \"image_encoder.txt\"\n        if not image_encoder_metadata_file.exists():\n            raise NotAMatchError(\"missing image_encoder.txt metadata file\")\n\n    @classmethod\n    def _get_base_or_raise(cls, mod: ModelOnDisk) -> BaseModelType:\n        state_dict = mod.load_state_dict()\n\n        try:\n            cross_attention_dim = state_dict[\"ip_adapter\"][\"1.to_k_ip.weight\"].shape[-1]\n        except Exception as e:\n            raise NotAMatchError(f\"unable to determine cross attention dimension: {e}\") from e\n\n        match cross_attention_dim:\n            case 768:","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/ip_adapter.py#L48-L84","documentation":"IPAdapterModelConfig expects IP-Adapters in diffusers folder layout to include an `ip_adapter.bin` weights file at the folder root. _validate_has_weights_file checks for its existence and raises NotAMatchError if absent, distinguishing real IP-Adapter folders from other diffusers folders during probing.","triggerScenarios":"from_model_on_disk probing a directory without ip_adapter.bin using an IP-Adapter config class; weights renamed to .safetensors or moved into a subfolder.","commonSituations":"Newer h94/IP-Adapter releases ship ip_adapter.safetensors instead of .bin; partial downloads; users extracting only the image_encoder folder; custom repackaged adapters with different filenames.","solutions":["Rename the weights file to ip_adapter.bin inside the model folder (if it is the same format).","Re-download the complete IP-Adapter repository including ip_adapter.bin.","If your release only ships .safetensors, update InvokeAI to a version supporting that layout or add the .bin file.","Verify with Path.exists() that the folder layout matches diffusers IP-Adapter conventions."],"exampleFix":"// before\nmodels/ip_adapter_sd15/{image_encoder/, model.safetensors}\n// after\nmodels/ip_adapter_sd15/{image_encoder/, ip_adapter.bin, image_encoder.txt}","handlingStrategy":"validation","validationCode":"from pathlib import Path\nd = Path(model_dir)\nassert d.is_dir() and (d / \"ip_adapter.bin\").exists(), f\"not a valid IP-Adapter folder, missing ip_adapter.bin: {d}\"","typeGuard":"def is_ip_adapter_folder(p) -> bool:\n    from pathlib import Path\n    d = Path(p)\n    return d.is_dir() and (d / \"ip_adapter.bin\").exists() and (d / \"image_encoder\").is_dir()","tryCatchPattern":"try:\n    record = from_model_on_disk(mod)\nexcept NotAMatchError as e:\n    if \"missing ip_adapter.bin\" in str(e):\n        logger.warning(\"folder lacks ip_adapter.bin; not registrable as IP-Adapter: %s\", mod.path)","preventionTips":["Download complete IP-Adapter repos, not just weight files","Note that newer releases ship ip_adapter.safetensors; rename or update InvokeAI accordingly","Validate folder layout against the h94/IP-Adapter upstream structure"],"tags":["ip-adapter","missing-file","invokeai"],"backgroundTag":"missing-weights-file","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}