mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-02-24 08:54:09 +00:00
Fix for hash collisions as long as the mapping file specifies a name in addition
This commit is contained in:
@@ -447,7 +447,21 @@ async function insertTextAtCursor(textArea, result, tagword, tabCompletedWithout
|
||||
let keywordsLength = 0;
|
||||
if (TAC_CFG.modelKeywordCompletion && modelKeywordPath.length > 0 && (tagType === ResultType.lora || tagType === ResultType.lyco)) {
|
||||
if (result.hash && result.hash !== "NOFILE" && result.hash.length > 0) {
|
||||
let keywords = modelKeywordDict.get(result.hash);
|
||||
let keywords = null;
|
||||
let nameDict = modelKeywordDict.get(result.hash);
|
||||
let name = result.text + ".safetensors";
|
||||
|
||||
console.log(name, nameDict);
|
||||
|
||||
if (nameDict) {
|
||||
if (nameDict.size > 1)
|
||||
keywords = nameDict.get(name);
|
||||
else
|
||||
keywords = nameDict.get("none");
|
||||
}
|
||||
|
||||
console.log(keywords);
|
||||
|
||||
if (keywords && keywords.length > 0) {
|
||||
newPrompt = `${keywords}, ${newPrompt}`;
|
||||
keywordsLength = keywords.length + 2; // +2 for the comma and space
|
||||
|
||||
Reference in New Issue
Block a user