zero01101 / openOutpaint

local offline javascript and html canvas outpainting gizmo for stable diffusion webUI API 🐠
MIT License
500 stars 43 forks source link

[Bug]: Canvas eventaully disapears on Firefox #258

Open Kadah opened 10 months ago

Kadah commented 10 months ago

What happened?

Pretty often now, the canvas disappears after some time, typically 3+ hours, but may take up to >24 hours from initial load.

The working image is lost. Save does nothing. Usually the non-button UI of tools' brushes are no longer rendered. Any new image data attempted to written to the canvas (eg. with gen, stamp, draw) can be seen or saved. Console shows nothing different from a when its working. All tools still function with the exception that nothing they create is visible.

Given how long it takes for this to start happening, not sure if it started with the updates a couple weeks ago. I think I might have been getting it prior to that update.

Time since tab reload does not appear to matter as I have had it happen minutes after a reload when the tab thread had been going for many hours. Suspecting this might be related to Firefox's increasing lag with large images. The only thing that fixes it is anything that ca8uses the openOutpaint tab start a new thread/process.

Was going to add this to https://github.com/zero01101/openOutpaint-webUI-extension/issues/43, but I'm getting repo on the standalone version.

Steps to reproduce the problem

  1. Use openOutpaint for several hours
  2. Canvas disappears after tab or window focus change

What should have happened?

Canvas should be banished to the shadow realm when it gets eepy.

Commit where the problem happens

https://github.com/zero01101/openOutpaint/commit/b60b4fccdf276c0103f05060e0edb7151ff61bfc

What platforms do you use to access openOutpaint?

Linux

What browsers do you use to access the UI ?

Mozilla Firefox

Browser Extensions/Addons

Firefox 116.0.3 on Ubuntu 20.04

Extensions that are active: Tapermonkey, no scripts active for localhost uBlock Origin, disabled for localhost

Firefox privacy settings: Default (Standard) openOutpainter exempted

AUTOMATIC1111 webUI Commandline Arguments

--no-half-vae --api --opt-split-attention --cors-allow-origins=http://127.0.0.1:7860,http://127.0.0.1:3456 --no-download-sd-model

Additional information

Has no effect, any combination: Reload. Forced reload. Clearing cache/site data. Restarting openOutpaint.

What does work: Restarting Firefox. Loading in a private session, though will eventually have the same issue. Using Firefox's task manager to kill and unload the tab then reload tab. (all of these are the same effect of starting a new tab process)

Untested: Opening in new tab. I suspect this will work if Firefox runs the tab as a new thread and not under the existing thread for previous instance.

I'm possibly gonna switch using it in Chrome and see if it doesn't happen anymore. Firefox does have the issue where it becomes increasingly slower with the accumulative image data size within the tab group thread, which is an issue not unique to openOutpaint.

zero01101 commented 10 months ago

so this amazes me; like i keep saying this project was always just a silly little toy gadget doodad thing, i never once considered people, like, actively using it for HOURS AT A TIME so i'm rather honored even if it's because of a bug that ruined everything?

sorry about that, i can only imagine it's some kind of memory management/garbage collection foible but since there's really not anything specifically defined in the app it kind of relies on the browser doing that for us, so i'm not quite sure where to start looking there... i know i've accidentally left a tab with openOutpaint standalone open but idle for hours and not experienced it, but i'll have to set up some 2nd pc with a tab open with an active project or something...

Kadah commented 10 months ago

I tend to export the canvas image somewhat regually, so usually don't loose much when it happens.

Its possible some other tab running within the same thread is leading to the conditions that trigger the issue, and its also possible it could be related to the Linux build of FF. Will update if I figure out a repo.