diff options
author | WDevelopsWebApps <97454358+WDevelopsWebApps@users.noreply.github.com> | 2022-09-29 10:19:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-29 10:19:13 +0000 |
commit | f28ce3e3a17ccd9b4a03317031a4e3caa1a3088f (patch) | |
tree | 9f57cde73305695cce558cd8a172b4974a02ee1d /javascript | |
parent | 03ee67bfd34b9e872b33eb05fef5db83410b16f3 (diff) | |
parent | be5555fce4612fdfb4a06e831e3f1a8d055fdf9a (diff) | |
download | stable-diffusion-webui-gfx803-f28ce3e3a17ccd9b4a03317031a4e3caa1a3088f.tar.gz stable-diffusion-webui-gfx803-f28ce3e3a17ccd9b4a03317031a4e3caa1a3088f.tar.bz2 stable-diffusion-webui-gfx803-f28ce3e3a17ccd9b4a03317031a4e3caa1a3088f.zip |
Merge branch 'master' into saving
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/hints.js | 1 | ||||
-rw-r--r-- | javascript/ui.js | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/javascript/hints.js b/javascript/hints.js index 59dd770c..96cd24d5 100644 --- a/javascript/hints.js +++ b/javascript/hints.js @@ -15,6 +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", "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/ui.js b/javascript/ui.js index 7db4db48..562d2552 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -182,4 +182,23 @@ onUiUpdate(function(){ }); json_elem.parentElement.style.display="none" + + if (!txt2img_textarea) { + txt2img_textarea = gradioApp().querySelector("#txt2img_prompt > label > textarea"); + txt2img_textarea?.addEventListener("input", () => update_token_counter("txt2img_token_button")); + } + if (!img2img_textarea) { + img2img_textarea = gradioApp().querySelector("#img2img_prompt > label > textarea"); + img2img_textarea?.addEventListener("input", () => update_token_counter("img2img_token_button")); + } }) + +let txt2img_textarea, img2img_textarea = undefined; +let wait_time = 800 +let token_timeout; + +function update_token_counter(button_id) { + if (token_timeout) + clearTimeout(token_timeout); + token_timeout = setTimeout(() => gradioApp().getElementById(button_id)?.click(), wait_time); +} |