mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-02-06 00:00:10 +00:00
Live preview images for extra networks
Same as the thumbnails in the extra networks tab, just in a small preview window during completion
This commit is contained in:
@@ -81,6 +81,15 @@ async function fetchAPI(url, json = true, cache = false) {
|
||||
return await response.text();
|
||||
}
|
||||
|
||||
// Extra network preview thumbnails
|
||||
async function getExtraNetworkPreviewURL(filename, type) {
|
||||
const previewJSON = await fetchAPI(`tacapi/v1/thumb-preview/${filename}?type=${type}`, true, true);
|
||||
if (previewJSON?.url)
|
||||
return `file=${previewJSON.url}`;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
// Debounce function to prevent spamming the autocomplete function
|
||||
var dbTimeOut;
|
||||
const debounce = (func, wait = 300) => {
|
||||
|
||||
Reference in New Issue
Block a user