aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/ui.js
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-02 18:33:22 +0000
committerGitHub <noreply@github.com>2022-10-02 18:33:22 +0000
commit688c4a914a6cb152b5f5e4088bace709ed3dcc35 (patch)
tree39c3221e99ca90b7238057bc555c5b4d63fcf960 /javascript/ui.js
parenta634c3226fd69486ce96df56f95f3fd63172305c (diff)
parent852fd90c0dcda9cb5fbbfdf0c7308ce58034935c (diff)
downloadstable-diffusion-webui-gfx803-688c4a914a6cb152b5f5e4088bace709ed3dcc35.tar.gz
stable-diffusion-webui-gfx803-688c4a914a6cb152b5f5e4088bace709ed3dcc35.tar.bz2
stable-diffusion-webui-gfx803-688c4a914a6cb152b5f5e4088bace709ed3dcc35.zip
Merge branch 'master' into 1404-script-reload-without-restart
Diffstat (limited to 'javascript/ui.js')
-rw-r--r--javascript/ui.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index e8f289b4..b1053201 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -199,12 +199,18 @@ let txt2img_textarea, img2img_textarea = undefined;
let wait_time = 800
let token_timeout;
-function submit_prompt(event, generate_button_id) {
- if (event.altKey && event.keyCode === 13) {
- event.preventDefault();
- gradioApp().getElementById(generate_button_id).click();
- return;
- }
+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) {
@@ -213,6 +219,14 @@ function update_token_counter(button_id) {
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();
+ gradioApp().getElementById(generate_button_id).click();
+ return;
+ }
+}
+
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)