AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
131.69k stars 25.27k forks source link

[Bug]: Error loading specific Upscalers: "RuntimeError: PytorchStreamReader failed locating file constants.pkl: file not found" #15640

Open Soulreaver90 opened 3 weeks ago

Soulreaver90 commented 3 weeks ago

Checklist

What happened?

I receive a terminal error when trying to use specific upscalers. This is specifically through the Extra tab, I have not tried hires fix. I have no issues running 4x Ultrasharp, 4x NMKD, etc, however I cannot seem to run upscalers such as https://civitai.com/models/142699/8xnmkd-faces160000g-upscaler, https://civitai.com/models/292030/8xnmkd-superscale150000g?modelVersionId=328284 or https://civitai.com/models/318385/4xrealisticrescaler100000g?modelVersionId=357054

Steps to reproduce the problem

Copy any of the following to ESRGAN and try to upscale via Extra tab https://civitai.com/models/142699/8xnmkd-faces160000g-upscaler, https://civitai.com/models/292030/8xnmkd-superscale150000g?modelVersionId=328284 or https://civitai.com/models/318385/4xrealisticrescaler100000g?modelVersionId=357054

What should have happened?

Uspcale normally without error

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

sysinfo-2024-04-27-09-46.json

Console logs

*** Unable to load ESRGAN model /home/linux/stable-diffusion-webui/models/ESRGAN/4xRealisticrescaler_100000G.pt
    Traceback (most recent call last):
      File "/home/linux/stable-diffusion-webui/modules/esrgan_model.py", line 31, in do_upscale
        model = self.load_model(selected_model)
      File "/home/linux/stable-diffusion-webui/modules/esrgan_model.py", line 49, in load_model
        return modelloader.load_spandrel_model(
      File "/home/linux/stable-diffusion-webui/modules/modelloader.py", line 150, in load_spandrel_model
        model_descriptor = spandrel.ModelLoader(device=device).load_from_file(str(path))
      File "/home/linux/stable-diffusion-webui/venv/lib/python3.10/site-packages/spandrel/__helpers/loader.py", line 41, in load_from_file
        state_dict = self.load_state_dict_from_file(path)
      File "/home/linux/stable-diffusion-webui/venv/lib/python3.10/site-packages/spandrel/__helpers/loader.py", line 58, in load_state_dict_from_file
        state_dict = self._load_torchscript(path)
      File "/home/linux/stable-diffusion-webui/venv/lib/python3.10/site-packages/spandrel/__helpers/loader.py", line 89, in _load_torchscript
        return torch.jit.load(  # type: ignore
      File "/home/linux/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/jit/_serialization.py", line 159, in load
        cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files, _restore_shapes)  # type: ignore[call-arg]
    RuntimeError: PytorchStreamReader failed locating file constants.pkl: file not found

Additional information

No response

AlexysLovesLexxie commented 3 weeks ago

Same issue here, but with 4xUltrasharp_4xUltrasharpV10.pt My install is managed by StabilityMatrix, hence the odd paths.

*** Unable to load ESRGAN model D:\SM\Data\Packages\A1111_v1.9.3\models\ESRGAN\4xUltrasharp_4xUltrasharpV10.pt Traceback (most recent call last): File "D:\SM\Data\Packages\A1111_v1.9.3\modules\esrgan_model.py", line 31, in do_upscale model = self.load_model(selected_model) File "D:\SM\Data\Packages\A1111_v1.9.3\modules\esrgan_model.py", line 49, in load_model return modelloader.load_spandrel_model( File "D:\SM\Data\Packages\A1111_v1.9.3\modules\modelloader.py", line 150, in load_spandrel_model model_descriptor = spandrel.ModelLoader(device=device).load_from_file(str(path)) File "D:\SM\Data\Packages\A1111_v1.9.3\venv\lib\site-packages\spandrel\__helpers\loader.py", line 41, in load_from_file state_dict = self.load_state_dict_from_file(path) File "D:\SM\Data\Packages\A1111_v1.9.3\venv\lib\site-packages\spandrel\__helpers\loader.py", line 58, in load_state_dict_from_file state_dict = self._load_torchscript(path) File "D:\SM\Data\Packages\A1111_v1.9.3\venv\lib\site-packages\spandrel\__helpers\loader.py", line 89, in _load_torchscript return torch.jit.load( # type: ignore File "D:\SM\Data\Packages\A1111_v1.9.3\venv\lib\site-packages\torch\jit\_serialization.py", line 162, in load cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files, _restore_shapes) # type: ignore[call-arg] RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

yogiyushi commented 2 weeks ago

i can't seem to upscale anything 2048 x 2, it says 100% done but remains stuck still using 11.8 gb vram, did full reinstall still happening.