ThereforeGames / unprompted

Templating language written for Stable Diffusion workflows. Available as an extension for the Automatic1111 WebUI.
777 stars 66 forks source link

Interrupt button crashes the extension #85

Closed Zyin055 closed 1 year ago

Zyin055 commented 1 year ago

When clicking Interrupt button in the A1111 GUI during image generation I get this error:

Error running postprocess: C:\Stuff\AI\Stable Diffusion\extensions\unprompted\scripts\unprompted.py01<00:00,  7.23it/s]
Traceback (most recent call last):
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\lib_unprompted\shortcodes.py", line 117, in render
    return str(self.handler(self.token.keyword, self.pargs, self.kwargs, context))
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\lib_unprompted\shared.py", line 61, in handler
    return(self.shortcode_objects[f"{keyword}"].run_atomic(pargs, kwargs, context))
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted/shortcodes\stable_diffusion\zoom_enhance.py", line 136, in run_atomic
    fixed_image = self.Unprompted.shortcode_objects["img2img"].run_atomic(set_pargs,None,None)
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted/shortcodes\stable_diffusion\img2img.py", line 27, in run_atomic
    img2img_result = modules.img2img.img2img(
  File "C:\Stuff\AI\Stable Diffusion\modules\img2img.py", line 171, in img2img
    processed = process_images(p)
  File "C:\Stuff\AI\Stable Diffusion\modules\processing.py", line 486, in process_images
    res = process_images_inner(p)
  File "C:\Stuff\AI\Stable Diffusion\modules\processing.py", line 716, in process_images_inner
    extra_networks.deactivate(p, extra_network_data)
UnboundLocalError: local variable 'extra_network_data' referenced before assignment

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Stuff\AI\Stable Diffusion\modules\scripts.py", line 436, in postprocess
    script.postprocess(p, processed, *script_args)
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\scripts\unprompted.py", line 455, in postprocess
    Unprompted.shortcode_objects[i].after(p,processed)
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted/shortcodes\basic\after.py", line 32, in after
    self.Unprompted.process_string(self.Unprompted.parse_alt_tags(content,"after"))
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\lib_unprompted\shared.py", line 157, in parse_alt_tags
    return(self.shortcode_parser.parse(string,context))
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\lib_unprompted\shortcodes.py", line 219, in parse
    return stack.pop().render(context)
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\lib_unprompted\shortcodes.py", line 58, in render
    return ''.join(child.render(context) for child in self.children)
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\lib_unprompted\shortcodes.py", line 58, in <genexpr>
    return ''.join(child.render(context) for child in self.children)
  File "C:\Stuff\AI\Stable Diffusion\extensions\unprompted\lib_unprompted\shortcodes.py", line 121, in render
    raise ShortcodeRenderingError(msg) from ex
lib_unprompted.shortcodes.ShortcodeRenderingError: An exception was raised while rendering the 'zoom_enhance' shortcode in line 1.

After the error the extension no longer activates and you need to restart the UI to fix it.

Prompt was "photo of a woman standing[after]{zoom_enhance}[/after]"

ThereforeGames commented 1 year ago

I believe I resolved this at some point, as using the interrupt button with your example prompt does not crash the program in the latest version of Unprompted. Let me know if the issue persists on your end. Thanks!