Repository: stable-diffusion-webui
Issue: [Bug]: Error when using symlinks instead of model files
Labels: asking-for-help-with-local-system-issues

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

I have created symlinks to the model files in the models directory, instead of copying the model files there. When I load such a model, there is an error, although image creation seems to work fine.

### Steps to reproduce the problem

1. On MacOS, go to Terminal and create a symlink to the model file by using this command (adapt paths): `ln -s /Users/myusername/Desktop/artErosAerosATribute_aerosNovae.safetensors /Users/myusername/stable-diffusion-webui/models/Stable-diffusion/artErosAerosATribute_aerosNovae.safetensors`
2. (Re)Start the WebUI.
3. Load the model.
4. Look at the Terminal.

### What should have happened?

There should not have been an error message in the Terminal.

### Commit where the problem happens

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/3715ece0adce7bf7c5e9c5ab3710b2fdc3848f39

### What platforms do you use to access the UI ?

MacOS

### What browsers do you use to access the UI ?

Mozilla Firefox

### Command Line Arguments

```Shell
Launching Web UI with arguments: --upcast-sampling --no-half-vae --use-cpu interrogate
```


### List of extensions

stable-diffusion-webui-images-browser

### Console logs

```Shell
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/Users/myusername/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 402, in predict
    if app.get_blocks().dependencies[fn_index_inferred]["cancels"]:
IndexError: list index out of range
Loading weights [8e44077b7b] from /Users/myusername/stable-diffusion-webui/models/Stable-diffusion/artErosAerosATribute_aerosNovae.safetensors
Loading VAE weights found near the checkpoint: /Users/myusername/stable-diffusion-webui/models/Stable-diffusion/artErosAerosATribute_aerosNovae.vae.pt
Applying cross attention optimization (InvokeAI).
Weights loaded in 6.2s (apply weights to model: 4.6s, load VAE: 0.3s, move model to device: 1.2s).

```


### Additional information

_No response_