{"record":{"id":"228d868c0354890c","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"realesrgan-data-missing-scaler-local-data-path","errorCode":null,"errorMessage":"RealESRGAN data missing: {scaler.local_data_path}","messagePattern":"RealESRGAN data missing: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"modules/realesrgan_model.py","lineNumber":62,"sourceCode":"        )\r\n        return upscale_with_model(\r\n            model_descriptor,\r\n            img,\r\n            tile_size=opts.ESRGAN_tile,\r\n            tile_overlap=opts.ESRGAN_tile_overlap,\r\n            # TODO: `outscale`?\r\n        )\r\n\r\n    def load_model(self, path):\r\n        for scaler in self.scalers:\r\n            if scaler.data_path == path:\r\n                if scaler.local_data_path.startswith(\"http\"):\r\n                    scaler.local_data_path = modelloader.load_file_from_url(\r\n                        scaler.data_path,\r\n                        model_dir=self.model_download_path,\r\n                    )\r\n                if not os.path.exists(scaler.local_data_path):\r\n                    raise FileNotFoundError(f\"RealESRGAN data missing: {scaler.local_data_path}\")\r\n                return scaler\r\n        raise ValueError(f\"Unable to find model info: {path}\")\r\n\r\n\r\ndef get_realesrgan_models(scaler: UpscalerRealESRGAN):\r\n    return [\r\n        UpscalerData(\r\n            name=\"R-ESRGAN General 4xV3\",\r\n            path=\"https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth\",\r\n            scale=4,\r\n            upscaler=scaler,\r\n        ),\r\n        UpscalerData(\r\n            name=\"R-ESRGAN General WDN 4xV3\",\r\n            path=\"https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth\",\r\n            scale=4,\r\n            upscaler=scaler,\r\n        ),\r","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/realesrgan_model.py#L44-L80","documentation":"UpscalerRealESRGAN.load_model first downloads the scaler's data_path if it is a URL; then it requires scaler.local_data_path to exist on disk. If the file is still missing after download (failed download silently left no file, or a local path entry points nowhere), FileNotFoundError is raised.","triggerScenarios":"Selecting a RealESRGAN upscaler whose .pth weights: (a) failed to download from GitHub (offline, blocked, proxy), or (b) were configured with a local path that does not exist.","commonSituations":"First use of 'R-ESRGAN 4x+' on machines without GitHub access; partial download left zero-byte/deleted file; models/RealESRGAN directory moved or on an unmounted volume.","solutions":["Manually place the RealESRGAN weights (e.g. realesr-general-x4v3.pth, RealESRGAN_x4plus.pth) into models/RealESRGAN with the expected filename.","Check network access to github.com releases (or set HTTPS_PROXY) and retry so load_file_from_url completes.","Verify the expected local_data_path in the error message and make sure that directory exists and is writable."],"exampleFix":"# shell: place the weight file the scaler expects\nmkdir -p models/RealESRGAN\ncurl -L -o models/RealESRGAN/RealESRGAN_x4plus.pth \\\n  https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth","handlingStrategy":"validation","validationCode":"import os\n\ndef realesrgan_ready(scaler):\n    if scaler.local_data_path.startswith('http'):\n        return True  # will be downloaded; ensure network instead\n    return os.path.exists(scaler.local_data_path)\n\nfor s in upscaler.scalers:\n    if s.data_path == wanted and not realesrgan_ready(s):\n        raise SystemExit('RealESRGAN weights missing; download them into models/RealESRGAN')","typeGuard":null,"tryCatchPattern":"try:\n    scaler = upscaler.load_model(path)\nexcept FileNotFoundError as e:\n    # weights failed to appear after download attempt; fetch manually then retry once\n    download_realesrgan_weights(expected_local_path)\n    scaler = upscaler.load_model(path)","preventionTips":["Pre-download RealESRGAN .pth files into models/RealESRGAN during environment setup.","Verify network reachability to github.com releases in offline-ish deployments."],"tags":["realesrgan","upscaler","model-files","download"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}