invoke-ai/InvokeAI · error · Exception

{name_or_path} is not a supported model. HiDiffusion now onl

Error message

{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.

What it means

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.

Source

Thrown at invokeai/backend/hidiffusion/hidiffusion.py:2222

                _reset_hidiffusion_runtime_state(module)
                make_block_fn = make_diffusers_cross_attn_down_block
                module.__class__ = make_block_fn(module.__class__)
                module.switching_threshold_ratio = "T1_ratio"

            if apply_raunet and key in modified_key["up_module_key"]:
                _reset_hidiffusion_runtime_state(module)
                make_block_fn = make_diffusers_cross_attn_up_block
                module.__class__ = make_block_fn(module.__class__)
                module.switching_threshold_ratio = "T1_ratio"

            if apply_window_attn and key in modified_key["windown_attn_module_key"]:
                make_block_fn = make_diffusers_transformer_block
                module.__class__ = make_block_fn(module.__class__, generator)

            module.model = "sdxl_turbo"
            module.info = diffusion_model.info
    else:
        raise Exception(
            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."
        )
    return model


def remove_hidiffusion(model: torch.nn.Module):
    """Removes hidiffusion from a Diffusion module if it was already patched."""
    # For diffusers
    model = model.unet if hasattr(model, "unet") else model

    for _, module in model.named_modules():
        if hasattr(module, "info"):
            for hook in module.info["hooks"]:
                hook.remove()
            module.info["hooks"].clear()

        is_patched = hasattr(module, "_parent")
        if _HIDIFFUSION_STATE_SNAPSHOT in module.__dict__:

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Load one of the officially supported checkpoints by its exact repo id so name_or_path matches supported_official_model.
  2. If loading locally, set model.name_or_path (or _name_or_path) to a supported repo id before apply_hidiffusion.
  3. For SDXL/SD1.5 derivatives, keep the UNet structure stock so the sd15_module_key/sdxl_module_key sniffing succeeds.
  4. Disable HiDiffusion for genuinely unsupported architectures (SD3, Flux, SSD-1B, sd2.1-768 variants) and use standard attention instead.

Example fix

// before
pipe = StableDiffusionXLPipeline.from_single_file("/models/my_xl.safetensors")  # name_or_path empty/unknown
apply_hidiffusion(pipe, apply_raunet=True)
// after
pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
apply_hidiffusion(pipe, apply_raunet=True, apply_window_attn=True)
Defensive patterns

Strategy: validation

Validate before calling

supported = {"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"}
name = getattr(model, "name_or_path", None) or getattr(model, "_name_or_path", "")
if name not in supported:
    print(f"{name!r} not officially supported by HiDiffusion; skipping patch")
else:
    apply_hidiffusion(model, apply_raunet=True, apply_window_attn=True)

Type guard

def is_supported_checkpoint(model) -> bool:
    name = getattr(model, "name_or_path", None) or getattr(model, "_name_or_path", "")
    return name in {
        "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",
    }

Try / catch

try:
    apply_hidiffusion(model, apply_raunet=True, apply_window_attn=True)
except Exception as e:
    if "is not a supported model" in str(e):
        logger.warning(f"HiDiffusion skipped for {getattr(model, 'name_or_path', '?')}")
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/dc12bf570677cbce. Report an issue: GitHub.