[Feature Request]: Reconnect webui after crash and restart of fooocus
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What would your feature do?
It would be great if there was a simple way to reconnect the webui after a crash of the fooocus console app. It would save a lot of time for users (like myself) that routinely change settings, use advanced settings, have 3 or 4 image prompt combinations, multiple loras selected, etc., if we could just click a button to reconnect after restarting fooocus, instead of having to open a new window and go through everything on the crashed webui and copy settings every time. Fooocus crashes on me multiple times a day, generally after switching base models for the 10th or 20th or whatever time (seems there is a memory leak somewhere). Since I do a lot of checkpoint comparisons, and use pyracanny, faceswap, and image prompt at the same time quite often, it is a pain to go through every single option/dropdown/tab to continue where I left off, every dang time. Its gotten old, and ruins my mood, train of thought, and workflow. Please make this happen someday.
Proposed workflow
When fooocus crashes, and disconnection error occurs
- replace skip and stop buttons with Reconnect After restarting Fooocus and getting the "App started successful." prompt...
- User clicks Reconnect button
- Webui reconnects to fooocus, and uploads all settings and images in the upscale / image prompt / inpaint outpaint tabs
- after successful transfer of all settings and images, replace the Reconnect button with Generate button
- Yay. I'm not even mad anymore that fooocus crashed for the 999th time. It was a fleeting moment, I already forgot about it as soon as I clicked Generate.
- Profit. No more cursing and migraines. I can take the time saved to enjoy a bowl of ramen.
Additional information
My PC does not have stability issues. I'm just hitting Fooocus hard, changing checkpoints, loras, generation speeds, often, and running endless generations, abusing my GPU which is an absolute champ. Eventually the garbage piles up, something isn't cleaning up after itself properly. I never know when it will happen but it always happens right after changing the base model and clicking generate. The console never shows an error message, the last thing I see before it just dies is "Using pytorch attention in VAE."
This is possible, but not the way you've described. What would be possible is to add a "Reset UI Generation State" button or similar, which will only work when Fooocus is available again. It could then reset the preview + rendered image gallery, progress bar visibility and generate/stop/skip buttons.
@zombri-eats-brainz implemented in PR https://github.com/lllyasviel/Fooocus/pull/2727, please test. Happy to hear your feedback!
Testing it now, thank you super much for creating a fix so quickly! I'll let you know how it goes, waiting for the next crash...
It works as expected, I haven't found any issues with it so far. Now I'm going to fix my startup script to auto restart fooocus when it crashes. I am super happy this works, really wish I begged for mercy sooner. Thank you!
merged to develop, will be part of the next release 2.4.0