Repository: stable-diffusion-webui
Issue: [Bug]:  Exception in ASGI application UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed
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?

WebUI can't boot after updating pip packages

### Steps to reproduce the problem

Just boot the WebUI

### What should have happened?

it should run properly

### Version or Commit where the problem happens

Version: v1.5.0-RC-2-gb010eea5 Commit hash: b010eea520caa90d2a31d98ec7c4a9d9d540c9ad

### What Python version are you running on ?

Python 3.10.x

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

Linux

### What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

### Cross attention optimization

xformers

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

Google Chrome

### Command Line Arguments

```Shell
--xformers --listen
```


### List of extensions

![捕获](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/69417329/50c56d3c-0d89-4879-8ebe-1431ea08a518)


### Console logs

```Shell
Python 3.10.12 (main, Jul  5 2023, 18:54:27) [GCC 11.2.0]
Version: v1.5.0-RC-2-gb010eea5
Commit hash: b010eea520caa90d2a31d98ec7c4a9d9d540c9ad
Installing requirements
current transparent-background 1.2.4



Launching Web UI with arguments: --listen --xformers
2023-07-20 12:54:51.078564: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-07-20 12:54:51.237298: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-20 12:54:51.675238: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-07-20 12:54:51.675746: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-07-20 12:54:56.232608: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
[AddNet] Updating model hashes...
100%|████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 4829.37it/s]
[AddNet] Updating model hashes...
100%|████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 6517.95it/s]
2023-07-20 12:55:20,086 - ControlNet - INFO - ControlNet v1.1.232
ControlNet preprocessor location: /root/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2023-07-20 12:55:20,241 - ControlNet - INFO - ControlNet v1.1.232
Loading weights [a87b878480] from /root/stable-diffusion-webui/models/Stable-diffusion/bakProjecto_v10.ckpt
Creating model from config: /root/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying attention optimization: xformers... done.
Model loaded in 5.3s (load weights from disk: 2.2s, create model: 0.5s, apply weights to model: 0.4s, apply half(): 0.2s, move model to device: 0.6s, load textual inversion embeddings: 1.0s, calculate empty prompt: 0.3s).
ERROR:    Exception in ASGI application
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 262, in main
    return templates.TemplateResponse(
  File "/root/stable-diffusion-webui/modules/ui_gradio_extensions.py", line 59, in template_response
    res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 113, in TemplateResponse
    return _TemplateResponse(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 39, in __init__
    content = template.render(context)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/templates/frontend/index.html", line 41, in top-level template code
    <script>window.gradio_config = {{ config | toorjson }};</script>
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 84, in toorjson
    ORJSONResponse._render_str(value)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 79, in _render_str
    return ORJSONResponse._render(content).decode("utf-8")
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 68, in _render
    return orjson.dumps(
TypeError: str is not valid UTF-8: surrogates not allowed
ERROR:    Exception in ASGI application
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 262, in main
    return templates.TemplateResponse(
  File "/root/stable-diffusion-webui/modules/ui_gradio_extensions.py", line 59, in template_response
    res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 113, in TemplateResponse
    return _TemplateResponse(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 39, in __init__
    content = template.render(context)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/templates/frontend/index.html", line 41, in top-level template code
    <script>window.gradio_config = {{ config | toorjson }};</script>
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 84, in toorjson
    ORJSONResponse._render_str(value)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 79, in _render_str
    return ORJSONResponse._render(content).decode("utf-8")
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 68, in _render
    return orjson.dumps(
TypeError: str is not valid UTF-8: surrogates not allowed
ERROR:    Exception in ASGI application
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 262, in main
    return templates.TemplateResponse(
  File "/root/stable-diffusion-webui/modules/ui_gradio_extensions.py", line 59, in template_response
    res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 113, in TemplateResponse
    return _TemplateResponse(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 39, in __init__
    content = template.render(context)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/templates/frontend/index.html", line 41, in top-level template code
    <script>window.gradio_config = {{ config | toorjson }};</script>
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 84, in toorjson
    ORJSONResponse._render_str(value)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 79, in _render_str
    return ORJSONResponse._render(content).decode("utf-8")
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 68, in _render
    return orjson.dumps(
TypeError: str is not valid UTF-8: surrogates not allowed
ERROR:    Exception in ASGI application
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 262, in main
    return templates.TemplateResponse(
  File "/root/stable-diffusion-webui/modules/ui_gradio_extensions.py", line 59, in template_response
    res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 113, in TemplateResponse
    return _TemplateResponse(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 39, in __init__
    content = template.render(context)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/templates/frontend/index.html", line 41, in top-level template code
    <script>window.gradio_config = {{ config | toorjson }};</script>
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 84, in toorjson
    ORJSONResponse._render_str(value)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 79, in _render_str
    return ORJSONResponse._render(content).decode("utf-8")
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 68, in _render
    return orjson.dumps(
TypeError: str is not valid UTF-8: surrogates not allowed
ERROR:    Exception in ASGI application
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 262, in main
    return templates.TemplateResponse(
  File "/root/stable-diffusion-webui/modules/ui_gradio_extensions.py", line 59, in template_response
    res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 113, in TemplateResponse
    return _TemplateResponse(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/starlette/templating.py", line 39, in __init__
    content = template.render(context)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/templates/frontend/index.html", line 41, in top-level template code
    <script>window.gradio_config = {{ config | toorjson }};</script>
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 84, in toorjson
    ORJSONResponse._render_str(value)
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 79, in _render_str
    return ORJSONResponse._render(content).decode("utf-8")
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/routes.py", line 68, in _render
    return orjson.dumps(
TypeError: str is not valid UTF-8: surrogates not allowed
Traceback (most recent call last):
  File "/root/stable-diffusion-webui/launch.py", line 39, in <module>
    main()
  File "/root/stable-diffusion-webui/launch.py", line 35, in main
    start()
  File "/root/stable-diffusion-webui/modules/launch_utils.py", line 394, in start
    webui.webui()
  File "/root/stable-diffusion-webui/webui.py", line 401, in webui
    app, local_url, share_url = shared.demo.launch(
  File "/root/anaconda3/envs/sdwebui/lib/python3.10/site-packages/gradio/blocks.py", line 1809, in launch
    raise ValueError(
ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost.
```


### Additional information

_No response_