{"record":{"id":"dc12bf570677cbce","repo":"invoke-ai/InvokeAI","slug":"name-or-path-is-not-a-supported-model-hidiffusi","errorCode":null,"errorMessage":"{name_or_path} is not a supported model. HiDiffusion now only supports runwayml/stable-diffusion-v1-5, stabilityai/stable-diffusion-2-1-base, stabilityai/stable-diffusion-xl-base-1.0, stabilityai/sdxl-turbo, diffusers/stable-diffusion-xl-1.0-inpainting-0.1 and their derivative models/pipelines.","messagePattern":"(.+?) is not a supported model\\. HiDiffusion now only supports runwayml/stable-diffusion-v1-5, stabilityai/stable-diffusion-2-1-base, stabilityai/stable-diffusion-xl-base-1\\.0, stabilityai/sdxl-turbo, diffusers/stable-diffusion-xl-1\\.0-inpainting-0\\.1 and their derivative models/pipelines\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"invokeai/backend/hidiffusion/hidiffusion.py","lineNumber":2222,"sourceCode":"                _reset_hidiffusion_runtime_state(module)\n                make_block_fn = make_diffusers_cross_attn_down_block\n                module.__class__ = make_block_fn(module.__class__)\n                module.switching_threshold_ratio = \"T1_ratio\"\n\n            if apply_raunet and key in modified_key[\"up_module_key\"]:\n                _reset_hidiffusion_runtime_state(module)\n                make_block_fn = make_diffusers_cross_attn_up_block\n                module.__class__ = make_block_fn(module.__class__)\n                module.switching_threshold_ratio = \"T1_ratio\"\n\n            if apply_window_attn and key in modified_key[\"windown_attn_module_key\"]:\n                make_block_fn = make_diffusers_transformer_block\n                module.__class__ = make_block_fn(module.__class__, generator)\n\n            module.model = \"sdxl_turbo\"\n            module.info = diffusion_model.info\n    else:\n        raise Exception(\n            f\"{name_or_path} is not a supported model. HiDiffusion now only supports runwayml/stable-diffusion-v1-5, stabilityai/stable-diffusion-2-1-base, stabilityai/stable-diffusion-xl-base-1.0, stabilityai/sdxl-turbo, diffusers/stable-diffusion-xl-1.0-inpainting-0.1 and their derivative models/pipelines.\"\n        )\n    return model\n\n\ndef remove_hidiffusion(model: torch.nn.Module):\n    \"\"\"Removes hidiffusion from a Diffusion module if it was already patched.\"\"\"\n    # For diffusers\n    model = model.unet if hasattr(model, \"unet\") else model\n\n    for _, module in model.named_modules():\n        if hasattr(module, \"info\"):\n            for hook in module.info[\"hooks\"]:\n                hook.remove()\n            module.info[\"hooks\"].clear()\n\n        is_patched = hasattr(module, \"_parent\")\n        if _HIDIFFUSION_STATE_SNAPSHOT in module.__dict__:","sourceCodeStart":2204,"sourceCodeEnd":2240,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/hidiffusion/hidiffusion.py#L2204-L2240","documentation":"After the type check passes, apply_hidiffusion decides which model family to tag modules with using model.name_or_path/_name_or_path, with a fallback that sniffs UNet module keys for SD1.5/SDXL structures (hidiffusion.py:2113-2121). If the identifier is not in supported_official_model and the structure matches neither sd15_module_key nor sdxl_module_key, it raises this Exception listing the supported checkpoints and derivatives.","triggerScenarios":"Calling apply_hidiffusion/hidiffusion_patch on a pipeline whose name_or_path is not one of runwayml/stable-diffusion-v1-5, stabilityai/stable-diffusion-2-1-base, stabilityai/stable-diffusion-xl-base-1.0, stabilityai/sdxl-turbo, diffusers/stable-diffusion-xl-1.0-inpainting-0.1, and whose UNet module-key set is not a superset of sd15_module_key or sdxl_module_key — e.g. SD2.1-768 (unet/config), SDXL-Turbo loaded from local files with an empty name_or_path, SD3/Flux, SSD-1B.","commonSituations":"Loading a model with from_single_file (no name_or_path set) or a locally renamed folder; using non-base resolutions/variants (sd2.1-768) whose UNet keys differ from sd21-base; community merges/LoRA-modified UNets that break the structural sniffing; newer architectures like SD3 or Flux.","solutions":["Load one of the officially supported checkpoints by its exact repo id so name_or_path matches supported_official_model.","If loading locally, set model.name_or_path (or _name_or_path) to a supported repo id before apply_hidiffusion.","For SDXL/SD1.5 derivatives, keep the UNet structure stock so the sd15_module_key/sdxl_module_key sniffing succeeds.","Disable HiDiffusion for genuinely unsupported architectures (SD3, Flux, SSD-1B, sd2.1-768 variants) and use standard attention instead."],"exampleFix":"// before\npipe = StableDiffusionXLPipeline.from_single_file(\"/models/my_xl.safetensors\")  # name_or_path empty/unknown\napply_hidiffusion(pipe, apply_raunet=True)\n// after\npipe = StableDiffusionXLPipeline.from_pretrained(\"stabilityai/stable-diffusion-xl-base-1.0\")\napply_hidiffusion(pipe, apply_raunet=True, apply_window_attn=True)","handlingStrategy":"validation","validationCode":"supported = {\"runwayml/stable-diffusion-v1-5\", \"stabilityai/stable-diffusion-2-1-base\",\n             \"stabilityai/stable-diffusion-xl-base-1.0\", \"stabilityai/sdxl-turbo\",\n             \"diffusers/stable-diffusion-xl-1.0-inpainting-0.1\"}\nname = getattr(model, \"name_or_path\", None) or getattr(model, \"_name_or_path\", \"\")\nif name not in supported:\n    print(f\"{name!r} not officially supported by HiDiffusion; skipping patch\")\nelse:\n    apply_hidiffusion(model, apply_raunet=True, apply_window_attn=True)","typeGuard":"def is_supported_checkpoint(model) -> bool:\n    name = getattr(model, \"name_or_path\", None) or getattr(model, \"_name_or_path\", \"\")\n    return name in {\n        \"runwayml/stable-diffusion-v1-5\", \"stabilityai/stable-diffusion-2-1-base\",\n        \"stabilityai/stable-diffusion-xl-base-1.0\", \"stabilityai/sdxl-turbo\",\n        \"diffusers/stable-diffusion-xl-1.0-inpainting-0.1\",\n    }","tryCatchPattern":"try:\n    apply_hidiffusion(model, apply_raunet=True, apply_window_attn=True)\nexcept Exception as e:\n    if \"is not a supported model\" in str(e):\n        logger.warning(f\"HiDiffusion skipped for {getattr(model, 'name_or_path', '?')}\")\n    else:\n        raise","preventionTips":["Load models by their exact supported repo ids, not renamed local folders.","When loading from a single file, set model._name_or_path to a supported id.","Note sd2.1-768 (non-base) is not supported — only stable-diffusion-2-1-base.","Keep a config whitelist of HiDiffusion-capable models and default the feature off."],"tags":["hidiffusion","unsupported-model","model-loading","diffusion"],"backgroundTag":"unsupported-model-architecture","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}