Repository: stable-diffusion-webui
Issue: [Bug]: --subpath is broken
Labels: bug-report

### Is there an existing issue for this?

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

### What happened?

I'm using the packaged version 1.6.0:
```
version: v1.6.0 python: 3.10.6  •  torch: 2.0.1+cu118  •  xformers: 0.0.20  •  gradio: 3.41.2  •  checkpoint: [31e35c80fc]
```
I set `subpath` in `webui-user.bat`:
```bat
@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=--listen --xformers --update-check --enable-insecure-extension-access --subpath sdiff

call webui.bat
```
I've also tried hard-coding `root_path` here, which makes me wonder if this is a gradio issue?
> webui.py
```py
        app, local_url, share_url = shared.demo.launch(
            share=cmd_opts.share,
            server_name=initialize_util.gradio_server_name(),
            server_port=cmd_opts.port,
            ssl_keyfile=cmd_opts.tls_keyfile,
            ssl_certfile=cmd_opts.tls_certfile,
            ssl_verify=cmd_opts.disable_tls_verify,
            debug=cmd_opts.gradio_debug,
            auth=gradio_auth_creds,
            inbrowser=auto_launch_browser,
            prevent_thread_lock=True,
            allowed_paths=cmd_opts.gradio_allowed_path,
            app_kwargs={
                "docs_url": "/docs",
                "redoc_url": "/redoc",
            },
            root_path="/sdiff",
        )
```



### Steps to reproduce the problem

1. Launch webui
2. Note that it doesn't load on subpath
![image](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/704908/0f8d0aad-553c-42ff-a371-038c09aa4f7f)
3. On the root URL the webui shows but I can see it's attempting to load themes from the subpath
![image](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/704908/066170c5-13e9-4a3e-90d0-4cc3deb6b599)



### What should have happened?

UI should be accessible on `http://192.168.137.2:7860/sdiff` so that it can be proxied

### Sysinfo

[sysinfo-2023-09-20-14-05.txt](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/12674030/sysinfo-2023-09-20-14-05.txt)


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

Google Chrome

### Console logs

```Shell
≡][≡ .\run.bat
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
You are up to date with the most recent release.
Launching Web UI with arguments: --listen --xformers --update-check --enable-insecure-extension-access --subpath sdiff
Loading weights [31e35c80fc] from D:\SD\a1111\webui\models\Stable-diffusion\sd_xl_base_1.0.safetensors
Running on local URL:  http://0.0.0.0:7860
Creating model from config: D:\SD\a1111\webui\repositories\generative-models\configs\inference\sd_xl_base.yaml
Loading VAE weights found near the checkpoint: D:\SD\a1111\webui\models\VAE\sd_xl_base_1.0.safetensors
Applying attention optimization: xformers... done.

To create a public link, set `share=True` in `launch()`.
Startup time: 11.3s (prepare environment: 1.7s, import torch: 1.6s, import gradio: 0.4s, setup paths: 0.4s, initialize shared: 0.1s, other imports: 0.3s, load scripts: 1.4s, create ui: 0.9s, gradio launch: 4.2s).
Model loaded in 5.9s (load weights from disk: 1.2s, create model: 1.1s, apply weights to model: 2.5s, load VAE: 0.1s, calculate empty prompt: 0.8s).
```


### Additional information

_No response_