added token counter next to txt2img and img2img prompts

This commit is contained in:
Liam
2022-09-27 15:56:18 -04:00
parent ca3e5519e8
commit 5034f7d759
5 changed files with 92 additions and 9 deletions

13
javascript/helpers.js Normal file
View 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);
};
}