sdwebui-w-horde / sd-webui-stable-horde-worker

Stable Horde Unofficial Worker Bridge as Stable Diffusion WebUI (AUTOMATIC1111) Extension
GNU Affero General Public License v3.0
60 stars 19 forks source link

[Bug]: Values in ui_config.json override values in worker's config #111

Open ivucica opened 1 year ago

ivucica commented 1 year ago

Is there existing issue for this?

Does this happen on the latest commit?

What happened?

Somehow, I got the values for UI elements for Stable Horde Worker saved in $WEBUI_ROOT/ui_config.json.

    "stable-horde//visible": true,
    "stable-horde//value": "Status: Stopped",
    "stable-horde/Apply Settings/visible": true,
    "stable-horde/Enable/visible": true,
    "stable-horde/Enable/value": false,
    "stable-horde/Worker Name/visible": true,
    "stable-horde/Worker Name/value": "my-old-name",
    "stable-horde/Stable Horde API Key/visible": true,
    ...

These did not get updated when I applied the config in worker tab itself, so the worker would load with the correct config out of $WEBUI_ROOT/extensions/sd-webui-stable-horde-worker/config.json.

At first I thought this could be stable-diffusion-webui-state extension, but then I realized that it might be me using the "Extensions" tab and hitting "Save" to preserve the current state.

Or it might not require hitting "Save": I have even ctrl+c'd the webui and ui_config.json got populated with the new values.

Maybe I was somehow holding the tool wrong (though I am not sure how I did it), but it seems like either the worker config's UI elements should be excluded from being saved in the extension configuration, or maybe worker should not keep its own configuration unmanaged by the core of AUTOMATIC1111's webuI?

Again, I am not sure how those landed up there -- but the old values being present there meant any time I entered new information (such as the worker name) the config would get overwritten with old information.

This issue means it's hard to modify the currently active configuration -- and it's really easy to save the old one.

For bonus points: I can't reproduce now, but looks like maybe something in my setup (maybe it's in the default setup, maybe it's Safari) is sometimes also restoring the UI state from the browser, not just from the .json file.

Steps to reproduce

  1. Open ui-config.json
  2. Add "stable-horde/Worker Name/value": "some-bad-name-override", ensuring the value doesn't match what's in the extension'sconfig.json. Same for other values, in particular ` "stable-horde/Enable/value": false,
  3. Start UI: note that the worker name from extension's config.json is respected during registration, as is the enabled flag.
  4. Open UI in the browser: visit the horde worker's tab, and observe how the values match what's in ui_config.json and not what's in use by the extension.

What did you expect to happen?

The currently active configuration is displayed, rather than the old one that got saved into ui_config.json. Anything browser may try to populate in the fields on page open / reload should be discarded and fields should be populated solely by the currently active configuration (or, at the very least, contents of the extension's config.json).

Stable Diffusion WebUI Commit SHA

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/baf6946e06249c5af9851c60171692c44ef633e0

What operating system are you seeing the problem on?

Debian / Ubuntu

What browsers are you seeing the problem on?

Other

Additional information

No response

theUpsider commented 1 year ago

Can confirm. Config doesn't reapply correctly.

MaikoTan commented 1 year ago

It looks like the ui_config.json was saved by SD-WebUI itself. Shall we just remove our config file and use the ui_config instead?

theUpsider commented 1 year ago

Sure. But verify everything is working before. Especially the selected models to host. This could be tricky.