invoke-ai/InvokeAI · error · Exception

Error model. HiDiffusion now only supports sd15, sd21, sdxl,

Error message

Error model. HiDiffusion now only supports sd15, sd21, sdxl, sdxl-turbo.

What it means

HiDiffusion's applied-UNet wrapper only recognizes the model families sd15, sd21, sdxl, and sdxl-turbo when choosing switching-threshold tables; any other `self.model` value falls into this else branch and raises a plain Exception. It indicates the HiDiffusion instance was activated with an unsupported model identifier.

Source

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

                    if self.info["text_to_img_controlnet"]:
                        self.T1_ratio = text_to_img_controlnet_switching_threshold_ratio_dict["sdxl_2048"][
                            self.switching_threshold_ratio
                        ]
                    else:
                        self.T1_ratio = switching_threshold_ratio_dict["sdxl_2048"][self.switching_threshold_ratio]

                    if self.info["is_inpainting_task"]:
                        self.aggressive_raunet = inpainting_is_aggressive_raunet
                    elif self.info["is_playground"]:
                        self.aggressive_raunet = playground_is_aggressive_raunet
                    else:
                        self.aggressive_raunet = is_aggressive_raunet
                else:
                    self.T1_ratio = switching_threshold_ratio_dict["sdxl_4096"][self.switching_threshold_ratio]
            elif self.model == "sdxl_turbo":
                self.T1_ratio = switching_threshold_ratio_dict["sdxl_turbo_1024"][self.switching_threshold_ratio]
            else:
                raise Exception("Error model. HiDiffusion now only supports sd15, sd21, sdxl, sdxl-turbo.")

            if self.aggressive_raunet:
                # self.T1_start = min(int(self.max_timestep * self.T1_ratio * 0.4), int(8/50 * self.max_timestep))
                self.T1_start = int(aggressive_step / 50 * self.max_timestep)
                self.T1_end = int(self.max_timestep * self.T1_ratio)
                self.T1 = 0  # to avoid confict with sdxl-turbo
            else:
                self.T1 = int(self.max_timestep * self.T1_ratio)

            output_states = ()

            blocks = list(zip(self.resnets, self.attentions, strict=False))

            for i, (resnet, attn) in enumerate(blocks):
                if self.training and self.gradient_checkpointing:

                    def create_custom_forward(module, return_dict=None):
                        def custom_forward(*inputs):

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Set the model identifier to exactly one of 'sd15', 'sd21', 'sdxl', or 'sdxl_turbo' when applying HiDiffusion
  2. Check the `model` attribute/argument for typos and casing before construction
  3. If your checkpoint is SDXL-compatible, map it to 'sdxl' rather than passing a repo name; otherwise do not apply HiDiffusion to unsupported architectures

Example fix

// before
apply_hidiffusion(unet, model="stabilityai/sdxl-refiner-1.0")
// after
apply_hidiffusion(unet, model="sdxl")
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {'sd15', 'sd21', 'sdxl', 'sdxl_turbo'}
if model not in SUPPORTED:
    raise ValueError(f'HiDiffusion supports only {sorted(SUPPORTED)}, got {model!r}')

Type guard

def is_hidiffusion_supported(model: str) -> bool:
    return model in {'sd15', 'sd21', 'sdxl', 'sdxl_turbo'}

Try / catch

try:
    out = unet(sample, t, emb)
except Exception as e:
    if 'Error model' in str(e):
        raise ValueError(f'Model {model!r} unsupported by HiDiffusion; use sd15/sd21/sdxl/sdxl_turbo') from e
    raise

Prevention

When it happens

Trigger: Calling `apply_hidiffusion(...)`/initializing with a `model` string not in {sd15, sd21, sdxl, sdxl_turbo} (e.g. 'sd14', 'sdxl-refiner', a typo, or a custom checkpoint name), which later hits the else in the threshold-ratio setup during forward.

Common situations: Passing a HuggingFace repo id instead of one of HiDiffusion's four supported keys; typos like 'sdxl-turbo' vs accepted 'sdxl_turbo'; applying HiDiffusion to SDXL-Refiner, SSD-1B, or other UNets it does not support.

Related errors


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