enable batched taesd

This commit is contained in:
Vladimir Mandic
2024-01-03 10:38:30 -05:00
parent a8c779a54d
commit 17b30a320e
13 changed files with 77 additions and 37 deletions
+2 -2
View File
@@ -85,7 +85,7 @@ function requestProgress(id_task, progressEl, galleryEl, atEnd = null, onProgres
let livePreview;
let img;
const init = () => {
const initLivePreview = () => {
img = new Image();
if (parentGallery) {
livePreview = document.createElement('div');
@@ -123,7 +123,7 @@ function requestProgress(id_task, progressEl, galleryEl, atEnd = null, onProgres
return;
}
setProgress(res);
if (res.live_preview && !livePreview) init();
if (res.live_preview && !livePreview) initLivePreview();
if (res.live_preview && galleryEl) img.src = res.live_preview;
if (onProgress) onProgress(res);
setTimeout(() => start(id_task, id_live_preview), opts.live_preview_refresh_period || 500);