AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
140.7k stars 26.62k forks source link

[Bug]: Unable to read generation parameters #11000

Closed RykeWollf closed 1 year ago

RykeWollf commented 1 year ago

Is there an existing issue for this?

What happened?

Hi all, as the title implies SD is unable to read generation parameters.

I switched PC's recently and while I did have some issues getting everything back up and running, this one seems to be rather annoying that I haven't managed to solve.

Please do let me know what details you need from me, I'm rather noob at this so I must apologise for not being able to solve what might be an easy thing.

Apologies for the poorly formatted extensions. I truly am new to this.

Heres is the error:

Traceback (most recent call last): File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 414, in run_predict output = await app.get_blocks().process_api( File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api result = await self.call_function( File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function prediction = await anyio.to_thread.run_sync( File "D:\STABLEAI\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 "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "D:\STABLEAI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 373, in paste_func params = parse_generation_parameters(prompt) File "D:\STABLEAI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 272, in parse_generation_parameters if v[0] == '"' and v[-1] == '"': IndexError: string index out of range

Steps to reproduce the problem

  1. Go to image browser extension or place generation data in txt2img prompt
  2. Press read generation data blue icon

What should have happened?

SD should read generation data either imported from Image Browser extension or via the copied generation data in txt2img prompt box.

Commit where the problem happens

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/b6af0a3809ea869fb180633f9affcae4b199ffcf

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--no-half-vae --xformers
git pull
git submodule update

List of extensions

Extension | URL | Branch | Version | Date | Update -- | -- | -- | -- | -- | --  Extension URL Branch Version Date Update ABG_extension https://github.com/KutsuyaYuki/ABG_extension.git main [4224dc32](https://github.com/KutsuyaYuki/ABG_extension/commit/4224dc3209f9e8c945e036bf0e520eb8c95a009e) Sat Apr 1 12:58:10 2023 unknown AdverseCleanerExtension https://github.com/gogodr/AdverseCleanerExtension main [fb825c8c](https://github.com/gogodr/AdverseCleanerExtension/commit/fb825c8c8f391b06f977deeb8808e7db759dfd87) Sat Apr 1 23:59:42 2023 unknown Config-Presets https://github.com/Zyin055/Config-Presets main [1b952e26](https://github.com/Zyin055/Config-Presets/commit/1b952e263563605cd9d3d66c5fc02ada4a245ad6) Tue Mar 7 03:53:07 2023 unknown PromptGallery-stable-diffusion-webui https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git main [5dc830c7](https://github.com/dr413677671/PromptGallery-stable-diffusion-webui/commit/5dc830c707e4b99147e117fe3e76201d415dfc3e) Sun Mar 12 14:47:48 2023 unknown SD-Prompt-Enhancer https://github.com/corbin-hayden13/SD-Prompt-Enhancer main [e3f0aea3](https://github.com/corbin-hayden13/SD-Prompt-Enhancer/commit/e3f0aea3eb6203ef49a4496245d7c4f0c3263183) Thu Jun 1 18:36:01 2023 unknown Stable-Diffusion-Webui-Civitai-Helper https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper main [ea6e121f](https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper/commit/ea6e121f8050a00a1ca4f5750f5376ca57f089ed) Wed Apr 5 19:58:06 2023 unknown a1111-sd-webui-locon https://github.com/KohakuBlueleaf/a1111-sd-webui-locon main [161ba405](https://github.com/KohakuBlueleaf/a1111-sd-webui-locon/commit/161ba4053943ca2e0793835a87b2049e574c7634) Fri May 26 16:01:42 2023 unknown a1111-sd-webui-lycoris https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris main [b0d24ca6](https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris/commit/b0d24ca645b6a5cb9752169691a1c6385c6fe6ae) Wed May 17 00:19:32 2023 unknown a1111-sd-webui-tagcomplete https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git main [223abf54](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/commit/223abf54206ee544bce04b95f993e150da21e802) Wed Apr 5 11:05:44 2023 unknown ddetailer https://github.com/dustysys/ddetailer master [22a17414](https://github.com/dustysys/ddetailer/commit/22a17414bbca1fa4681d427b8aae5f970d17e896) Mon Nov 28 09:33:31 2022 unknown kitchen-theme https://github.com/canisminor1990/sd-web-ui-kitchen-theme main [9509e3d6](https://github.com/canisminor1990/sd-web-ui-kitchen-theme/commit/9509e3d6eb202f2d9439603ec10da0c0ade64779) Sat Mar 4 15:47:29 2023 unknown loopback_scaler https://github.com/Elldreth/loopback_scaler.git main [79788ab9](https://github.com/Elldreth/loopback_scaler/commit/79788ab9ebfa8a66919343fbe1bb891298bccecd) Thu Mar 23 07:04:06 2023 unknown model-keyword https://github.com/mix1009/model-keyword main [1395d455](https://github.com/mix1009/model-keyword/commit/1395d455736bfd9037002fd67bab0680041289d3) Thu Apr 6 06:00:23 2023 unknown openOutpaint-webUI-extension https://github.com/zero01101/openOutpaint-webUI-extension.git main [acf83abe](https://github.com/zero01101/openOutpaint-webUI-extension/commit/acf83abe0bee1357edface3ea7a2c78408a123ec) Wed Apr 5 22:03:08 2023 unknown openpose-editor https://github.com/fkunn1326/openpose-editor master [a63fefc3](https://github.com/fkunn1326/openpose-editor/commit/a63fefc31701ad1a70c4954b8279bf3ca598dd76) Thu Mar 30 08:11:41 2023 unknown sd-dynamic-thresholding https://github.com/mcmonkeyprojects/sd-dynamic-thresholding master [8f18058b](https://github.com/mcmonkeyprojects/sd-dynamic-thresholding/commit/8f18058bf6d061f64047c1babab57e2293d3d1e3) Mon Mar 27 19:50:18 2023 unknown sd-webui-ar https://github.com/alemelis/sd-webui-ar.git main [4ac84484](https://github.com/alemelis/sd-webui-ar/commit/4ac84484cd2d5cbf1a305872cdbc798c4550af12) Thu Mar 30 19:42:57 2023 unknown sd-webui-aspect-ratio-helper https://github.com/thomasasfk/sd-webui-aspect-ratio-helper.git main [c4274cb8](https://github.com/thomasasfk/sd-webui-aspect-ratio-helper/commit/c4274cb84fe3c9e1e94df4fdea8fe48d1ecb65c1) Sat Apr 1 22:17:19 2023 unknown sd-webui-controlnet https://github.com/Mikubill/sd-webui-controlnet main [241c05f8](https://github.com/Mikubill/sd-webui-controlnet/commit/241c05f8c9d3c5abe637187e3c4bb46f17447029) Thu Mar 23 15:18:35 2023 unknown sd-webui-llul https://github.com/hnmr293/sd-webui-llul.git master [9123f098](https://github.com/hnmr293/sd-webui-llul/commit/9123f0983148f812799346a250c6a72e6eb414e7) Sat Apr 1 12:52:42 2023 unknown sd-webui-neutral-prompt https://github.com/ljleb/sd-webui-neutral-prompt.git main [6e3df35a](https://github.com/ljleb/sd-webui-neutral-prompt/commit/6e3df35afe9ea1c8bb121086d15156feca4d3d85) Wed May 31 05:29:17 2023 unknown sd-webui-prompt-all-in-one https://github.com/Physton/sd-webui-prompt-all-in-one main [511c45ea](https://github.com/Physton/sd-webui-prompt-all-in-one/commit/511c45eacf6a64a7422143ba8806305f6263f195) Thu Jun 1 13:27:46 2023 unknown stable-diffusion-webui-Prompt_Generator https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator master [0d4de20f](https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator/commit/0d4de20f9572858fdda06c9e998353f9f8510c60) Fri Mar 17 11:22:15 2023 unknown stable-diffusion-webui-composable-lora https://github.com/opparco/stable-diffusion-webui-composable-lora.git main [d4963e48](https://github.com/opparco/stable-diffusion-webui-composable-lora/commit/d4963e487c55e2adb292fa2021fa5c05bf169a7d) Mon Feb 27 17:40:08 2023 unknown stable-diffusion-webui-images-browser https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git main [5795886b](https://github.com/AlUlkesh/stable-diffusion-webui-images-browser/commit/5795886bee895c2e69e5c64e67aa643da423511c) Sat Jun 3 08:59:13 2023 unknown stable-diffusion-webui-promptgen https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen.git master [84e58b5d](https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen/commit/84e58b5d655c6e6b140af2c3fd2f49a398e666f2) Fri Jan 20 11:15:12 2023 unknown stable-diffusion-webui-state https://github.com/ilian6806/stable-diffusion-webui-state.git main [36697c83](https://github.com/ilian6806/stable-diffusion-webui-state/commit/36697c83c4f42b7dfd120a17fb09faa7555d5463) Tue Apr 4 13:32:11 2023 unknown stable-diffusion-webui-tokenizer https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer.git master [ac6d541c](https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer/commit/ac6d541c7032e9f9c69c8ead2ed201302b06a4fe) Sat Dec 10 12:58:31 2022 unknown stable-diffusion-webui-two-shot https://github.com/opparco/stable-diffusion-webui-two-shot.git main [9936c52e](https://github.com/opparco/stable-diffusion-webui-two-shot/commit/9936c52eba04da7f0c009051ab03a60e72d4f7e6) Sun Feb 19 08:40:41 2023 unknown ultimate-upscale-for-automatic1111 https://github.com/Coyote-A/ultimate-upscale-for-automatic1111 master [0a3d03a4](https://github.com/Coyote-A/ultimate-upscale-for-automatic1111/commit/0a3d03a41aef6f0a2b7f9582e42e06852881b4a8) Tue Feb 7 06:07:23 2023 unknown LDSR [built-in](http://127.0.0.1:7860/) None Sat Jun 3 21:53:58 2023 Lora [built-in](http://127.0.0.1:7860/) None Sat Jun 3 21:53:58 2023 ScuNET [built-in](http://127.0.0.1:7860/) None Sat Jun 3 21:53:58 2023 SwinIR [built-in](http://127.0.0.1:7860/) None Sat Jun 3 21:53:58 2023 prompt-bracket-checker [built-in](http://127.0.0.1:7860/) None Sat Jun 3 21:53:58 2023 ### Console logs ```Shell Already up to date. venv "D:\STABLEAI\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.3.1 Commit hash: b6af0a3809ea869fb180633f9affcae4b199ffcf Installing requirements Installing None Installing onnxruntime-gpu... Installing None Installing opencv-python... Installing None Installing Pillow... Installing None Installing opencv-contrib-python... Installing requirements for Prompt Gallery Launching Web UI with arguments: --no-half-vae --xformers ============================================================================== You are running torch 1.13.1+cu117. The program is tested to work with torch 2.0.0. To reinstall the desired version, run with commandline flag --reinstall-torch. Beware that this will cause a lot of large files to be downloaded, as well as there are reports of issues with training tab on the latest version. Use --skip-version-check commandline argument to disable this check. ============================================================================== ================================================================================= You are running xformers 0.0.16rc425. The program is tested to work with xformers 0.0.17. To reinstall the desired version, run with commandline flag --reinstall-xformers. Use --skip-version-check commandline argument to disable this check. ================================================================================= Civitai Helper: Get Custom Model Folder Civitai Helper: Load setting from: D:\STABLEAI\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json Additional Network extension not installed, Only hijack built-in lora LoCon Extension hijack built-in lora successfully sd-webui-prompt-all-in-one background API service started successfully. Loading weights [53716a2a78] from D:\STABLEAI\stable-diffusion-webui\models\Stable-diffusion\virtuousmix_v10.safetensors INFO: Started server process [27404] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:5173 (Press CTRL+C to quit) Creating model from config: D:\STABLEAI\stable-diffusion-webui\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. INFO: 127.0.0.1:51311 - "GET / HTTP/1.1" 200 OK Parsing Section Image Attributes Parsing Section Camera Settings Parsing Section Character Attributes Loading VAE weights specified in settings: D:\STABLEAI\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.ckpt Applying optimization: xformers... done. Textual inversion embeddings loaded(46): advntr, an5, an6, AuroraNegative, bad-artist, bad-artist-anime, bad-hands-5, bad-image-v2-39000, bad-picture-chill-1v, bad-picture-chill-32v, bad-picture-chill-75v, bad_prompt_version2, bad_quality, badhandv4, badv4, charturnerv2, Cornflower, DarkFantasy, durer-style, EasyNegative, EasyNegativeV2, FastNegativeEmbedding, ghst-3000, ghst-4000, hoodnude, huang-guang-jian, KHFB, kkw-medieval, logo-with-face-on-shield, midjourney-style, negative_hand-neg, ng_deepnegative_v1_75t, poly-hd, style-empire, style-empire-neg, Style-Renaissance, style-rustmagic, style-rustmagic-neg, style_tombraider, TheUndertaker2, ulzzang-6500-v1.1, Unspeakable-Horrors-Composition-4v, verybadimagenegative_v1.1-6400, verybadimagenegative_v1.2-6400, verybadimagenegative_v1.3, vile_prompt3 Textual inversion embeddings skipped(11): 21charturnerv2, laxpeintV2, mj-gs, nartfixer, nfixer, nrealfixer, PaintStyle3, PaintStyle4, ParchArt, rev2-badprompt, ThisHonor Model loaded in 3.4s (load weights from disk: 0.4s, create model: 0.2s, apply weights to model: 0.7s, apply half(): 0.4s, load VAE: 0.2s, move model to device: 0.8s, load textual inversion embeddings: 0.8s). Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. Startup time: 10.2s (import torch: 1.0s, import gradio: 0.6s, import ldm: 0.3s, other imports: 0.6s, load scripts: 2.9s, create ui: 2.4s, gradio launch: 2.2s). Traceback (most recent call last): File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 414, in run_predict output = await app.get_blocks().process_api( File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api result = await self.call_function( File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function prediction = await anyio.to_thread.run_sync( File "D:\STABLEAI\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 "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "D:\STABLEAI\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "D:\STABLEAI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 373, in paste_func params = parse_generation_parameters(prompt) File "D:\STABLEAI\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 272, in parse_generation_parameters if v[0] == '"' and v[-1] == '"': IndexError: string index out of range ``` ### Additional information _No response_
w-e-w commented 1 year ago

post the image that's causing the issue

RykeWollf commented 1 year ago

post the image that's causing the issue

It happens with all images. And it happens not with reading the image, but inserting all the generation data in the txt2img prompt box and using the blue button to read generation data.

w-e-w commented 1 year ago

@RykeWollf again post the image that's causing the issue if we cannot reproduce the issue we cannot fix the issue and basically it's only happening to you so without your information we cannot fix it

RykeWollf commented 1 year ago

Sure thing, like i said though it's happening with all images, it didn't before switching PC's, so it's definitely very weird.

a painting of a distant castle surrounded by red trees and clouds in the background with a dark sky above it, Anato Finnstark, dark fantasy art, a matte painting, gothic art, dark ambience, dark Negative prompt: EasyNegative, (((sunset))), ((dusk)), (snow) text, artist name, signature, church, bad-artist, bad-artist-anime, bad-image-v2-390000, bad_prompt_version2, bad_quality, NG_DeepNegative_V1_75T, vile_prompt3, 3d, 3d render, lowres, Unspeakable-Horrors-Composition-4v, bad-artist-anime, badv4, EasyNegative, bad-image-v2-39000, NG_DeepNegative_V1_75T, verybadimagenegative_v1.3, vile_prompt3 Steps: 24, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 511994104, Face restoration: , Size: 768x512, Model hash: 648c617806, Model: prismaboysmix_v20, Denoising strength: 0.7, Clip skip: 2, CFG Rescale φ: 0, Hires upscale: 1.5, Hires upscaler: 4x-UltraSharp, Version: v1.3.1

00034-prismaboysmix_v20DPM++ 2M Karras

w-e-w commented 1 year ago

I found the issue in your parameters that's causing issue Face restoration: <BLANK>

the problem is I don't know the root cause yet however I did I'm kind of related bugs regarding face restoration

RykeWollf commented 1 year ago

omg thank you so much I thought i was going insane! I tried with so many but apparently the most recent images all that issue. I just generated new ones and went back to older images and it's gone. Can't believe I made such a silly mistake.

Thank you so much once more @w-e-w !

w-e-w commented 1 year ago

do you have any idea what might be the cause of your images are missing that field of data? would it be possible to send your config file, the config.json under stable-diffusion-webui dir

or perhaps some extension is at fault?

RykeWollf commented 1 year ago

do you have any idea what might be the cause of your images are missing that field of data? would it be possible to send your config file, the config.json under stable-diffusion-webui dir

or perhaps some extension is at fault?

I have no clue. I think I tried replicating an image from civitai using the generation data text and it may have had that. But I've also seen people use different face restoration methods whereas I just have none.

Feel free to check these out.

Appreciate the help :)

I switched the extention to .txt so github would allow upload config.txt

w-e-w commented 1 year ago

I know why it happened but I don't know how it happened in your configs normally it should look like either something like this

    "face_restoration_model": "CodeFormer",
    "face_restoration_model": "GFPGAN",

but for some reason yours look like this empty

    "face_restoration_model": "",

there is currently an issue in web UI in that if you're carrying over your settings files from 4~ month ago, then the default value will be null this is not your situation

    "face_restoration_model": null,

this causes a little bit of an issue which I will be fixing soon

for now the fix for you personally is to go to the settings select and apply one of the face restoration methods

if you don't know which one to use just use the first one (the default) after that the value in the settings will be fixed subsequent images and subsequent images you generate won't have bad metadata image

RykeWollf commented 1 year ago

Perfect, I have no idea what happened there. I'm just happy to have been able to successfully switch PC's and keep all my data from one to another, albeit with some hiccups.

Is there a way to add that to the quick settings menu on the top? So it's easier to switch between one and the other?

Thanks again :)

w-e-w commented 1 year ago

setting > user interface > Quicksettings add face_restoration_model

w-e-w commented 1 year ago

lol

Is there a way to add that to the quick settings menu on the top? So it's easier to switch between one and the other?

yse add that to the quick settings

RykeWollf commented 1 year ago

Already did, cheers ;)