fix full-screen image-viewer toolbar actions with control tab

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-10-22 14:35:41 -04:00
parent 0faf61f48a
commit f4a8776108
3 changed files with 13 additions and 4 deletions
+1
View File
@@ -22,6 +22,7 @@
- fix `wan-2.2-5b` vae decode
- disabling live preview should not disable progress updates
- video tab create `params.txt` with metadata
- fix full-screen image-viewer toolbar actions with control tab
## Update for 2025-10-18
+11 -3
View File
@@ -52,12 +52,15 @@ function modalImageSwitch(offset) {
}
function modalSaveImage(event) {
if (gradioApp().getElementById('tab_txt2img').style.display !== 'none') gradioApp().getElementById('save_txt2img').click();
else if (gradioApp().getElementById('tab_img2img').style.display !== 'none') gradioApp().getElementById('save_img2img').click();
else if (gradioApp().getElementById('tab_process').style.display !== 'none') gradioApp().getElementById('save_extras').click();
const tabName = getENActiveTab();
const saveBtn = gradioApp().getElementById(`save_${tabName}`);
log('modalSaveImage', tabName, saveBtn);
if (saveBtn) saveBtn.click();
modalImageSwitch(0);
}
function modalKeyHandler(event) {
log('modalKeyHandler', event.key);
switch (event.key) {
case 's':
modalSaveImage();
@@ -158,6 +161,7 @@ function modalZoomToggle(event) {
const modalImage = gradioApp().getElementById('modalImage');
modalZoomSet(modalImage, !modalImage.classList.contains('modalImageFullscreen'));
event.stopPropagation();
modalImageSwitch(0);
}
function modalTileToggle(event) {
@@ -172,12 +176,15 @@ function modalTileToggle(event) {
modal.style.setProperty('background-image', `url(${modalImage.src})`);
}
event.stopPropagation();
modalImageSwitch(0);
}
function modalResetInstance(event) {
const modalImage = document.getElementById('modalImage');
previewInstance.dispose();
previewInstance = panzoom(modalImage, { zoomSpeed: 0.05, minZoom: 0.1, maxZoom: 5.0, filterKey: (/* e, dx, dy, dz */) => true });
event.stopPropagation();
modalImageSwitch(0);
}
function modalToggleParams(event) {
@@ -188,6 +195,7 @@ function modalToggleParams(event) {
modalExif.style.display = 'none';
}
event.stopPropagation();
modalImageSwitch(0);
}
function galleryClickEventHandler(event) {
+1 -1
View File
@@ -259,7 +259,7 @@ options_templates.update(options_section(('vae_encoder', "Variational Auto Encod
"sd_vae": OptionInfo("Automatic", "VAE model", gr.Dropdown, lambda: {"choices": shared_items.sd_vae_items()}, refresh=shared_items.refresh_vae_list),
"diffusers_vae_upcast": OptionInfo("default", "VAE upcasting", gr.Radio, {"choices": ['default', 'true', 'false']}),
"no_half_vae": OptionInfo(False if not cmd_opts.use_openvino else True, "Full precision (--no-half-vae)"),
"diffusers_vae_slicing": OptionInfo(cmd_opts.lowvram or cmd_opts.medvram, "VAE slicing", gr.Checkbox),
"diffusers_vae_slicing": OptionInfo(True, "VAE slicing", gr.Checkbox),
"diffusers_vae_tiling": OptionInfo(cmd_opts.lowvram, "VAE tiling", gr.Checkbox),
"diffusers_vae_tile_size": OptionInfo(0, "VAE tile size", gr.Slider, {"minimum": 0, "maximum": 4096, "step": 8 }),
"diffusers_vae_tile_overlap": OptionInfo(0.25, "VAE tile overlap", gr.Slider, {"minimum": 0, "maximum": 0.95, "step": 0.05 }),