sd-webui-depth-lib
sd-webui-depth-lib copied to clipboard
Quick fix for KeyError: 'dataset'
Hi there, If you are facing KeyError: 'dataset' issue, you can fix by:
- go to your
webui_folder\venv\Lib\site-packages\gradio_client
and editserializing.py
file - go to the end of the serializing.py, and add one line inside COMPONENT_MAPPING:
"dataset": StringSerializable,
it should look like after modifing: - Save
- Restart your webui.
it should work well now, I tested 900 hands on webui latest version 1.5.1 + gradio 3.32.0 + gradio_client 0.3.0
it should fix the issues:
- https://github.com/jexom/sd-webui-depth-lib/issues/32
- https://github.com/jexom/sd-webui-depth-lib/issues/35
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/11855
I know webui plans to update gradio to latest(3.39) in later release v1.6.0 (see https://github.com/richrobber2/canvas-zoom/issues/88), but likely it still lost dataset map in https://github.com/gradio-app/gradio/blob/v3.39.0/client/python/gradio_client/serializing.py
there are several ways to fix the issue permanently:
- I am not sure the reason why gradio miss this code, it may have some reasons, but it could be gradio client bug, should be fixed in gradio side.
- replace the code https://github.com/jexom/sd-webui-depth-lib/blob/efa9f616b30ea0f27e5dadf40ab41815012d1d78/scripts/main.py#L47 using gr.Examples by another way to show the image lib, may could be gallery component https://www.gradio.app/docs/gallery I guess.
- totally give up gradio component and use other tech, like pure javascript instead to display the image lib (as a webui extension developer, I prefer to rebuild my page by HTML/CSS/JS rather than using gradio honstlly)
Hello. Thank you, helped with the replacement serializing.py
Do you know why don't show pictures? There are no errors in the console. I think it's because of the symbolic link to the extension https://github.com/jexom/sd-webui-depth-lib/issues/29
@alexbofa i don’t see the issue that images not show up on my side, I tested the default images from this extension and 900 hands, and they work well. If you could provide more information I may help.
works for me also
gr.gallery solution looks okay and possible
@alexbofa i don’t see the issue that images not show up on my side, I tested the default images from this extension and 900 hands, and they work well. If you could provide more information I may help.
I didn't have time to fix the message, because I found a problem in the issue. It's possible, as I wrote in the updated post, that the problem is that I'm using a symbolic link for "Extensions" https://github.com/jexom/sd-webui-depth-lib/issues/29
2. by another way to show the image lib, may could b
dataset = gr.Examples(examples=os.path.join(maps_path, t), inputs=[png_input_area],examples_per_page=24,label="Depth Maps", elem_id="examples")
Should be replaced by what?
gonna have to do this: https://github.com/jexom/sd-webui-depth-lib/issues/36#issue-1839673234
@pipa0979 you don’t need to do that you pointed out, that’s some my personal suggestions for the extension author or someone who wants to contribute the fix. To fix it quickly you just need to do my first comment as @webcoderz showing
it works,thanks a lot
TLDR: The problem for me was miaoshouai-assistant. Removed it, deleted venv folder. Works now.
Longer version: I had tried everything I found on this page and a few others with no luck. I can't say whether or not anything on this page helped my solution mentioned here work better or if there was no effect. All I know is the fixes didn't work until I removed the miaoshouai-assistant extension. I really liked that extension and hope it's updated to working again for me.
Steps I performed to get my stable diffusion working again:
- Delete the venv folder
- Delete the Miaoshouai-assistant folder in /extensions
- Run webui-user.bat
The venv folder was rebuilt and started working. The reason I take extra care to point this out is because I tried running SD with no extensions in the /extensions folder and still got the same error. I can only guess that miaoshouai-assistant puts something in the folder that causes the issue, or requires a dependency that causes the issue.
Hope this helps ♥
你不需要这样做,你指出的,这是我对扩展作者或想要贡献修复的人的一些个人建议。要快速修复它,您只需要按照所示执行我的第一条评论即可
It worked for me. Thank you
@XMUykyz Hello, download this fork: https://github.com/wywywywy/sd-webui-depth-lib