Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore the progress from session lost / tab reload #7595

Merged
merged 9 commits into from
Apr 29, 2023

Conversation

siutin
Copy link
Contributor

@siutin siutin commented Feb 6, 2023

Describe what this pull request is trying to achieve.

This PR attempts to restore the progress bar from session lost / tab reload

Environment this was tested in

  • OS: Ubuntu 22.04
  • Browser: Firefox 109.0.1 (64bit)

Screenshots or videos of your changes

stable-diffusion-webui-restore-progress.mp4

@siutin siutin changed the title restore the progress bar from session lost / tab reload restore the progress from session lost / tab reload Feb 6, 2023
@hithereai
Copy link
Collaborator

@siutin could you please resolve the conflicts so auto will be, in theory, able to review it?

@AUTOMATIC1111
Copy link
Owner

my problems with it:

  1. this allows you to "restore" other users' generations.
  2. considering (1), preventing img2img showing up in text2img seems not to be really necessary, and I don't want to add stuff to task ids just for that
  3. it's a fairly uncommon thing to do for user and it takes half the space away from the most useful button in the whole program

@siutin
Copy link
Contributor Author

siutin commented Mar 27, 2023

  1. That would require multiple user support. I'm not quite familiar with it, but I could have a look.
  2. This PR can restore progress for both txt2img and img2img.
    Therefore I'm not quite sure I understand this, maybe I'm missing something here?
  3. I can try making the button smaller or explore other options. Do you have any preferences on this?

my problems with it:

  1. this allows you to "restore" other users' generations.
  2. considering (1), preventing img2img showing up in text2img seems not to be really necessary, and I don't want to add stuff to task ids just for that
  3. it's a fairly uncommon thing to do for user and it takes half the space away from the most useful button in the whole program

@AUTOMATIC1111
Copy link
Owner

1 - how about saving task id locally in the browser (js localstorage) and using that to restore the session

2 - I'd like to not add any changes to task ids for simplicity and if the side effect of that is that you can load img2img results in text2img tab, that's not a problem

3 - well, how about a button below generate along with other buttons in that row.

As an extra together with (1) the button can be made only visible if the task id is stored locally and not visible otherwise, and local task id would be emptied after a generation finishes so the button would normally be hidden. this is getting fairly complex considering user can have multiple tabs open so maybe this extra can be dumped...

@siutin
Copy link
Contributor Author

siutin commented Mar 27, 2023

  1. It seems like back-end support would be a more appropriate way on this ...
  2. Okay
  3. No problem

@siutin siutin force-pushed the feature/restore-progress branch 2 times, most recently from dfe3ef4 to e30aee6 Compare April 17, 2023 03:57
@siutin
Copy link
Contributor Author

siutin commented Apr 24, 2023

I've made some changes based on the feedback I received. For (1), I updated the Task API to be user-specific when authentication is enabled. This means that users won't be able to restore someone else's work unless they have the exact task ID. I hope this addresses the concern.

newui

@AUTOMATIC1111 AUTOMATIC1111 changed the base branch from master to dev April 29, 2023 19:13
@AUTOMATIC1111 AUTOMATIC1111 merged commit 80987c3 into AUTOMATIC1111:dev Apr 29, 2023
AUTOMATIC1111 added a commit that referenced this pull request Apr 29, 2023
@AUTOMATIC1111
Copy link
Owner

I ended up doing an independent implementation that tracks task id in browser locally and uses that to restore, showing the button only if the task id exists for a task that wasn't finished properly in the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants