mirror of
https://github.com/vladmandic/automatic
synced 2026-09-12 07:58:43 +02:00
enable batched taesd
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
function controlInputMode(inputMode, ...args) {
|
||||
if (!gradioApp().getElementById('control_input_select').classList.contains('hidden')) inputMode = 'Select';
|
||||
else if (!gradioApp().getElementById('control_input_resize').classList.contains('hidden')) inputMode = 'Outpaint';
|
||||
else if (!gradioApp().getElementById('control_input_inpaint').classList.contains('hidden')) inputMode = 'Inpaint';
|
||||
const tab = gradioApp().querySelector('#control-tab-input button.selected');
|
||||
if (!tab) return ['Select', ...args];
|
||||
inputMode = tab.innerText;
|
||||
if (inputMode === 'Image') {
|
||||
if (!gradioApp().getElementById('control_input_select').classList.contains('hidden')) inputMode = 'Select';
|
||||
else if (!gradioApp().getElementById('control_input_resize').classList.contains('hidden')) inputMode = 'Outpaint';
|
||||
else if (!gradioApp().getElementById('control_input_inpaint').classList.contains('hidden')) inputMode = 'Inpaint';
|
||||
}
|
||||
return [inputMode, ...args];
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user