vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.56k stars 409 forks source link

[Issue]: disabling a built in extension reenables all others #1660

Closed zethfoxster closed 1 year ago

zethfoxster commented 1 year ago

Issue Description

as title states, disabling a builtin extension seems to flip all other disabled extensions back to enabled after hitting apply, completely closing the ui/cli they remain enabled. You can then go down the list disabling everything again and the settings will stick, but if you change your mind later and disable another built in one, the behavior happens again. I was cleaning up my ui of extensions I don't use like tiled diffusion,

Version Platform Description

N/A

Acknowledgements

vladmandic commented 1 year ago

i'm aware that extensions sometimes misteriously re-enable, but i cannot reproduce using this workflow. there has to be something else in the mix...

zethfox commented 1 year ago

I can attempt to get you a solid repro of this using a base install tonight. I'll report back if I find a method that does it 100% of the time.

vladmandic commented 1 year ago

thanks

zethfoxster commented 1 year ago

I can't get a solid repro, its too random, messing with the extensions enabling/disabling different ones over the course of a whole hour, I only managed to get it to happen 2 times. I did notice that "Lora" shows as enabled even after disabling. other than that im stumped. If I manage to get it happening with a frequency that you can debug I'll be sure to come back to this post to reopen.

vladmandic commented 1 year ago

i've reopened it as its definitely an issue - the fact that we both cannot find exact scenario is misterious, but doesn't mean it should be ignored and issue closed. perhaps someone chimes in.

James-Willer commented 1 year ago

I can confirm I have this same issue Its just too random

vladmandic commented 1 year ago

Maybe I can help reproducing it, at least I could do it two times in a row. Also there seems to be the issue that after uninstalling one extension, all installed and built-in extension disappear from the list and you can only install new extensions.

installing a new extension or updating existing extensions returns blank list because it clearly states restart required, that is by design.

and the second scenario is not something i can reproduce. so big question is what causes extensions to sometimes auto re-enable.

vladmandic commented 1 year ago

debug flag does help and also added some debug statements in browser console. so combination of both should help - if you can reproduce clearly.

James-Willer commented 1 year ago
09:48:26-842313 DEBUG    Extensions list loaded: C:\Users\Kai\automatic\html\extensions.json
09:48:32-795776 DEBUG    Extensions apply: disable=[] update=[]

when installing an extension the list having the name of disabled extensions is overwritten with an empty list

vladmandic commented 1 year ago

that's not it, i tried and works fine:

07:42:17-284905 DEBUG    Updated extensions list: 204 https://vladmandic.github.io/sd-data/pages/extensions.json
07:42:17-286496 DEBUG    Extensions list loaded: /home/vlado/dev/sdnext/html/extensions.json
07:42:27-791285 INFO     Extension install: https://github.com/adieyal/sd-dynamic-prompts.git
07:42:27-792595 INFO     Installing extension: https://github.com/adieyal/sd-dynamic-prompts.git into /home/vlado/dev/sdnext/extensions/sd-dynamic-prompts
07:42:30-175217 DEBUG    Running extension installer: /home/vlado/dev/sdnext/extensions/sd-dynamic-prompts/install.py
07:42:52-703068 INFO     Exiting
07:42:54-880713 INFO     Starting SD.Next
08:00:29-120236 INFO     Disabled extensions: ['sd-dynamic-thresholding', 'sd-webui-controlnet', 'multidiffusion-upscaler-for-automatic1111', 'a1111-sd-webui-lycoris']
08:00:29-120820 INFO     Enabled extensions-builtin: ['stable-diffusion-webui-images-browser', 'sd-webui-agent-scheduler', 'clip-interrogator-ext', 'ScuNET', 'stable-diffusion-webui-rembg', 'sd-extension-system-info', 'SwinIR', 'LDSR', 'Lora']
08:00:29-121592 INFO     Enabled extensions: ['sd-dynamic-prompts']
vladmandic commented 1 year ago

run webui --debug so log is more detailed and just document workflow and try to get parts of the log as in my entry above (no need for entire log as it can be quite log)

James-Willer commented 1 year ago
Running on local URL:  http://127.0.0.1:7860
12:24:06-703743 INFO     Local URL: http://127.0.0.1:7860/
12:24:06-706251 DEBUG    Gradio registered functions: 1112
12:24:06-707265 INFO     Initializing middleware
12:24:06-711424 DEBUG    Creating API
Civitai: Check resources for missing preview images
12:24:06-803822 DEBUG    Scripts setup: ['Tiled Diffusion:0.027s', 'ADetailer:0.107s', 'X/Y/Z grid:0.006s']
12:24:06-805844 DEBUG    Scripts components: []
12:24:06-806873 DEBUG    Model metadata: C:\Users\Kai\automatic\metadata.json no changes
12:24:06-807871 DEBUG    Model auto load disabled
12:24:06-808907 INFO     Startup time: 19.1s (torch=5.3s gradio=0.9s libraries=2.8s vae=0.2s codeformer=0.1s
                         scripts=6.7s onchange=0.5s ui-txt2img=0.2s ui-img2img=0.1s ui-settings=0.1s ui-extensions=1.7s
                         launch=0.2s app-started=0.1s)
Civitai: Found 5 resources missing preview images
Civitai: Found 1 hash matches
Civitai: Updated 0 preview images
12:25:59-814785 DEBUG    Server alive=True Requests=2 memory used: 0.94 total: 15.42
12:26:22-562295 INFO     Extension install: https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper.git
12:26:22-564293 INFO     Installing extension: https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper.git
                         into C:\Users\Kai\automatic\extensions\Stable-Diffusion-Webui-Civitai-Helper
12:26:31-932229 DEBUG    Extensions apply: disable=[] update=[]
12:26:31-934605 DEBUG    Saving settings: C:\Users\Kai\automatic\config.json len=14734

not sure what causes but I reproduce it now

vladmandic commented 1 year ago

i think i got it, its if you search for extension first so list is filtered and then install/uninstall from filtered list. if there were disabled extensions outside of what filtered list shows, those will get reset. working on a fix.

vladmandic commented 1 year ago

there was another one when extension uninstall incorrectly reset the extension list. both are fixed.