invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.72k stars 2.43k forks source link

IMG2IMG through --web starts printing lines and lines of binary and slows down #618

Closed smoke2007 closed 2 years ago

smoke2007 commented 2 years ago

This is for the development branch ,

when using the --web interface , selecting an image and pressing generate, it starts spitting out lines and lines of what seems to be the content of the png in the server terminal window

slowing down the generation process a lot

when launching dream.py without web and doing the same through CLI command with -I./images/.... and same parameters, it runs fine and fast.

I think it's to do with the logging that the web interface does.

example : ... bcbgCjbuo5F1iygtjYwZi2CXisJyLmzKZeDEXUusOz+4Dk7AHndCDpu6/dTSkiPOfFfZBmXiICM0Eb7S7yZFxG29T1HWBE92FGJNVmfzWWvu2ZgSqj1oIz2NoZ01OfnrYBa2aFyZ7mK2Z53PM7Z/F19mpCa55y1ciWWSU5PZ4gmvA1M3nDw2fZlGDuoERQIGe62ycjgmTGnejuSe1MeN+Uxt7lqOe12/LxZ52PT+dvtC6YeeMr3OvbIwMZ7O6nnj2cbwl4cR2/JmHECs+U8pqj+OyGaAeUy2uFyUYjmf11cTX4iPT6qgqtUl0kdQkuCCfRoGc8oqZwzkS6knaivRBW1G/u8zdQAxCE7smCzANYwxtbXa0T0XytFMDprip9va5IAvV57NNgR7AIh8A717fP5m9LaIhnbEp06VDQQIGwANB3/NW0kxE6DbHHCD8A2QILIBg9B8Dz5+OU4GGPFHZujP2BZzrIcP7APQ3D1hMAxPc9C02vW94snSV3dL0QHsk0jh1mfLbUHoetVU8MV0WIYChbiuC0zLqAxOGvdCJ2KLZjkxlnjvgO8JXmm45X2q1hLdQhfb3ABSQDuUMiH2Lfg5acVj3pNo7rQIEnSos2uduP7mYwotKTOxLw+Njc5EV726Jcgsz1sgtND2EDsMXSZk7WHw5m2rl73pjYTQ+SvhFt1+RpPYSoJACa/jmB0oy9uYs5Ma60sp7uU1myqUKb/aTp8/DqEhZIIIl/2 ....

lstein commented 2 years ago

I haven't been able to reproduce this. Is the unwanted text appearing in the terminal window that you launched the server from?

smoke2007 commented 2 years ago

correct.

I just choose any image from the web interface , add a prompt , run it and after "Decoding: ..." it starts to print out the binary format of what I think is the image. It makes it take about 4-5x longer than it used to take ,due to python being fairly slow when being verbose.

Edit: however that was before i pulled the latest "development" code, now it just hangs after the print out of the binary code, before that it still generated the image, now I have to F5 , refresh the webpage to be able to generate something again. Before the latest pull, i got the image and usage stats.

so img2img no longer works for me.

txt2img still works fine.

image

image

TaiPhamD commented 2 years ago

I have the same issue from development branch on macOS m1

correct.

I just choose any image from the web interface , add a prompt , run it and after "Decoding: ..." it starts to print out the binary format of what I think is the image. It makes it take about 4-5x longer than it used to take ,due to python being fairly slow when being verbose.

Edit: however that was before i pulled the latest "development" code, now it just hangs after the print out of the binary code, before that it still generated the image, now I have to F5 , refresh the webpage to be able to generate something again. Before the latest pull, i got the image and usage stats.

so img2img no longer works for me.

txt2img still works fine.

image

image

lstein commented 2 years ago

I'm working on this bug now. In the meantime, you might want to try out the shiny new web interface which you can launch with python backend/server.py

UPDATE: Confirmed on Linux

smoke2007 commented 2 years ago

Ok I just tested it, the server says to launch 0.0.0.0:9090 in terminal , i tried 127.0.0.1 it loaded site, but didnt connect to server , because it wasnt allowed in origins, localhost:9090 worked fine. Perhaps some tweaks there.

I tested the image2image and it worked without the binary code output in terminal.

I'll do some more tests with this new interface, the old one wasn't bad though.

As extra info, due to updating my environment going wrong (from the other issue thread) , to get the backend server running I also had to do

python -m pip install flask_socketio --upgrade conda install eventlet

pbaylies commented 2 years ago

Looks like it's trying to use a data uri of the entire image as a filename; if you log this to a file, it starts with: [Errno 36] File name too long: data:image/png;base64,

lstein commented 2 years ago

Should be fixed now. In case anyone is interested, the emerging standard for storing metadata in generated images asks for the hash of the init image to be stored in the generated PNG image. I'd written the hashing code expecting the image to live on disk, but in the case of the web server the init image is passed around in memory. So I had to detect and handle this case.

lstein commented 2 years ago

Ok I just tested it, the server says to launch 0.0.0.0:9090 in terminal , i tried 127.0.0.1 it loaded site, but didnt connect to server , because it wasnt allowed in origins, localhost:9090 worked fine. Perhaps some tweaks there.

I tested the image2image and it worked without the binary code output in terminal.

I'll do some more tests with this new interface, the old one wasn't bad though.

As extra info, due to updating my environment going wrong (from the other issue thread) , to get the backend server running I also had to do

python -m pip install flask_socketio --upgrade conda install eventlet

Tagging @psychedelicious. In the next iteration of the server backend, could you expose the port, binding address, and allowed remotes as configuration options? You're welcome to use the new Args framework to parse the command line options.