Coder Social home page Coder Social logo

Comments (4)

ThereforeGames avatar ThereforeGames commented on May 13, 2024

Hi @Ev-Bro,

Thank you for reaching out!

It looks like A1111 has been updating the UI a lot today. I just grabbed the latest version and it looks like the txt2mask shortcode is working correctly - maybe the bug was already resolved?

If the error persists on your end, please let me know your exact prompt and inference settings if you don't mind. Thanks!

from unprompted.

Ev-Bro avatar Ev-Bro commented on May 13, 2024

Thanks for the reply. Same issue today after pull some more Auto1111 updates. I tried reinstalling the extension with no luck. I have not tried a full Auto1111 reinstall.

What are inference settings?

Here is my prompt:
[txt2mask smoothing=10]black dress[/txt2mask] red dress

error:

Error running process: C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\scripts\unprompted.py
Traceback (most recent call last):
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\lib\shortcodes.py", line 133, in render
return str(self.handler(self.token.keyword, self.pargs, self.kwargs, context, content))
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\lib\shared.py", line 57, in handler
return(self.shortcode_objects[f"{keyword}"].run_block(pargs, kwargs, context, content))
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted/shortcodes\stable_diffusion\txt2mask.py", line 149, in run_block
self.image_mask = get_mask().resize((self.Unprompted.shortcode_user_vars["init_images"][0].width,self.Unprompted.shortcode_user_vars["init_images"][0].height))
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted/shortcodes\stable_diffusion\txt2mask.py", line 102, in get_mask
img = transform(self.Unprompted.shortcode_user_vars["init_images"][0]).unsqueeze(0)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\venv\lib\site-packages\torchvision\transforms\transforms.py", line 94, in call
img = t(img)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in call_impl
return forward_call(*input, **kwargs)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\venv\lib\site-packages\torchvision\transforms\transforms.py", line 269, in forward
return F.normalize(tensor, self.mean, self.std, self.inplace)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\venv\lib\site-packages\torchvision\transforms\functional.py", line 360, in normalize
return F_t.normalize(tensor, mean=mean, std=std, inplace=inplace)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\venv\lib\site-packages\torchvision\transforms\functional_tensor.py", line 959, in normalize
tensor.sub
(mean).div_(std)
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0

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

Traceback (most recent call last):
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\modules\scripts.py", line 338, in process
script.process(p, *script_args)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\scripts\unprompted.py", line 105, in process
Unprompted.shortcode_user_vars["prompt"] = Unprompted.process_string(apply_prompt_template(original_prompt,Unprompted.Config.templates.default))
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\lib\shared.py", line 77, in process_string
string = self.shortcode_parser.parse(string,context)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\lib\shortcodes.py", line 219, in parse
return stack.pop().render(context)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\lib\shortcodes.py", line 58, in render
return ''.join(child.render(context) for child in self.children)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\lib\shortcodes.py", line 58, in
return ''.join(child.render(context) for child in self.children)
File "C:\Users\username\AUTOMATIC1111\stable-diffusion-webui\extensions\unprompted\lib\shortcodes.py", line 137, in render
raise ShortcodeRenderingError(msg) from ex
lib.shortcodes.ShortcodeRenderingError: An exception was raised while rendering the 'txt2mask' shortcode in line 1.

from unprompted.

credman0 avatar credman0 commented on May 13, 2024

I just installed the extension and can confirm I am having the same problem. I don't want to set you on the wrong path, but I suspect that somehow it is getting an RGBA image now instead of RGB, which is consistent with some changes in the webui having to do with allowing customization in the bg color.

Webui has a new flatten function and seems like it had to be fixed in other places e.g.:
AUTOMATIC1111/stable-diffusion-webui@c6f347b

which at a cursory glance looks a little like what is happening where this bug is here. The flatten function (I believe) is new, maybe you need to do something similar now as well.

I don't have any way to debug right now to test this, unfortunately...

from unprompted.

ThereforeGames avatar ThereforeGames commented on May 13, 2024

Fixed in v5.0.0. Thank you!

from unprompted.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.