fix stuck live preview

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-07-22 21:08:56 +02:00
parent d0091a0d33
commit 66f90eb31e
5 changed files with 20 additions and 17 deletions
+10 -9
View File
@@ -20,17 +20,18 @@
- networks: improve search and filtering to allow multi-words
- hotkeys: add alt+0-9 to switch to tab 0-9
- **Fixes**
- upscaler: auto-refresh to catch chainner upscalers that are not loaded on first attempt
- lora: support diffusers trainer
- load: flux1 t5
- preview: cache image for reuse
- kanvas: paint combined with zoom
- rembg: numba dependencies
- hotkeys: legacy-vs-modernui
- process: generate button busy tracking
- logger: handle invalid subsystem log messages
- attention: skip reapply
- gallery: send to caption
- hotkeys: legacy-vs-modernui
- kanvas: paint combined with zoom
- load: flux1 t5
- logger: handle invalid subsystem log messages
- lora: support diffusers trainer
- preview: acknowledge visible/hidden on finish
- preview: cache image for reuse
- process: generate button busy tracking
- rembg: numba dependencies
- upscaler: auto-refresh to catch chainner upscalers that are not loaded on first attempt
## Update for 2026-07-14
+4 -3
View File
@@ -11112,7 +11112,8 @@ function requestProgress(id_task = "undefined", progressEl = null, galleryEl = n
const startLivePreview = (taskId, id_live_preview) => {
if (window.opts.live_preview_refresh_period === 0) return;
let request_id = -1;
if (document.hidden || !previewVisible()) {
const hidden = document.hidden || !previewVisible();
if (hidden) {
if (!window.opts.live_preview_require_focus) request_id = id_live_preview;
} else {
request_id = id_live_preview;
@@ -11124,7 +11125,7 @@ function requestProgress(id_task = "undefined", progressEl = null, galleryEl = n
hasStarted = hasStarted || res.active;
if (res.completed || !res.active && (hasStarted || once)) {
debug("progress", { end: res, reason: res.completed ? "completed" : "inactive" });
if (!res.paused) removeLivePreview(true);
if (!res.paused) removeLivePreview(!hidden);
return;
}
if (elapsedFromStart > progressTimeout && !res.queued && res.progress === prevProgress) {
@@ -12221,7 +12222,7 @@ async function updateOpts(json_string) {
for (const op of monitoredOpts) {
const [key, callback] = Object.entries(op)[0];
if (Object.hasOwn(opts, key) && opts[key] !== new_opts[key]) {
log("updateOpt", key, opts[key], new_opts[key]);
log("updateOpt", { key, val: new_opts[key] });
if (callback) callback(new_opts[key], opts[key]);
}
}
+2 -2
View File
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -157,7 +157,8 @@ export function requestProgress(id_task = 'undefined', progressEl = null, galler
if (window.opts.live_preview_refresh_period === 0) return;
let request_id = -1;
if (document.hidden || !previewVisible()) {
const hidden = document.hidden || !previewVisible();
if (hidden) {
if (!window.opts.live_preview_require_focus) request_id = id_live_preview;
} else {
request_id = id_live_preview;
@@ -170,7 +171,7 @@ export function requestProgress(id_task = 'undefined', progressEl = null, galler
hasStarted = hasStarted || res.active;
if (res.completed || (!res.active && (hasStarted || once))) {
debug('progress', { end: res, reason: res.completed ? 'completed' : 'inactive' });
if (!res.paused) removeLivePreview(true); // only abort if not paused
if (!res.paused) removeLivePreview(!hidden); // only abort if not paused
return;
}
if (elapsedFromStart > progressTimeout && !res.queued && res.progress === prevProgress) {
+1 -1
View File
@@ -40,7 +40,7 @@ async function updateOpts(json_string) {
for (const op of monitoredOpts) {
const [key, callback] = Object.entries(op)[0];
if (Object.hasOwn(opts, key) && opts[key] !== new_opts[key]) {
log('updateOpt', key, opts[key], new_opts[key]);
log('updateOpt', { key, val: new_opts[key] });
if (callback) callback(new_opts[key], opts[key]);
}
}