{"record":{"id":"a1d0b6f8ab9fddb1","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"dat-data-missing-scaler-local-data-path","errorCode":null,"errorMessage":"DAT data missing: {scaler.local_data_path}","messagePattern":"DAT data missing: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"modules/dat_model.py","lineNumber":54,"sourceCode":"            expected_architecture=\"DAT\",\n        )\n        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        ),","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/dat_model.py#L36-L72","documentation":"FileNotFoundError raised by DatUpscaler.load_model after the scaler's URL was (or was not) downloaded via load_file_from_url but scaler.local_data_path still does not exist on disk. DAT models ship as .pth URLs on GitHub; when the download fails silently or writes elsewhere, the os.path.exists check trips before the scaler is returned.","triggerScenarios":"Selecting the DAT upscaler in Extras while models/DAT/DAT_x2.pth (or x3/x4) is missing because the HTTPS download from github.com/n0kovo/dat_upscaler_models was blocked/failed; model dir redirected (custom --dat-models-path mismatch); file deleted between listing and load; partial download that saved to a temp name.","commonSituations":"Offline or China-region deployments where raw.githubusercontent/github downloads stall; interrupted first use leaving a corrupted cache entry; permission errors on the models directory so the file is never written.","solutions":["Manually download the required DAT_x{2,3,4}.pth from the GitHub repo and place it in models/DAT/","Verify models/DAT exists and is writable; remove partial files then retry so load_file_from_url re-downloads","Check the server can reach github.com (proxy env vars HTTP(S)_PROXY set for the webui process)"],"exampleFix":"# before: selecting DAT x2 in Extras -> FileNotFoundError\n\n# after\nmkdir -p models/DAT\ncurl -L -o models/DAT/DAT_x2.pth https://github.com/n0kovo/dat_upscaler_models/raw/main/DAT/DAT_x2.pth","handlingStrategy":"validation","validationCode":"import os\nneed = {'DAT x2':'DAT_x2.pth','DAT x3':'DAT_x3.pth','DAT x4':'DAT_x4.pth'}\nmissing = [f for f in need.values() if not os.path.isfile(os.path.join('models','DAT',f))]\nif missing:\n    raise FileNotFoundError(f'DAT weights missing: {missing}; download into models/DAT/')","typeGuard":"def dat_weights_present(name: str, dat_dir='models/DAT') -> bool:\n    return os.path.isfile(os.path.join(dat_dir, f\"DAT_x{name.split()[-1][1:]}.pth\"))","tryCatchPattern":"try:\n    scaler.load_model(path)\nexcept FileNotFoundError as e:\n    if 'DAT data missing' in str(e):\n        download_dat_weights(path); return scaler.load_model(path)\n    raise","preventionTips":["Vendor DAT .pth files into the deployment instead of relying on runtime download","Verify write permission on models/DAT","Monitor first-run downloads in connected environments"],"tags":["upscaler","dat","model-download","offline","stable-diffusion-webui"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}