aboutsummaryrefslogtreecommitdiff
path: root/javascript/ui.js
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-15 18:50:56 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-01-15 18:51:04 +0300
commitd8b90ac121cbf0c18b1dc9d56a5e1d14ca51e74e (patch)
tree0b204c9db8ee98972adbc2619a41c7f508369031 /javascript/ui.js
parentebfdd7baeb660ec66f78e1a0e5e45442025f262d (diff)
big rework of progressbar/preview system to allow multiple users to prompts at the same time and do not get previews of each other
Diffstat (limited to 'javascript/ui.js')
-rw-r--r--javascript/ui.js33
1 files changed, 28 insertions, 5 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index f8279124..ecf97cb3 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -126,18 +126,41 @@ function create_submit_args(args){
return res
}
+function showSubmitButtons(tabname, show){
+ gradioApp().getElementById(tabname+'_interrupt').style.display = show ? "none" : "block"
+ gradioApp().getElementById(tabname+'_skip').style.display = show ? "none" : "block"
+}
+
function submit(){
- requestProgress('txt2img')
+ rememberGallerySelection('txt2img_gallery')
+ showSubmitButtons('txt2img', false)
+
+ var id = randomId()
+ requestProgress(id, gradioApp().getElementById('txt2img_gallery_container'), gradioApp().getElementById('txt2img_gallery'), function(){
+ showSubmitButtons('txt2img', true)
+
+ })
- return create_submit_args(arguments)
+ var res = create_submit_args(arguments)
+
+ res[0] = id
+
+ return res
}
function submit_img2img(){
- requestProgress('img2img')
+ rememberGallerySelection('img2img_gallery')
+ showSubmitButtons('img2img', false)
+
+ var id = randomId()
+ requestProgress(id, gradioApp().getElementById('img2img_gallery_container'), gradioApp().getElementById('img2img_gallery'), function(){
+ showSubmitButtons('img2img', true)
+ })
- res = create_submit_args(arguments)
+ var res = create_submit_args(arguments)
- res[0] = get_tab_index('mode_img2img')
+ res[0] = id
+ res[1] = get_tab_index('mode_img2img')
return res
}