diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-17 05:03:47 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-17 05:03:47 +0000 |
commit | c441ba065c5ebe16d3508d5878709ce3fd3185ab (patch) | |
tree | f3c4bef514bfdcc5d10528b2f251fb0ffeb73f9e /script.js | |
parent | 6168d09218073c369fd08b7208f93805f624ec05 (diff) | |
download | stable-diffusion-webui-gfx803-c441ba065c5ebe16d3508d5878709ce3fd3185ab.tar.gz stable-diffusion-webui-gfx803-c441ba065c5ebe16d3508d5878709ce3fd3185ab.tar.bz2 stable-diffusion-webui-gfx803-c441ba065c5ebe16d3508d5878709ce3fd3185ab.zip |
add a comment and some checks for the functionality of the last PR
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -177,9 +177,18 @@ function submit(){ window.setTimeout(requestProgress, 500) res = [] - for(var i=0;i<arguments.length - 3;i++){ + for(var i=0;i<arguments.length;i++){ res.push(arguments[i]) } + + // As it is currently, txt2img and img2img send back the previous output args (txt2img_gallery, generation_info, html_info) whenever you generate a new image. + // This can lead to uploading a huge gallery of previously generated images, which leads to an unnecessary delay between submitting and beginning to generate. + // I don't know why gradio is seding outputs along with inputs, but we can prevent sending the image gallery here, which seems to be an issue for some. + // If gradio at some point stops sending outputs, this may break something + if(Array.isArray(res[res.length - 3])){ + res[res.length - 3] = null + } + return res } |