{"record":{"id":"321401ce567dc173","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"could-not-find-checkpoint-with-name-self-hr-check","errorCode":null,"errorMessage":"Could not find checkpoint with name {self.hr_checkpoint_name}","messagePattern":"Could not find checkpoint with name (.+?)","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"modules/processing.py","lineNumber":1260,"sourceCode":"                if src_ratio < dst_ratio:\r\n                    self.hr_upscale_to_x = self.hr_resize_x\r\n                    self.hr_upscale_to_y = self.hr_resize_x * self.height // self.width\r\n                else:\r\n                    self.hr_upscale_to_x = self.hr_resize_y * self.width // self.height\r\n                    self.hr_upscale_to_y = self.hr_resize_y\r\n\r\n                self.truncate_x = (self.hr_upscale_to_x - target_w) // opt_f\r\n                self.truncate_y = (self.hr_upscale_to_y - target_h) // opt_f\r\n\r\n    def init(self, all_prompts, all_seeds, all_subseeds):\r\n        if self.enable_hr:\r\n            self.extra_generation_params[\"Denoising strength\"] = self.denoising_strength\r\n\r\n            if self.hr_checkpoint_name and self.hr_checkpoint_name != 'Use same checkpoint':\r\n                self.hr_checkpoint_info = sd_models.get_closet_checkpoint_match(self.hr_checkpoint_name)\r\n\r\n                if self.hr_checkpoint_info is None:\r\n                    raise Exception(f'Could not find checkpoint with name {self.hr_checkpoint_name}')\r\n\r\n                self.extra_generation_params[\"Hires checkpoint\"] = self.hr_checkpoint_info.short_title\r\n\r\n            if self.hr_sampler_name is not None and self.hr_sampler_name != self.sampler_name:\r\n                self.extra_generation_params[\"Hires sampler\"] = self.hr_sampler_name\r\n\r\n            def get_hr_prompt(p, index, prompt_text, **kwargs):\r\n                hr_prompt = p.all_hr_prompts[index]\r\n                return hr_prompt if hr_prompt != prompt_text else None\r\n\r\n            def get_hr_negative_prompt(p, index, negative_prompt, **kwargs):\r\n                hr_negative_prompt = p.all_hr_negative_prompts[index]\r\n                return hr_negative_prompt if hr_negative_prompt != negative_prompt else None\r\n\r\n            self.extra_generation_params[\"Hires prompt\"] = get_hr_prompt\r\n            self.extra_generation_params[\"Hires negative prompt\"] = get_hr_negative_prompt\r\n\r\n            self.extra_generation_params[\"Hires schedule type\"] = None  # to be set in sd_samplers_kdiffusion.py\r","sourceCodeStart":1242,"sourceCodeEnd":1278,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/processing.py#L1242-L1278","documentation":"In StableDiffusionProcessingTxt2Img.init for hires-fix: when hr_checkpoint_name is set to something other than 'Use same checkpoint', it is resolved with sd_models.get_closet_checkpoint_match; None means no known checkpoint matches, and the Exception aborts before the first pass. It protects the second (hires) pass from running with an unloadable model.","triggerScenarios":"Enabling hires fix with 'Hires checkpoint' set to a name that matches no checkpoint in models/Stable-diffusion — deleted file, typo, or a saved UI state referencing a model not present on this machine.","commonSituations":"Moving a webui install to another machine without copying all checkpoints; renaming model files while the dropdown retains the old title; API scripts hardcoding a hires checkpoint name.","solutions":["Restore the checkpoint file referenced by hr_checkpoint_name and refresh the model list.","Or set the dropdown/'hr_checkpoint_name' back to 'Use same checkpoint' so hires fix reuses the primary model.","Verify the exact checkpoint title via the API (sdapi/v1/sd-models) and use a matching substring."],"exampleFix":"# before\npayload['hr_checkpoint_name'] = 'myDeletedModel.safetensors'  # Exception\n\n# after\npayload['hr_checkpoint_name'] = 'Use same checkpoint'","handlingStrategy":"validation","validationCode":"from modules import sd_models\n\ndef validate_hr_checkpoint(name):\n    if not name or name == 'Use same checkpoint':\n        return True\n    return sd_models.get_closet_checkpoint_match(name) is not None\n\nif not validate_hr_checkpoint(payload.get('hr_checkpoint_name')):\n    payload['hr_checkpoint_name'] = 'Use same checkpoint'","typeGuard":"def hires_checkpoint_ok(name: str) -> bool:\n    return (not name) or name == 'Use same checkpoint' or sd_models.get_closet_checkpoint_match(name) is not None","tryCatchPattern":"try:\n    processed = process_images(p)\nexcept Exception as e:\n    if 'Could not find checkpoint' in str(e) and getattr(p, 'hr_checkpoint_name', None):\n        p.hr_checkpoint_name = 'Use same checkpoint'\n        processed = process_images(p)\n    else:\n        raise","preventionTips":["After removing checkpoint files, reset the Hires checkpoint dropdown too.","API scripts should resolve hr_checkpoint_name the same way the UI does before submitting."],"tags":["hires-fix","checkpoint","processing","model-files"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}