mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-08 02:02:36 -08:00
added token counter next to txt2img and img2img prompts
This commit is contained in:
parent
ca3e5519e8
commit
5034f7d759
5 changed files with 92 additions and 9 deletions
13
javascript/helpers.js
Normal file
13
javascript/helpers.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// helper functions
|
||||
|
||||
function debounce(func, wait_time) {
|
||||
let timeout;
|
||||
return function wrapped(...args) {
|
||||
let call_function = () => {
|
||||
clearTimeout(timeout);
|
||||
func(...args)
|
||||
}
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(call_function, wait_time);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue