stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Feature Request]: Save configuration UI settings dynamically

Open GrennKren opened this issue 2 years ago • 5 comments

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 ?

Save settings dynamically so that when reloading the page, all settings are not reset to default values based on ui-config.json

Proposed workflow

  1. First initialization using ui-config.json
  2. When a user changes the setting value, it is saved to the browser's localstorage.
  3. If the user wants to reset the settings to the default value, the user just needs to delete the configuration file or reset the localstorage.

Additional information

No response

GrennKren avatar Oct 22 '22 20:10 GrennKren

I am not familiar with the web, so I ask a question. Is local storage more suitable than cookies?

burugaria7 avatar Oct 23 '22 13:10 burugaria7

I am not familiar with the web, so I ask a question. Is local storage more suitable than cookies?

@burugaria7 Localstorage doesn't expire. Cookies are sent along with an HTTP header to the server but not for local storage as we just need to store some UI settings for the current device and browser.

GrennKren avatar Oct 24 '22 11:10 GrennKren

Would it be better to save the settings on the server side, so you can use multiple devices?

anytime a change is made log it into ui-config-.json. Then give an option to restore from a default config (ie. ui-config-defaults.json)

you could even implement profiles to swap between the different options.

PaintOnBrush avatar Oct 26 '22 00:10 PaintOnBrush

@PaintOnBrush Yes, I do like that too. But I have thought about sharing the gradio link with people I know so that it can be used together and not overlap the settings. 

But when it comes to different devices and profile swaps, I guess I don't need to bother sharing the gradio. 🤔

GrennKren avatar Oct 26 '22 10:10 GrennKren

@GrennKren Is it necessary to consider launching multiple webui sessions at the same time? In this case, referenced files or local storage may conflict.

When I tried to tackle this problem, I could not come up with a way to persist the values of Interfaces such as Textboxes and Buttons created by gradio. It would be possible if the system consisted of just html and js.

burugaria7 avatar Oct 26 '22 11:10 burugaria7

Saving settings, either via the server-side or the client-side, would be fantastic for browsers which unload the page in the background to free up RAM, and reload it when you return (Chrome for iOS is a big offender here).

glindsey avatar Dec 27 '22 21:12 glindsey

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/842

mezotaken avatar Jan 13 '23 16:01 mezotaken