Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
17.02k stars 1.96k forks source link

"RuntimeError: PytorchStreamReader failed reading file data/25: invalid header or archive is corrupted" in A1111 #2566

Closed richardlampitt closed 9 months ago

richardlampitt commented 9 months ago

Hello,

I've been trying to get ControlNet to function in A1111, but regardless of what I'm trying to do it always returns this error:

2024-01-23 22:40:49,817 - ControlNet - INFO - unit_separate = False, style_align = False
2024-01-23 22:40:50,253 - ControlNet - INFO - Loading model: control_sd15_openpose [fef5e48e]
*** Error running process: D:\ai\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\ai\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\ai\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1117, in process
        self.controlnet_hack(p)
      File "D:\ai\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1102, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\ai\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 882, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\ai\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 343, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\ai\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 371, in build_control_model
        state_dict = load_state_dict(model_path)
      File "D:\ai\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 21, in load_state_dict
        state_dict = unsafe_torch_load(ckpt_path, map_location=torch.device(location))
      File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 712, in load
        return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
      File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 1049, in _load
        result = unpickler.load()
      File "D:\Program Files\Python310\lib\pickle.py", line 1213, in load
        dispatch[key[0]](self)
      File "D:\Program Files\Python310\lib\pickle.py", line 1254, in load_binpersid
        self.append(self.persistent_load(pid))
      File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 1019, in persistent_load
        load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
      File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 997, in load_tensor
        storage = zip_file.get_storage_from_record(name, numel, torch._UntypedStorage).storage()._untyped()
    RuntimeError: PytorchStreamReader failed reading file data/25: invalid header or archive is corrupted

I've already updated A1111 to 1.7.0, and I have uninstalled and reinstalled ControlNet twice, but still no luck.

Please advise.

huchenlei commented 9 months ago

Please try download ControlNet model control_sd15_openpose again. The model file is corrupted according to the error message.

richardlampitt commented 9 months ago

Please try download ControlNet model control_sd15_openpose again. The model file is corrupted according to the error message.

I had downloaded the model once more to be certain. However, I did finally manage to get it working with the control_v11p_sd15_openpose.pht model.

Thanks for the response!