Gerschel / sd_web_ui_preset_utils

Preset Manager moved private
252 stars 20 forks source link

[BUG]: value error #37

Open Woisek opened 1 year ago

Woisek commented 1 year ago

Just a view minutes ago, whenever I click on a preset to be restored, I get this:

Traceback (most recent call last): File "I:\Super SD 2.0\automatic\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict output = await app.get_blocks().process_api( File "I:\Super SD 2.0\automatic\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api result = await self.call_function( File "I:\Super SD 2.0\automatic\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function prediction = await anyio.to_thread.run_sync( File "I:\Super SD 2.0\automatic\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "I:\Super SD 2.0\automatic\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "I:\Super SD 2.0\automatic\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "I:\Super SD 2.0\automatic\extensions\sd_web_ui_preset_utils\scripts\zpreset_utils.py", line 592, in fetch_valid_values_from_preset return [ File "I:\Super SD 2.0\automatic\extensions\sd_web_ui_preset_utils\scripts\zpreset_utils.py", line 607, in else self.component_map[comp_name].choices[self.component_map[comp_name].choices.index(comps_vals[i])] ValueError: [] is not in list

Any ideas what happend? 😶 @Gerschel ... ?

Gerschel commented 1 year ago

I figured out why the error.
The dropdowns became a different component type ( a mix between text input and dropdown), so they returned a default value of a blank list "[]", but a blank list was not in the options of the dropdown, so I had to catch that situation and return "None", it might have to modify it to return the first option.

It looks as if there are several other changes that I will need to code around, so this plugin isn't working entirely as before. There are a lot of scenarios where a single type of thing is coded one way or another, and every possible combination needs some kind of handling.
If I base it on "labels", then another thing collides with "labels", such as "Prompt" for the main prompt and "Prompt" for hires prompt, but if I try to fix it using element id's, then I collide where the same element id is used somewhere else. If I code against the gradio config, then some uses other code to alter the config. There is no single thing that is reliable to be certain you are focusing on the correct component, it needs a lot of checking and cross checking.

I'm certain the next reports I get will have to do specifically for these collisions.