Skip to content

Commit

Permalink
ui quality-of-life improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Mandic <[email protected]>
  • Loading branch information
vladmandic committed Feb 6, 2025
1 parent 47b4848 commit e018ed6
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
allows for configurable image tiling for x/y axis separately
enable in *scripts -> asymmetric tiling*
*note*: traditional symmetric tiling is achieved by setting circular mode for both x and y
- **UI**:
- force browser cache-invalidate on page load
- use correct timezone for log display
- improve settings search behavior

## Update for 2025-02-05

Expand Down
12 changes: 8 additions & 4 deletions javascript/logMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ async function logMonitor() {
while (logMonitorEl.childElementCount > 100) logMonitorEl.removeChild(logMonitorEl.firstChild);
if (atBottom) logMonitorEl.scrollTop = logMonitorEl.scrollHeight;
else logMonitorEl.parentElement.style = 'border-bottom: 2px solid var(--highlight-color);';
document.getElementById('logWarnings').innerText = logWarnings;
document.getElementById('logErrors').innerText = logErrors;
const elWarn = document.getElementById('logWarnings');
const elErr = document.getElementById('logErrors');
const modenUIBtn = document.getElementById('btn_console');
if (elWarn) elWarn.innerText = logWarnings;
if (elErr) elErr.innerText = logErrors;
if (modenUIBtn) modenUIBtn.setAttribute('error-count', logErrors > 0 ? logErrors : '');
};

document.getElementById('txt2img_gallery').style.height = opts.logmonitor_show ? '50vh' : '55vh';
document.getElementById('img2img_gallery').style.height = opts.logmonitor_show ? '50vh' : '55vh';
const txtGallery = document.getElementById('txt2img_gallery');
if (txtGallery) txtGallery.style.height = opts.logmonitor_show ? '50vh' : '55vh';
const imgGallery = document.getElementById('img2img_gallery');
if (imgGallery) imgGallery.style.height = opts.logmonitor_show ? '50vh' : '55vh';

if (!opts.logmonitor_show) {
Array.from(document.getElementsByClassName('log-monitor')).forEach((el) => el.style.display = 'none');
Expand Down
6 changes: 4 additions & 2 deletions javascript/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ onAfterUiUpdate(async () => {
});

const settingsSearch = gradioApp().querySelectorAll('#settings_search > label > textarea')[0];
let settingsTimer;
settingsSearch.oninput = (e) => {
setTimeout(() => {
if (settingsTimer) clearTimeout(settingsTimer);
settingsTimer = setTimeout(() => {
log('settingsSearch', e.target.value);
showAllSettings();
getSettingsTabs().forEach((section) => {
Expand All @@ -128,7 +130,7 @@ onAfterUiUpdate(async () => {
else setting.style.removeProperty('display');
});
});
}, 50);
}, 250);
};
});

Expand Down
9 changes: 9 additions & 0 deletions modules/sd_samplers_diffusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
SASolverScheduler,
DPMSolverSinglestepScheduler,
DPMSolverMultistepScheduler,
DPMSolverMultistepInverseScheduler,
EDMDPMSolverMultistepScheduler,
CosineDPMSolverMultistepScheduler,
DPMSolverSDEScheduler,
Expand Down Expand Up @@ -77,6 +78,10 @@
'DPM++ Cosine': { 'solver_order': 2, 'sigma_schedule': "exponential", 'prediction_type': "v-prediction" },
'DPM SDE': { 'use_karras_sigmas': False, 'use_exponential_sigmas': False, 'use_beta_sigmas': False, 'noise_sampler_seed': None, 'timestep_spacing': 'linspace', 'steps_offset': 0, },

'DPM++ 1S Inverse': { 'thresholding': False, 'sample_max_value': 1.0, 'algorithm_type': "dpmsolver++", 'solver_type': "midpoint", 'lower_order_final': True, 'use_karras_sigmas': False, 'use_exponential_sigmas': False, 'use_flow_sigmas': False, 'use_beta_sigmas': False, 'use_lu_lambdas': False, 'final_sigmas_type': 'zero', 'timestep_spacing': 'linspace', 'solver_order': 1 },
'DPM++ 2M Inverse': { 'thresholding': False, 'sample_max_value': 1.0, 'algorithm_type': "dpmsolver++", 'solver_type': "midpoint", 'lower_order_final': True, 'use_karras_sigmas': False, 'use_exponential_sigmas': False, 'use_flow_sigmas': False, 'use_beta_sigmas': False, 'use_lu_lambdas': False, 'final_sigmas_type': 'zero', 'timestep_spacing': 'linspace', 'solver_order': 2 },
'DPM++ 3M Inverse': { 'thresholding': False, 'sample_max_value': 1.0, 'algorithm_type': "dpmsolver++", 'solver_type': "midpoint", 'lower_order_final': True, 'use_karras_sigmas': False, 'use_exponential_sigmas': False, 'use_flow_sigmas': False, 'use_beta_sigmas': False, 'use_lu_lambdas': False, 'final_sigmas_type': 'zero', 'timestep_spacing': 'linspace', 'solver_order': 3 },

'DPM2 FlowMatch': { 'shift': 1, 'use_dynamic_shifting': False, 'solver_order': 2, 'sigma_schedule': None, 'use_beta_sigmas': False, 'algorithm_type': 'dpmsolver2', 'use_noise_sampler': True, 'beta_start': 0.00085, 'beta_end': 0.012 },
'DPM2a FlowMatch': { 'shift': 1, 'use_dynamic_shifting': False, 'solver_order': 2, 'sigma_schedule': None, 'use_beta_sigmas': False, 'algorithm_type': 'dpmsolver2A', 'use_noise_sampler': True, 'beta_start': 0.00085, 'beta_end': 0.012 },
'DPM2++ 2M FlowMatch': { 'shift': 1, 'use_dynamic_shifting': False, 'solver_order': 2, 'sigma_schedule': None, 'use_beta_sigmas': False, 'algorithm_type': 'dpmsolver++2M', 'use_noise_sampler': True, 'beta_start': 0.00085, 'beta_end': 0.012 },
Expand Down Expand Up @@ -128,6 +133,10 @@
SamplerData('DPM++ Cosine', lambda model: DiffusionSampler('DPM++ 2M EDM', CosineDPMSolverMultistepScheduler, model), [], {}),
SamplerData('DPM SDE', lambda model: DiffusionSampler('DPM SDE', DPMSolverSDEScheduler, model), [], {}),

SamplerData('DPM++ 1S Inverse', lambda model: DiffusionSampler('DPM++ 1S Inverse', DPMSolverMultistepInverseScheduler, model), [], {}),
SamplerData('DPM++ 2M Inverse', lambda model: DiffusionSampler('DPM++ 2M Inverse', DPMSolverMultistepInverseScheduler, model), [], {}),
SamplerData('DPM++ 3M Inverse', lambda model: DiffusionSampler('DPM++ 3M Inverse', DPMSolverMultistepInverseScheduler, model), [], {}),

SamplerData('DPM2 FlowMatch', lambda model: DiffusionSampler('DPM2 FlowMatch', FlowMatchDPMSolverMultistepScheduler, model), [], {}),
SamplerData('DPM2a FlowMatch', lambda model: DiffusionSampler('DPM2a FlowMatch', FlowMatchDPMSolverMultistepScheduler, model), [], {}),
SamplerData('DPM2++ 2M FlowMatch', lambda model: DiffusionSampler('DPM2++ 2M FlowMatch', FlowMatchDPMSolverMultistepScheduler, model), [], {}),
Expand Down
2 changes: 1 addition & 1 deletion modules/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ def get_default_modes():
options_templates.update(options_section(('huggingface', "Huggingface"), {
"huggingface_sep": OptionInfo("<h2>Huggingface</h2>", "", gr.HTML),
"diffuser_cache_config": OptionInfo(True, "Use cached model config when available"),
"huggingface_token": OptionInfo('', 'HuggingFace token'),
"huggingface_token": OptionInfo('', 'HuggingFace token', gr.Textbox, {"lines": 2}),
"diffusers_model_load_variant": OptionInfo("default", "Preferred Model variant", gr.Radio, {"choices": ['default', 'fp32', 'fp16']}),
"diffusers_vae_load_variant": OptionInfo("default", "Preferred VAE variant", gr.Radio, {"choices": ['default', 'fp32', 'fp16']}),
"custom_diffusers_pipeline": OptionInfo('', 'Load custom Diffusers pipeline'),
Expand Down
3 changes: 2 additions & 1 deletion modules/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def reload_gradio_theme():
gradio_theme = gr.themes.Base(**default_font_params)
available_themes = list_themes()
if theme_name not in available_themes:
modules.shared.log.error(f'UI theme invalid: type={modules.shared.opts.theme_type} theme="{theme_name}" available={available_themes}')
# modules.shared.log.error(f'UI theme invalid: type={modules.shared.opts.theme_type} theme="{theme_name}"')
if modules.shared.opts.theme_type == 'Standard':
theme_name = 'black-teal'
elif modules.shared.opts.theme_type == 'Modern':
Expand All @@ -99,6 +99,7 @@ def reload_gradio_theme():
modules.shared.opts.theme_type = 'Standard'
theme_name = 'black-teal'


modules.shared.opts.data['gradio_theme'] = theme_name

if theme_name.lower() in ['lobe', 'cozy-nest']:
Expand Down
2 changes: 1 addition & 1 deletion wiki
Submodule wiki updated from 1318ce to d2874e

0 comments on commit e018ed6

Please sign in to comment.