AlUlkesh / stable-diffusion-webui-images-browser

an images browse for stable-diffusion-webui
623 stars 111 forks source link

Send to txt2img Not Working #254

Closed BrannenK closed 2 months ago

BrannenK commented 2 months ago

After selecting a file in the image browser and clicking "send to text2img" I get an error saying "ValueError: too many values to unpack (expected 2)"

here is the log:

Traceback (most recent call last): File "C:\AI\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "C:\AI\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "C:\AI\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "C:\AI\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\AI\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "C:\AI\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "C:\AI\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(args, **kwargs) File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\infotext_utils.py", line 469, in paste_func params = parse_generation_parameters(prompt) File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\infotext_utils.py", line 271, in parse_generation_parameters found_styles, prompt, negative_prompt = shared.prompt_styles.extract_styles_from_prompt(prompt, negative_prompt) File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\styles.py", line 218, in extract_styles_from_prompt is_match, new_prompt, new_neg_prompt = extract_original_prompts( File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\styles.py", line 70, in extract_original_prompts match_positive, extracted_positive = extract_style_text_from_prompt(style.prompt, prompt) File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\styles.py", line 45, in extract_style_text_from_prompt left, right = stripped_style_text.split("{prompt}", 2) ValueError: too many values to unpack (expected 2)

AlUlkesh commented 2 months ago

File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\styles.py", line 45, in extract_style_text_from_prompt left, right = stripped_style_text.split("{prompt}", 2)

Hmm, seems to be a problem with "style". Does it work with an image, that does not have the style tag?

Can you show me the pnginfo of that image?

BrannenK commented 2 months ago

File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\styles.py", line 45, in extract_style_text_from_prompt left, right = stripped_style_text.split("{prompt}", 2)

Hmm, seems to be a problem with "style". Does it work with an image, that does not have the style tag?

Can you show me the pnginfo of that image?

It doesn't seem to be working with any of my pics, and usually throws the same error.

Here's the pnginfo for that specific pic though:

Man, hair tis outerspace nebula Steps: 30, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 1943877036, Size: 1024x1024, Model hash: 191a446525, Model: RealitiesEdgeXLANIME_20, Version: f0.0.17v1.8.0rc-latest-277-g0af28699

AlUlkesh commented 2 months ago

I tried with that info, but no problem with it here.

Can you create a debug log and post it: https://github.com/AlUlkesh/stable-diffusion-webui-images-browser/discussions/130

BrannenK commented 2 months ago

I tried with that info, but no problem with it here.

Can you create a debug log and post it: #130

Here's the log. Hopefully I followed the steps correctly for making it.

image_browser.log

AlUlkesh commented 2 months ago

Yes, but unfortunately can't see anything unusual. Let's get back to the error message:

File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\styles.py", line 45, in extract_style_text_from_prompt
left, right = stripped_style_text.split("{prompt}", 2)
ValueError: too many values to unpack (expected 2)

That means when trying to split the style, {prompt} is found more than once. Could you have a faulty style?

BrannenK commented 2 months ago

Yes, but unfortunately can't see anything unusual. Let's get back to the error message:

File "C:\AI\Data\Packages\stable-diffusion-webui-forge\modules\styles.py", line 45, in extract_style_text_from_prompt
left, right = stripped_style_text.split("{prompt}", 2)
ValueError: too many values to unpack (expected 2)

That means when trying to split the style, {prompt} is found more than once. Could you have a faulty style?

I went through and cleaned up my styles.csv. Not sure why, but some styles were the cause of all the errors. If I ever find out why (or have the time), I'll let you know.

Thanks for the help. Everything seems to be working perfectly now.

AlUlkesh commented 2 months ago

Good to hear!