Add sha256 (V2) keyword lookup

As discussed in #245
This commit is contained in:
DominikDoom
2023-10-06 16:46:18 +02:00
parent 44c5450b28
commit 5ebe22ddfc
2 changed files with 21 additions and 2 deletions

View File

@@ -512,6 +512,14 @@ async function insertTextAtCursor(textArea, result, tagword, tabCompletedWithout
let nameDict = modelKeywordDict.get(result.hash);
let names = [result.text + ".safetensors", result.text + ".pt", result.text + ".ckpt"];
// No match, try to find a sha256 match from the cache file
if (!nameDict) {
const sha256 = await fetchAPI(`/tacapi/v1/lora-cached-hash/${result.text}`)
if (sha256) {
nameDict = modelKeywordDict.get(sha256);
}
}
if (nameDict) {
let found = false;
names.forEach(name => {