yfszzx / stable-diffusion-webui-inspiration

114 stars 23 forks source link

'Blocks' object is not iterable #1

Closed Gonoshift closed 1 year ago

Gonoshift commented 1 year ago

Hello, I tried to use the extension but when launching the webui it spits out this error:

image

I'm not the only one getting this, here's an issue on the webui repo: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3552

Cubittus commented 1 year ago

The following patch fixes it - the callback is not returning a tuple list when it returns early on not finding any images.

diff --git a/scripts/inspiration.py b/scripts/inspiration.py
index 1d4c565..e65bc7e 100644
--- a/scripts/inspiration.py
+++ b/scripts/inspiration.py
@@ -207,7 +207,7 @@ def on_ui_tabs():
                 unzip the file to <stable-diffusion-webui>/extections/stable-diffusion-webui-inspiration<br>
                 and restart webui, and enjoy the joy of creation!<br></div>
                 """)      
-            return inspiration
+            return (inspiration, "Inspiration", "inspiration"),
         if not os.path.exists(inspiration_system_path):
             os.mkdir(inspiration_system_path)
         with gr.Row():
yfszzx commented 1 year ago

thanks to report this bug, it will occur when the inspiration directory is empty, so I didn't find this error during development.

I have fixed it, run "git pull" under stable-diffusion-webui-inspiration to get the new version, and restart webui