Repository: stable-diffusion-webui
Issue: [Bug]: unable to save checkpoint preview pictures when model is in symlink folder
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?

See #7266. Same symptom, but on the Checkpoints tab

### Steps to reproduce the problem

1. create folder for models as in example below
2. generate any image
3. open checkpoints tab
4. hover over one of them and click replace preview
5. image is not replaced and error appears in console

My example folder layout


```
d:
  /stable-diffusion
    /models
      /stable-diffusion<- symlink source
   /auto <- sd-ui main folder
    /models
      /stable-diffusion<- symlink destination
```

### What should have happened?

pic should be replaced



### Commit where the problem happens

ea9bd9f

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

Windows, iOS, Android

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

Google Chrome

### Command Line Arguments

```Shell
set COMMANDLINE_ARGS=--listen --enable-insecure-extension-access --deepdanbooru --no-half --api --xformers
```


### List of extensions


a1111-sd-webui-haku-img
a1111-sd-webui-tagcomplete
animator_extension
asymmetric-tiling-sd-webui
custom-diffusion-webui
deforum-for-automatic1111-webui
depthmap2mask
gif2gif
model-keyword
multi-subject-render
openOutpaint-webUI-extension
prompt-fusion-extension
sd_smartprocess
sd-dynamic-thresholding
sd-extension-steps-animation
sd-extension-system-info
sd-webui-ar
seed_travel
shift-attention
stable-diffusion-webui-anti-burn
stable-diffusion-webui-auto-tls-https
stable-diffusion-webui-depthmap-script
stable-diffusion-webui-images-browser
stable-diffusion-webui-model-toolkit
stable-diffusion-webui-Prompt_Generator
stable-diffusion-webui-prompt-travel
stable-diffusion-webui-promptgen
stable-diffusion-webui-randomize
stable-diffusion-webui-sonar
StylePile
ultimate-upscale-for-automatic1111


### Console logs

```Shell
Traceback (most recent call last):
  File "D:\hal\stable-diffusion\auto\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\hal\stable-diffusion\auto\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "D:\hal\stable-diffusion\auto\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\hal\stable-diffusion\auto\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\hal\stable-diffusion\auto\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "D:\hal\stable-diffusion\auto\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "D:\hal\stable-diffusion\auto\modules\ui_extra_networks.py", line 233, in save_preview
    assert is_allowed, f'writing to {filename} is not allowed'
AssertionError: writing to D:\hal\stable-diffusion\auto\models\stable-diffusion\experience_exp65.png is not allowed
```


### Additional information

_No response_