Closed sonalys closed 1 year ago
Which Krita version do you use? Do I guess right, this happens when you use the generation mode "img -> img"? Has the document the size 512x512, color mode "RGB/Alpha" and color depth "8 bit"?
Is there a visible layer, which shows the init image?
All this is checked before starting generate, but I want to make sure, that it doesn't slip through the check and it causes the problem.
I checked it and saw, it could also happen in generation mode "text -> image". If you used this mode, you don't need an init image in a visible layer.
I use version 5.1.1 I used text -> img 512x512 rgba with 8 bit depth
Could you please either post a screenshot of the dialog, so I can see all values you used or send me the used values? If it happens with any prompt, I don’t need the prompt.
If you use an apikey, please hide it on a screenshot
Forgot to ask: which OS do you use?
If you prefer, you can send me the screenshot or the details also via pm on Twitter https://twitter.com/BlueTurtleAI or Reddit u/BlueTurtleAI
@klausweiss You reacted with thumb up to the initial post of this issue. Does this mean, you have got the same problem? If so, it would be great if you could help fixing this problem. Unfortunately, the author of this issue doesn't give me more details.
I use arch linux
no api key
I cant show it today, since I am not home
Okay, thanks for the update. Would be great, if you could send me more details, when you are at home again.
Hey @blueturtleai. Yup, same issue, Manjaro Linux (arch-based), with API key though.
I tried debugging it. QImage
couldn't be loaded here
https://github.com/blueturtleai/krita-stable-diffusion/blob/b70246905918942eca40d36070ff31629b808909/krita_stablehorde/krita_stablehorde.py#L345
^ this returned False
.
I checked the bytes array and it was valid. Dumped it to a file and firefox could open it as a .webp image no prob.
Thanks for the details @klausweiss ! That’s really strange, especially bcs you can open the image manually. It seems to be a general problem, perhaps specific for Linux. So, do i guess right, it happens with different prompts you tried? Do you have the chance to try it on another computer with a different OS?
I had actually tried with 1.1.1. before. Yeah, happens with all prompts I've tried.
I did some more digging. Opened a standalone python interpreter and tried loading a .webp image. Same results.
>>> from PyQt5.QtGui import QImage
>>> with open("/tmp/img.webp", "rb") as f: QImage.fromData(f.read()).byteCount()
0
With a jpeg image it's a different story. Loads no prob.
>>> from PyQt5.QtGui import QImage
>>> with open("/tmp/img.jpg", "rb") as f: QImage.fromData(f.read()).byteCount()
63332864
I guess the arch distribution of pyqt (or qt?) was not compiled with libwebp support.
If we want it to be robust, we could convert the webp bytes to a png and try loading again, if loading from webp bytes fails.
Many thanks for your tests and your findings! I will talk to the stablehorde guys and ask, if it’s possible to receive the images as jpg or png.
Running sudo pacman -S qt5-imageformats
should fix the problem. Please let me know, if it works afterwards.
Ayy, this solves the issue for me! Thank you! (:
That’s great!
worked for me, thanks!
Okay, great! I added a hint for Linux users to the readme how to check, if Qt5 webp is supported and how to add support. Additionally I will check in a new version, if webp is supported and show a hint how to add support.
I receive this error when generating any image