diff options
author | brkirch <brkirch@users.noreply.github.com> | 2022-10-04 05:04:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 05:04:19 +0000 |
commit | b88e4ea7d6536ddc814a9101a258f87b06230019 (patch) | |
tree | 913bdda300b7082aa61429689d0a730cecda1525 /javascript | |
parent | bdaa36c84470adbdce3e98c01a69af5e95adfb02 (diff) | |
parent | 2865ef4b9ab16d56326cc805541bebcf01d099bc (diff) | |
download | stable-diffusion-webui-gfx803-b88e4ea7d6536ddc814a9101a258f87b06230019.tar.gz stable-diffusion-webui-gfx803-b88e4ea7d6536ddc814a9101a258f87b06230019.tar.bz2 stable-diffusion-webui-gfx803-b88e4ea7d6536ddc814a9101a258f87b06230019.zip |
Merge branch 'master' into master
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/hints.js | 2 | ||||
-rw-r--r-- | javascript/progressbar.js | 1 | ||||
-rw-r--r-- | javascript/textualInversion.js | 8 | ||||
-rw-r--r-- | javascript/ui.js | 27 |
4 files changed, 33 insertions, 5 deletions
diff --git a/javascript/hints.js b/javascript/hints.js index 84694eeb..e72e9338 100644 --- a/javascript/hints.js +++ b/javascript/hints.js @@ -15,7 +15,7 @@ titles = { "\u267b\ufe0f": "Reuse seed from last generation, mostly useful if it was randomed", "\u{1f3a8}": "Add a random artist to the prompt.", "\u2199\ufe0f": "Read generation parameters from prompt into user interface.", - "\uD83D\uDCC2": "Open images output directory", + "\u{1f4c2}": "Open images output directory", "Inpaint a part of image": "Draw a mask over an image, and the script will regenerate the masked area with content according to prompt", "SD upscale": "Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back", diff --git a/javascript/progressbar.js b/javascript/progressbar.js index 21f25b38..1e297abb 100644 --- a/javascript/progressbar.js +++ b/javascript/progressbar.js @@ -30,6 +30,7 @@ function check_progressbar(id_part, id_progressbar, id_progressbar_span, id_inte onUiUpdate(function(){ check_progressbar('txt2img', 'txt2img_progressbar', 'txt2img_progress_span', 'txt2img_interrupt', 'txt2img_preview', 'txt2img_gallery') check_progressbar('img2img', 'img2img_progressbar', 'img2img_progress_span', 'img2img_interrupt', 'img2img_preview', 'img2img_gallery') + check_progressbar('ti', 'ti_progressbar', 'ti_progress_span', 'ti_interrupt', 'ti_preview', 'ti_gallery') }) function requestMoreProgress(id_part, id_progressbar_span, id_interrupt){ diff --git a/javascript/textualInversion.js b/javascript/textualInversion.js new file mode 100644 index 00000000..8061be08 --- /dev/null +++ b/javascript/textualInversion.js @@ -0,0 +1,8 @@ +
+
+function start_training_textual_inversion(){
+ requestProgress('ti')
+ gradioApp().querySelector('#ti_error').innerHTML=''
+
+ return args_to_array(arguments)
+}
diff --git a/javascript/ui.js b/javascript/ui.js index bfe02410..b1053201 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -199,6 +199,26 @@ let txt2img_textarea, img2img_textarea = undefined; let wait_time = 800 let token_timeout; +function update_txt2img_tokens(...args) { + update_token_counter("txt2img_token_button") + if (args.length == 2) + return args[0] + return args; +} + +function update_img2img_tokens(...args) { + update_token_counter("img2img_token_button") + if (args.length == 2) + return args[0] + return args; +} + +function update_token_counter(button_id) { + if (token_timeout) + clearTimeout(token_timeout); + token_timeout = setTimeout(() => gradioApp().getElementById(button_id)?.click(), wait_time); +} + function submit_prompt(event, generate_button_id) { if (event.altKey && event.keyCode === 13) { event.preventDefault(); @@ -207,8 +227,7 @@ function submit_prompt(event, generate_button_id) { } } -function update_token_counter(button_id) { - if (token_timeout) - clearTimeout(token_timeout); - token_timeout = setTimeout(() => gradioApp().getElementById(button_id)?.click(), wait_time); +function restart_reload(){ + document.body.innerHTML='<h1 style="font-family:monospace;margin-top:20%;color:lightgray;text-align:center;">Reloading...</h1>'; + setTimeout(function(){location.reload()},2000) } |