{"record":{"id":"62195f3358bca8eb","repo":"invoke-ai/InvokeAI","slug":"error-model-hidiffusion-now-only-supports-sd15-s","errorCode":null,"errorMessage":"Error model. HiDiffusion now only supports sd15, sd21, sdxl, sdxl-turbo.","messagePattern":"Error model\\. HiDiffusion now only supports sd15, sd21, sdxl, sdxl-turbo\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"invokeai/backend/hidiffusion/hidiffusion.py","lineNumber":1585,"sourceCode":"                    if self.info[\"text_to_img_controlnet\"]:\n                        self.T1_ratio = text_to_img_controlnet_switching_threshold_ratio_dict[\"sdxl_2048\"][\n                            self.switching_threshold_ratio\n                        ]\n                    else:\n                        self.T1_ratio = switching_threshold_ratio_dict[\"sdxl_2048\"][self.switching_threshold_ratio]\n\n                    if self.info[\"is_inpainting_task\"]:\n                        self.aggressive_raunet = inpainting_is_aggressive_raunet\n                    elif self.info[\"is_playground\"]:\n                        self.aggressive_raunet = playground_is_aggressive_raunet\n                    else:\n                        self.aggressive_raunet = is_aggressive_raunet\n                else:\n                    self.T1_ratio = switching_threshold_ratio_dict[\"sdxl_4096\"][self.switching_threshold_ratio]\n            elif self.model == \"sdxl_turbo\":\n                self.T1_ratio = switching_threshold_ratio_dict[\"sdxl_turbo_1024\"][self.switching_threshold_ratio]\n            else:\n                raise Exception(\"Error model. HiDiffusion now only supports sd15, sd21, sdxl, sdxl-turbo.\")\n\n            if self.aggressive_raunet:\n                # self.T1_start = min(int(self.max_timestep * self.T1_ratio * 0.4), int(8/50 * self.max_timestep))\n                self.T1_start = int(aggressive_step / 50 * self.max_timestep)\n                self.T1_end = int(self.max_timestep * self.T1_ratio)\n                self.T1 = 0  # to avoid confict with sdxl-turbo\n            else:\n                self.T1 = int(self.max_timestep * self.T1_ratio)\n\n            output_states = ()\n\n            blocks = list(zip(self.resnets, self.attentions, strict=False))\n\n            for i, (resnet, attn) in enumerate(blocks):\n                if self.training and self.gradient_checkpointing:\n\n                    def create_custom_forward(module, return_dict=None):\n                        def custom_forward(*inputs):","sourceCodeStart":1567,"sourceCodeEnd":1603,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/hidiffusion/hidiffusion.py#L1567-L1603","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set the model identifier to exactly one of 'sd15', 'sd21', 'sdxl', or 'sdxl_turbo' when applying HiDiffusion","Check the `model` attribute/argument for typos and casing before construction","If your checkpoint is SDXL-compatible, map it to 'sdxl' rather than passing a repo name; otherwise do not apply HiDiffusion to unsupported architectures"],"exampleFix":"// before\napply_hidiffusion(unet, model=\"stabilityai/sdxl-refiner-1.0\")\n// after\napply_hidiffusion(unet, model=\"sdxl\")","handlingStrategy":"validation","validationCode":"SUPPORTED = {'sd15', 'sd21', 'sdxl', 'sdxl_turbo'}\nif model not in SUPPORTED:\n    raise ValueError(f'HiDiffusion supports only {sorted(SUPPORTED)}, got {model!r}')","typeGuard":"def is_hidiffusion_supported(model: str) -> bool:\n    return model in {'sd15', 'sd21', 'sdxl', 'sdxl_turbo'}","tryCatchPattern":"try:\n    out = unet(sample, t, emb)\nexcept Exception as e:\n    if 'Error model' in str(e):\n        raise ValueError(f'Model {model!r} unsupported by HiDiffusion; use sd15/sd21/sdxl/sdxl_turbo') from e\n    raise","preventionTips":["Validate the model key against the supported set before applying HiDiffusion","Do not pass HuggingFace repo ids; use the four canonical keys","For SDXL-Refiner or other UNets, skip HiDiffusion entirely"],"tags":["hidiffusion","configuration","unsupported-model"],"backgroundTag":"unsupported-model-type","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}