improve settings search

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-05-17 09:59:38 +02:00
parent dd796552db
commit 2270580a40
4 changed files with 29 additions and 12 deletions
+1
View File
@@ -28,6 +28,7 @@
- custom `vae` loader
- `attention` execution guard against `cpu` tensors
- downloaded diffuser model use `snapshot` path
- improve `settings` search
## Update for 2026-05-13
+25 -11
View File
@@ -138,19 +138,33 @@ async function onAfterUiUpdateCallback() {
const settingsSearch = gradioApp().querySelectorAll('#settings_search > label > textarea')[0];
let settingsTimer;
let settingSearchValue = '';
function doSettingsSearch() {
if (settingSearchValue === settingsSearch.value.trim().toLowerCase()) return;
showAllSettings();
const value = settingsSearch.value.trim().toLowerCase();
log('doSettingsSearch', value);
settingSearchValue = value;
getSettingsTabs().forEach((section) => {
section.querySelectorAll('.dirtyable').forEach((setting) => {
const visible = setting.innerText.toLowerCase().includes(value) || setting.id.toLowerCase().includes(value);
const parent = setting.closest('.settings_section');
if (!visible) parent.style.display = 'none';
else parent.style.removeProperty('display');
});
});
}
settingsSearch.oninput = (e) => {
if (settingsTimer) clearTimeout(settingsTimer);
settingsTimer = setTimeout(() => {
log('settingsSearch', e.target.value);
showAllSettings();
getSettingsTabs().forEach((section) => {
section.querySelectorAll('.dirtyable').forEach((setting) => {
const visible = setting.innerText.toLowerCase().includes(e.target.value.toLowerCase()) || setting.id.toLowerCase().includes(e.target.value.toLowerCase());
if (!visible) setting.style.display = 'none';
else setting.style.removeProperty('display');
});
});
}, 250);
settingsTimer = setTimeout(doSettingsSearch, 250);
};
settingsSearch.onkeypress = (e) => {
if (e.key === 'Enter') {
if (settingsTimer) clearTimeout(settingsTimer);
doSettingsSearch();
}
};
}
+2
View File
@@ -140,6 +140,7 @@ def create_settings(cmd_opts):
# --- Model Quantization ---
options_templates.update(options_section(("quantization", "Model Quantization"), {
"quantize_sep": OptionInfo("<h2>Quantization General</h2>", "", gr.HTML),
"models_not_to_quant": OptionInfo("", "Model types not to quantize"),
"sdnq_quantize_sep": OptionInfo("<h2>SDNQ: SD.Next Quantization</h2>", "", gr.HTML),
@@ -570,6 +571,7 @@ def create_settings(cmd_opts):
# --- Postprocessing ---
options_templates.update(options_section(('postprocessing', "Postprocessing"), {
"postprocessing_sep": OptionInfo("<h2>Postprocessing Operations</h2>", "", gr.HTML),
'postprocessing_enable_in_main_ui': OptionInfo([], "Additional postprocessing operations", gr.Dropdown, lambda: {"multiselect":True, "choices": [x.name for x in shared_items.postprocessing_scripts()]}),
'postprocessing_operation_order': OptionInfo([], "Postprocessing operation order", gr.Dropdown, lambda: {"multiselect":True, "choices": [x.name for x in shared_items.postprocessing_scripts()], "visible": False }),