mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-02-20 23:14:07 +00:00
Fix keyword name check for single element dicts
(important for user defined mappings with a unique hash)
This commit is contained in:
@@ -17,7 +17,8 @@ async function load() {
|
||||
const parts = line.split(",");
|
||||
const hash = parts[0];
|
||||
const keywords = parts[1].replaceAll("| ", ", ").replaceAll("|", ", ").trim();
|
||||
const name = parts[2]?.trim() || "none"
|
||||
const lastSepIndex = parts[2]?.lastIndexOf("/") + 1 || parts[2]?.lastIndexOf("\\") + 1 || 0;
|
||||
const name = parts[2]?.substring(lastSepIndex).trim() || "none"
|
||||
|
||||
if (modelKeywordDict.has(hash) && name !== "none") {
|
||||
// Add a new name key if the hash already exists
|
||||
|
||||
@@ -452,9 +452,9 @@ async function insertTextAtCursor(textArea, result, tagword, tabCompletedWithout
|
||||
let name = result.text + ".safetensors";
|
||||
|
||||
if (nameDict) {
|
||||
if (nameDict.size > 1)
|
||||
if (nameDict.has(name))
|
||||
keywords = nameDict.get(name);
|
||||
else
|
||||
else
|
||||
keywords = nameDict.get("none");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user