mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-22 15:16:47 -08:00
added token counter next to txt2img and img2img prompts
This commit is contained in:
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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user