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.37k stars 2.4k forks source link

[bug]: browser no saving progress on crash + access violation #5415

Open erwin1234777 opened 9 months ago

erwin1234777 commented 9 months ago

Is there an existing issue for this?

OS

Windows

GPU

cuda

VRAM

12GB

What version did you experience this issue on?

3.5.1

What happened?

When using the webui, sometimes after bulk generating images, the browser would crash with STATUS_ACCESS_VIOLATION, forcing the page to be reloaded. The caveat is that after reloading, it would bring back the webui to a state that it was over an hour or more(sometimes) ago, making it an extreme inconvenience to easily edit masked images, since they are no longer there(only in the /output folder).

Screenshots

image

image

Additional context

Troubleshooting steps:

Generally i batch about 60, 100 or 250 images, so it may not necessarily be related to bulk, but every instance occurred when such was going on.

Generally the steps are => go to canvas => mask an image => generate 100-200 images => HOPEFULLY one of them crashes like above(or you could force a OOM just to replicate the reload behavior not working properly) => reload page => watch as most of the progress has been lost => expected behavior when restoring a session would be to go back a few images at best before the crash => actual is most of the time it goes back to when i wasnt even editing that image, in the prior generation batch

Discord Thread

Contact Details

discord: home.depot

psychedelicious commented 9 months ago

I believe the problem is our gallery implementation :/

To implement the endless scroll, it basically never lets go of any images' metadata. So as you generate more and more, the RTKQ cache of images just keeps growing.

I think we can find a happy middle ground that gives the same user experience with much better memory usage, but we'll probably need to change the gallery pagination to be cursor based. I'm not sure how much work this will be.