lllyasviel / ControlNet

Let us control diffusion models!
Apache License 2.0
30.67k stars 2.75k forks source link

A1111 UI :: RuntimeError: PytorchStreamReader failed reading file data/25: invalid header or archive is corrupted #630

Open richardlampitt opened 10 months ago

richardlampitt commented 10 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.

richardlampitt commented 10 months ago

For those coming from search engines and/or ChatGPT - I finally managed to get ControlNet working using the control_v11p_sd15_openpose.pht model.