aboutsummaryrefslogtreecommitdiffstats
path: root/javascript
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-22 09:11:48 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-09-22 09:11:48 +0000
commit91bfc71261e160451e89f35a7c0eef66ff98877c (patch)
tree1d06de00a8c94527f572c801bbfa2eefb24fb58e /javascript
parente235d4e691e81cc3628da762b3f4ace936a44036 (diff)
downloadstable-diffusion-webui-gfx803-91bfc71261e160451e89f35a7c0eef66ff98877c.tar.gz
stable-diffusion-webui-gfx803-91bfc71261e160451e89f35a7c0eef66ff98877c.tar.bz2
stable-diffusion-webui-gfx803-91bfc71261e160451e89f35a7c0eef66ff98877c.zip
A big rework, just what you were secretly hoping for!
SD upscale moved to scripts Batch processing script removed Batch processing added to main img2img and now works with scripts img2img page UI reworked to use tabs
Diffstat (limited to 'javascript')
-rw-r--r--javascript/ui.js52
1 files changed, 47 insertions, 5 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index f3860d2e..4944800b 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -35,13 +35,36 @@ function extract_image_from_gallery_extras(gallery){
return extract_image_from_gallery(gallery);
}
-function submit(){
- // this calls a function from progressbar.js
- requestProgress()
+function get_tab_index(tabId){
+ var res = 0
+
+ gradioApp().getElementById(tabId).querySelector('div').querySelectorAll('button').forEach(function(button, i){
+ if(button.className.indexOf('bg-white') != -1)
+ res = i
+ })
+
+ return res
+}
+
+function create_tab_index_args(tabId, args){
+ var res = []
+ for(var i=0; i<args.length; i++){
+ res.push(args[i])
+ }
+ res[0] = get_tab_index(tabId)
+
+ return res
+}
+
+function get_extras_tab_index(){
+ return create_tab_index_args('mode_extras', arguments)
+}
+
+function create_submit_args(args){
res = []
- for(var i=0;i<arguments.length;i++){
- res.push(arguments[i])
+ for(var i=0;i<args.length;i++){
+ res.push(args[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.
@@ -55,11 +78,30 @@ function submit(){
return res
}
+function submit(){
+ requestProgress()
+
+ return create_submit_args(arguments)
+}
+
+function submit_img2img(){
+ requestProgress()
+
+ res = create_submit_args(arguments)
+
+ res[0] = get_tab_index('mode_img2img')
+
+ return res
+}
+
+
function ask_for_style_name(_, prompt_text, negative_prompt_text) {
name_ = prompt('Style name:')
return name_ === null ? [null, null, null]: [name_, prompt_text, negative_prompt_text]
}
+
+
opts = {}
function apply_settings(jsdata){
console.log(jsdata)