Repository: stable-diffusion-webui
Issue: [Bug]: Defaults in settings shows no changes when removing the last style
Labels: bug-report

### Checklist

- [ ] The issue exists after disabling all extensions
- [ ] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [X] The issue exists in the current version of the webui
- [ ] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

When using the "Defaults" functionality of settings (detects changes and saves them in ui-config.json), it is meant to detect changes made in the UI, so that they can be saved.
However, some settings aren't properly detected, such as:

- When removing the last "style" preset
- Kohya Hires.fix being enabled

Both of these work in Forge/ReForge for me and save properly there.

### Steps to reproduce the problem

1. Add a Style from the styles list (create some if you have none)
![image](https://github.com/user-attachments/assets/1f312955-5011-4195-a6d6-f864704382e9)
2. Go to Settings.
3. Go to Defaults in the menu to the left.
4. Click View Changes. It should detect the change you made.
5. Click Save Changes.
6. Restart A1111. The style should now be enabled by default
7. Repeat steps 1-6 but instead remove the style. On step 4 it fails to detect the change.


Similarly for the Kohya Hires.fix.
1. Install and enable Kohya Hires.fix extension (https://github.com/wcde/sd-webui-kohya-hiresfix)
2. Restart A1111.
3. Enable Kohya Hires.fix in the extending menu on the txt2img page.
4. Go to Settings.
5. Go to Defaults in the menu to the left.
6. Click View Changes. It should detect the change you made, but it fails to, so it cannot save the default.


### What should have happened?

![image](https://github.com/user-attachments/assets/8c84a906-708d-45a4-b2ae-9431062829bd)

For the clearing of the styles, it should have saved the following values to the ui-config.json:

- "txt2img/Styles/value": [],

Setting this manually in the config works fine.

--------------------------------------------------------------------------

For Kohya Hires.fix, this should have saved the following values to the ui-config.json:

- "customscript/kohya_hrfix.py/txt2img/Enabled/visible": true,
- "customscript/kohya_hrfix.py/txt2img/Enabled/value": true,

At least it does in ReForge. It could be that it needs a different path for A1111, unsure.

Setting this manually in the config doesn't work.

### What browsers do you use to access the UI ?

Mozilla Firefox

### Sysinfo

Nah, you're good without it.

### Console logs

```Shell
None of this shows up in the console logs.


Requirement already satisfied: opencv-python in c:\python310\lib\site-packages (4.10.0.84)
Requirement already satisfied: numpy>=1.21.2 in c:\python310\lib\site-packages (from opencv-python) (1.26.4)
Update complete.
CHv1.8.10: Get Custom Model Folder
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
[-] ADetailer initialized. version: 24.6.0, num models: 70
ControlNet preprocessor location: C:\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2024-08-01 09:48:49,017 - ControlNet - INFO - ControlNet v1.1.452
[sd-webui-freeu] Controlnet support: *enabled*
09:48:50 - ReActor - STATUS - Running v0.7.1-a1 on Device: CPU
ProteusV0.3.safetensors
ProteusV0.3
Thumbnailizer initialized
Loading weights [77d65e8d88] from C:\AI\stable-diffusion-webui\models\Stable-diffusion\Checkpoints\Checkpoints\1.5\01 - Photorealistic\absoluteBabes_v10.safetensors
Creating model from config: C:\AI\stable-diffusion-webui\configs\v1-inference.yaml
CHv1.8.10: Set Proxy:
Loading VAE weights specified in settings: C:\AI\stable-diffusion-webui\models\VAE\VAE\1.5\RandoMix3.vae.pt
Applying attention optimization: xformers... done.
Model loaded in 8.5s (load weights from disk: 0.9s, create model: 0.7s, apply weights to model: 2.4s, load VAE: 0.6s, load textual inversion embeddings: 3.5s, calculate empty prompt: 0.3s).
2024-08-01 09:49:00,412 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 36.2s (prepare environment: 13.5s, import torch: 2.8s, import gradio: 0.7s, setup paths: 0.8s, initialize shared: 0.2s, other imports: 0.8s, list SD models: 1.5s, load scripts: 4.9s, scripts before_ui_callback: 1.7s, create ui: 8.7s, gradio launch: 0.5s).
```
```


### Additional information

I'm on latest GPU drivers (mid-July 2024).