Repository: stable-diffusion-webui
Issue: [Bug]: SendTo functionality is partially 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?

Past parameters of image generations cannot be "sent" to the txt2img or img2img now:

![image](https://user-images.githubusercontent.com/55754730/215292675-8ab4e4e2-7cc5-4a5c-b1b2-3ce7b29d73ad.png)

This is accompanied by:

```
Traceback (most recent call last):
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 297, in paste_func
    params = parse_generation_parameters(prompt)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 264, in parse_generation_parameters
    v = v[1:-1] if v[0] == '"' and v[-1] == '"' else v
IndexError: string index out of range
Traceback (most recent call last):
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 297, in paste_func
    params = parse_generation_parameters(prompt)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 264, in parse_generation_parameters
    v = v[1:-1] if v[0] == '"' and v[-1] == '"' else v
IndexError: string index out of range
```
(I did it once for txt2img and img2img, from Image Browser, but the "previous session restore" also ends up like this, unless last WebUI session was "empty".


### Steps to reproduce the problem

1. Go to Image Browser or use "Paste" from last non-empty session of WebUI.
2. Press SentTo (txt2img or img2img)
3. Profit? Nope. 🙂 


### What should have happened?

Parameters of the generation should "land" into the respective places.

### Commit where the problem happens

0a8515085ef258d4b76fdc000f7ed9d55751d6b8

### What platforms do you use to access the UI ?

Windows

### What browsers do you use to access the UI ?

Microsoft Edge

### Command Line Arguments

```Shell
@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set TMP=X:\AI\TEMP
set TEMP=X:\AI\TEMP
set SAFETENSORS_FAST_GPU=1
REM set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.6,max_split_size_mb:24
set COMMANDLINE_ARGS=--xformers --api --deepdanbooru
```


### List of extensions

ABG_extension | https://github.com/KutsuyaYuki/ABG_extension.git | Loading...
DiffusionDefender | https://github.com/WildBanjos/DiffusionDefender.git | Loading...
DreamArtist-sd-webui-extension | https://github.com/7eu7d7/DreamArtist-sd-webui-extension.git | Loading...
Hypernetwork-MonkeyPatch-Extension | https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension | Loading...
PromptGallery-stable-diffusion-webui | https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git | Loading...
SD-latent-mirroring | https://github.com/dfaker/SD-latent-mirroring | Loading...
StylePile | https://github.com/some9000/StylePile | Loading...
Umi-AI | https://github.com/Klokinator/Umi-AI | Loading...
a1111-sd-webui-haku-img | https://github.com/KohakuBlueleaf/a1111-sd-webui-haku-img.git | Loading...
~~a1111-sd-webui-tagcomplete | https://github.com/DominikDoom/a1111-sd-webui-tagcomplete | Loading...~~
~~asymmetric-tiling-sd-webui | https://github.com/tjm35/asymmetric-tiling-sd-webui.git | Loading...~~
booru2prompt | https://github.com/Malisius/booru2prompt.git | Loading...
custom-diffusion-webui | https://github.com/guaneec/custom-diffusion-webui.git | Loading...
ddetailer | https://github.com/dustysys/ddetailer.git | Loading...
embedding-inspector | https://github.com/tkalayci71/embedding-inspector.git | Loading...
model-keyword | https://github.com/mix1009/model-keyword | Loading...
multi-subject-render | https://github.com/Extraltodeus/multi-subject-render.git | Loading...
novelai-2-local-prompt | https://github.com/animerl/novelai-2-local-prompt | Loading...
prompt-fusion-extension | https://github.com/ljleb/prompt-fusion-extension.git | Loading...
sd-dynamic-prompts | https://github.com/adieyal/sd-dynamic-prompts | Loading...
~~sd-extension-steps-animation | https://github.com/vladmandic/sd-extension-steps-animation | Loading...~~
sd-extension-system-info | https://github.com/vladmandic/sd-extension-system-info | Loading...
sd-infinity-grid-generator-script | https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script.git | Loading...
sd-webui-additional-networks | https://github.com/kohya-ss/sd-webui-additional-networks.git | Loading...
sd-webui-gelbooru-prompt | https://github.com/antis0007/sd-webui-gelbooru-prompt.git | Loading...
sd-webui-model-converter | https://github.com/Akegarasu/sd-webui-model-converter | Loading...
sd-webui-multiple-hypernetworks | https://github.com/antis0007/sd-webui-multiple-hypernetworks.git | Loading...
sd_dreambooth_extension | https://github.com/d8ahazard/sd_dreambooth_extension | Loading...
sd_save_intermediate_images | https://github.com/AlUlkesh/sd_save_intermediate_images | Loading...
sdweb-merge-block-weighted-gui | https://github.com/bbc-mc/sdweb-merge-block-weighted-gui | Loading...
sdweb-merge-board | https://github.com/bbc-mc/sdweb-merge-board.git | Loading...
seed_travel | https://github.com/yownas/seed_travel.git | Loading...
shift-attention | https://github.com/yownas/shift-attention.git | Loading...
stable-diffusion-webui-Prompt_Generator | https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator | Loading...
stable-diffusion-webui-aesthetic-gradients | https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients | Loading...
stable-diffusion-webui-aesthetic-image-scorer | https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer | Loading...
stable-diffusion-webui-artists-to-study | https://github.com/camenduru/stable-diffusion-webui-artists-to-study | Loading...
stable-diffusion-webui-cafe-aesthetic | https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic.git | Loading...
stable-diffusion-webui-conditioning-highres-fix | https://github.com/klimaleksus/stable-diffusion-webui-conditioning-highres-fix.git | Loading...
stable-diffusion-webui-daam | https://github.com/kousw/stable-diffusion-webui-daam.git | Loading...
stable-diffusion-webui-dataset-tag-editor | https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor | Loading...
stable-diffusion-webui-embedding-editor | https://github.com/CodeExplode/stable-diffusion-webui-embedding-editor.git | Loading...
stable-diffusion-webui-images-browser | https://github.com/yfszzx/stable-diffusion-webui-images-browser | Loading...
stable-diffusion-webui-inspiration | https://github.com/yfszzx/stable-diffusion-webui-inspiration | Loading...
stable-diffusion-webui-instruct-pix2pix | https://github.com/Klace/stable-diffusion-webui-instruct-pix2pix.git | Loading...
stable-diffusion-webui-pixelization | https://github.com/AUTOMATIC1111/stable-diffusion-webui-pixelization.git | Loading...
stable-diffusion-webui-prompt-travel | https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel.git | Loading...
stable-diffusion-webui-promptgen | https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen | Loading...
stable-diffusion-webui-randomize | https://github.com/innightwolfsleep/stable-diffusion-webui-randomize | Loading...
stable-diffusion-webui-sonar | https://github.com/Kahsolt/stable-diffusion-webui-sonar | Loading...
stable-diffusion-webui-tokenizer | https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer.git | Loading...
stable-diffusion-webui-visualize-cross-attention-extension | https://github.com/benkyoujouzu/stable-diffusion-webui-visualize-cross-attention-extension.git | Loading...
stable-diffusion-webui-wd14-tagger | https://github.com/toriato/stable-diffusion-webui-wd14-tagger.git | Loading...
~~stable-diffusion-webui-wildcards | https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards | Loading...~~
training-picker | https://github.com/Maurdekye/training-picker | Loading...
ultimate-upscale-for-automatic1111 | https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git | Loading...
~~unprompted | https://github.com/ThereforeGames/unprompted | Loading...~~
LDSR | built-in |  
Lora | built-in |  
ScuNET | built-in |  
SwinIR | built-in |  
prompt-bracket-checker | built-in

### Console logs

```Shell
venv "x:\AI\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Commit hash: 0a8515085ef258d4b76fdc000f7ed9d55751d6b8
Installing requirements for Web UI
Installing requirements for Anime Background Remover
Installing requirements for Anime Background Remover
Installing requirements for Anime Background Remover

Installing requirements for scikit_learn


Installing requirements for Prompt Gallery

Installing sd-dynamic-prompts requirements.txt




#######################################################################################################
Initializing Dreambooth
If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Dreambooth revision: 9f4d931a319056c537d24669cb950d146d1537b0
SD-WebUI revision: 0a8515085ef258d4b76fdc000f7ed9d55751d6b8

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[+] xformers version 0.0.16rc425 installed.
[+] torch version 1.13.1+cu117 installed.
[+] torchvision version 0.14.1+cu117 installed.

#######################################################################################################



Installing requirements for dataset-tag-editor [onnxruntime-gpu]




Launching Web UI with arguments: --xformers --api --deepdanbooru
Loading booru2prompt settings
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
Hypernetwork-MonkeyPatch-Extension found!
SD-Webui API layer loaded
Installing pywin32
Error loading script: training_picker.py
Traceback (most recent call last):
  File "x:\AI\stable-diffusion-webui\modules\scripts.py", line 229, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "x:\AI\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "x:\AI\stable-diffusion-webui\extensions\training-picker\scripts\training_picker.py", line 16, in <module>
    from modules.ui import create_refresh_button, folder_symbol
ImportError: cannot import name 'folder_symbol' from 'modules.ui' (x:\AI\stable-diffusion-webui\modules\ui.py)

Loading weights [4e4457c771] from x:\AI\sd_v1-5_vae.ckpt
Creating model from config: x:\AI\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: x:\AI\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(xxx): 1man, 2000ccplus, 3N1DS1NCL41R , 80s-anime-ai-being, 80s-anime-ai, 80s-car, albino_style, andava, ao_style-7500, ao_style, art by Smoose2, ...
Textual inversion embeddings skipped(xxx): AnalogFilm768-BW-Classic, AnalogFilm768-BW-Modern, AnalogFilm768-BW-Tintype, AnalogFilm768-BW-Vintage, AnalogFilm768-Old-School, AnalogFilm768, Apoc768, Art by Smoose-22, art by Smoose22, ...
Model loaded in 5.0s (create model: 0.5s, apply weights to model: 0.7s, apply half(): 0.6s, load VAE: 0.1s, move model to device: 0.9s, load textual inversion embeddings: 2.0s).
Textual inversion embeddings loaded(0):
Textual inversion embeddings loaded(0):
INFO:     Started server process [23800]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://localhost:5173 (Press CTRL+C to quit)
INFO:     ::1:18771 - "GET / HTTP/1.1" 200 OK
add tab
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Traceback (most recent call last):
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 297, in paste_func
    params = parse_generation_parameters(prompt)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 264, in parse_generation_parameters
    v = v[1:-1] if v[0] == '"' and v[-1] == '"' else v
IndexError: string index out of range
Traceback (most recent call last):
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "x:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 297, in paste_func
    params = parse_generation_parameters(prompt)
  File "x:\AI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 264, in parse_generation_parameters
    v = v[1:-1] if v[0] == '"' and v[-1] == '"' else v
IndexError: string index out of range
```


### Additional information

_No response_