From 3f29aa791bceea0b0de99263dd0a7f08c0551549 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Sun, 18 Sep 2022 11:14:42 +0300 Subject: altered progressbar to not rely on first progress request coming after the job has started; may help with broken progressbar some people say they have --- javascript/progressbar.js | 12 ++++++++++-- javascript/ui.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'javascript') diff --git a/javascript/progressbar.js b/javascript/progressbar.js index 1fcd544c..065f259b 100644 --- a/javascript/progressbar.js +++ b/javascript/progressbar.js @@ -24,15 +24,23 @@ onUiUpdate(function(){ img2img_preview.style.height = img2img_gallery.clientHeight + "px" } - window.setTimeout(requestProgress, 500) + window.setTimeout(requestMoreProgress, 500) }); mutationObserver.observe( progressbar, { childList:true, subtree:true }) } }) -function requestProgress(){ +function requestMoreProgress(){ btn = gradioApp().getElementById("check_progress"); if(btn==null) return; btn.click(); } + +function requestProgress(){ + btn = gradioApp().getElementById("check_progress_initial"); + if(btn==null) return; + + btn.click(); +} + diff --git a/javascript/ui.js b/javascript/ui.js index e649dc6e..c39e96a1 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -37,7 +37,7 @@ function extract_image_from_gallery_extras(gallery){ function submit(){ // this calls a function from progressbar.js - window.setTimeout(requestProgress, 500) + requestProgress() res = [] for(var i=0;i