From b28497764ff68e4202e8e21437187b3ce9783e56 Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Sun, 23 Jul 2023 11:27:02 +0200 Subject: [PATCH] Check keywords for .pt and .ckpt loras too Especially for custom keywords, the preset list mostly uses safetensors --- javascript/tagAutocomplete.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index 6281b72..cfad76a 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -449,12 +449,18 @@ async function insertTextAtCursor(textArea, result, tagword, tabCompletedWithout if (result.hash && result.hash !== "NOFILE" && result.hash.length > 0) { let keywords = null; let nameDict = modelKeywordDict.get(result.hash); - let name = result.text + ".safetensors"; + let names = [result.text + ".safetensors", result.text + ".pt", result.text + ".ckpt"]; if (nameDict) { - if (nameDict.has(name)) - keywords = nameDict.get(name); - else + let found = false; + names.forEach(name => { + if (!found && nameDict.has(name)) { + found = true; + keywords = nameDict.get(name); + } + }); + + if (!found) keywords = nameDict.get("none"); }