Repository: stable-diffusion-webui
Issue: [Bug]: UnpicklingError when loading sd_model_checkpoint
Labels: bug-report,platform:mac

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

When I try to load ckpt files from civit.ai, unpickling error happens. 
I tried with realisticvision.ckpt from [civit.ai](https://civitai.com/models/4201/realistic-vision-v20).
I downloaded the same model for several times, but failed to load.



### Steps to reproduce the problem

1. Go to .... webui main page, download realisticvision.ckpt from civit.ai
2. Press .... load realisticvision.ckpt on sd_model_checkpoint tab
3. ... check if the model (ckpt) loaded.


### What should have happened?

The model should be loaded and the webui show that the model loaded

### Commit where the problem happens

a9fed7c364061ae6efb37f797b6b522cb3cf7aa2

### What platforms do you use to access the UI ?

MacOS

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

```Shell
No
```


### List of extensions

Image broswer
wd tagger
checkpoint merger

### Console logs

```Shell
To create a public link, set `share=True` in `launch()`.
Startup time: 90.3s (import gradio: 4.4s, import ldm: 2.0s, other imports: 6.9s, setup codeformer: 0.1s, load scripts: 6.5s, load SD checkpoint: 18.7s, create ui: 50.3s, gradio launch: 1.1s, scripts app_started_callback: 0.1s).
Loading weights [81086e2b3f] from /kwangjin/stable-diffusion-webui/models/Stable-diffusion/civit-ai/realisticvision/realisticvision.ckpt
Loading VAE weights found near the checkpoint: /kwangjin/stable-diffusion-webui/models/Stable-diffusion/civit-ai/realisticvision/realisticvision.vae.pt
Failed to load checkpoint, restoring previous
Loading weights [af6639dad8] from /kwangjin/stable-diffusion-webui/models/Stable-diffusion/anythingv3/Anything-V3.0.ckpt
Loading VAE weights found near the checkpoint: /kwangjin/stable-diffusion-webui/models/Stable-diffusion/anythingv3/Anything-V3.0.vae.pt
Applying cross attention optimization (Doggettx).
changing setting sd_model_checkpoint to civit-ai/realisticvision/realisticvision.ckpt [81086e2b3f]: UnpicklingError
Traceback (most recent call last):
  File "/kwangjin/stable-diffusion-webui/modules/shared.py", line 568, in set
    self.data_labels[key].onchange()
  File "/kwangjin/stable-diffusion-webui/modules/call_queue.py", line 15, in f
    res = func(*args, **kwargs)
  File "/kwangjin/stable-diffusion-webui/webui.py", line 146, in <lambda>
    shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()))
  File "/kwangjin/stable-diffusion-webui/modules/sd_models.py", line 501, in reload_model_weights
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "/kwangjin/stable-diffusion-webui/modules/sd_models.py", line 329, in load_model_weights
    sd_vae.load_vae(model, vae_file, vae_source)
  File "/kwangjin/stable-diffusion-webui/modules/sd_vae.py", line 145, in load_vae
    vae_dict_1 = load_vae_dict(vae_file, map_location=shared.weight_load_location)
  File "/kwangjin/stable-diffusion-webui/modules/sd_vae.py", line 123, in load_vae_dict
    vae_ckpt = sd_models.read_state_dict(filename, map_location=map_location)
  File "/kwangjin/stable-diffusion-webui/modules/sd_models.py", line 243, in read_state_dict
    pl_sd = torch.load(checkpoint_file, map_location=map_location or shared.weight_load_location)
  File "/kwangjin/stable-diffusion-webui/modules/safe.py", line 106, in load
    return load_with_extra(filename, extra_handler=global_extra_handler, *args, **kwargs)
  File "/kwangjin/stable-diffusion-webui/modules/safe.py", line 151, in load_with_extra
    return unsafe_torch_load(filename, *args, **kwargs)
  File "/opt/conda/envs/webui_kj/lib/python3.10/site-packages/torch/serialization.py", line 795, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/opt/conda/envs/webui_kj/lib/python3.10/site-packages/torch/serialization.py", line 1002, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'z'.
```


### Additional information

_No response_