{"record":{"id":"640c72c1c22612d5","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"unable-to-find-model-info-path","errorCode":null,"errorMessage":"Unable to find model info: {path}","messagePattern":"Unable to find model info: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"modules/dat_model.py","lineNumber":56,"sourceCode":"        return upscale_with_model(\n            model_descriptor,\n            img,\n            tile_size=opts.DAT_tile,\n            tile_overlap=opts.DAT_tile_overlap,\n        )\n\n    def load_model(self, path):\n        for scaler in self.scalers:\n            if scaler.data_path == path:\n                if scaler.local_data_path.startswith(\"http\"):\n                    scaler.local_data_path = modelloader.load_file_from_url(\n                        scaler.data_path,\n                        model_dir=self.model_download_path,\n                    )\n                if not os.path.exists(scaler.local_data_path):\n                    raise FileNotFoundError(f\"DAT data missing: {scaler.local_data_path}\")\n                return scaler\n        raise ValueError(f\"Unable to find model info: {path}\")\n\n\ndef get_dat_models(scaler):\n    return [\n        UpscalerData(\n            name=\"DAT x2\",\n            path=\"https://github.com/n0kovo/dat_upscaler_models/raw/main/DAT/DAT_x2.pth\",\n            scale=2,\n            upscaler=scaler,\n        ),\n        UpscalerData(\n            name=\"DAT x3\",\n            path=\"https://github.com/n0kovo/dat_upscaler_models/raw/main/DAT/DAT_x3.pth\",\n            scale=3,\n            upscaler=scaler,\n        ),\n        UpscalerData(\n            name=\"DAT x4\",","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/dat_model.py#L38-L74","documentation":"ValueError raised by DatUpscaler.load_model when the requested path does not match any UpscalerData.data_path among the registered DAT scalers. The loop matches scaler.data_path == path exactly; if the caller (upscaler dispatch by name or user code calling load_model directly) passes a local filename, a title like 'DAT x2', or a URL variant (http vs https, trailing slash), no scaler matches and this generic 'Unable to find model info' is raised.","triggerScenarios":"Calling upscaler.load_model('models/DAT/DAT_x2.pth') (local path) instead of the registered https URL string; UI code resolving a scaler by name then passing the name back into load_model; mismatch after the DAT entry list changed (scale added/removed) between the cached UpscalerData and the request.","commonSituations":"Custom scripts/extensions driving upscalers with file paths rather than the canonical UpscalerData.path; stale scaler caches listing retired DAT entries; URL scheme changes upstream.","solutions":["Pass exactly the scaler's registered path: iterate upscaler.scalers and use scaler.data_path (the https URL) as the argument","Re-derive the scaler by matching user-visible name to UpscalerData.name first, then call load_model(scaler.path)","Refresh the upscaler list in the UI after adding/removing DAT models"],"exampleFix":"# before\nscaler = dat_upscaler.DatUpscaler()\ninfo = scaler.load_model('models/DAT/DAT_x2.pth')  # ValueError\n\n# after\ndata = next(d for d in scaler.scalers if d.name == 'DAT x2')\ninfo = scaler.load_model(data.path)","handlingStrategy":"type-guard","validationCode":"paths = {d.path for d in scaler.scalers}\nif path not in paths:\n    raise ValueError(f'unknown DAT path {path!r}; registered: {sorted(paths)}')","typeGuard":"def is_registered_dat_path(path: str, upscaler) -> bool:\n    return any(d.path == path for d in upscaler.scalers)","tryCatchPattern":"try:\n    scaler.load_model(path)\nexcept ValueError as e:\n    if 'Unable to find model info' in str(e):\n        d = next((d for d in scaler.scalers if d.name in path or path in d.name), None)\n        if d: return scaler.load_model(d.path)\n    raise","preventionTips":["Always resolve UpscalerData by name, then pass its .path to load_model","Do not construct local file paths for scaler loading","Rebuild scaler lists after changing models/DAT contents"],"tags":["upscaler","dat","model-loading","stable-diffusion-webui"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}