mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-01-27 11:39:55 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
522989da8a | ||
|
|
e8cf50cdaa | ||
|
|
4af8d5285d | ||
|
|
3759ec055a |
@@ -58,8 +58,9 @@ The config contains the following settings and defaults:
|
||||
"negativePrompts": true
|
||||
},
|
||||
"maxResults": 5,
|
||||
"showAllResults": false,
|
||||
"resultStepLength": 500,
|
||||
"showAllResults": false,
|
||||
"useLeftRightArrowKeys": false,
|
||||
"replaceUnderscores": true,
|
||||
"escapeParentheses": true,
|
||||
"useWildcards": true,
|
||||
@@ -101,6 +102,7 @@ The config contains the following settings and defaults:
|
||||
| maxResults | How many results to show max. For the default tag set, the results are ordered by occurence count. For embeddings and wildcards it will show all results in a scrollable list. |
|
||||
| resultStepLength | Allows to load results in smaller batches of the specified size for better performance in long lists or if showAllResults is true. |
|
||||
| showAllResults | If true, will ignore maxResults and show all results in a scrollable list. **Warning:** can lag your browser for long lists. |
|
||||
| useLeftRightArrowKeys | If true, left and right arrows will select the first/last result in the popup instead of moving the cursor in the textbox. |
|
||||
| replaceUnderscores | If true, undescores are replaced with spaces on clicking a tag. Might work better for some models. |
|
||||
| escapeParentheses | If true, escapes tags containing () so they don't contribute to the web UI's prompt weighting functionality. |
|
||||
| useWildcards | Used to toggle the wildcard completion functionality. |
|
||||
|
||||
@@ -465,7 +465,9 @@ function navigateInList(textArea, event) {
|
||||
// Return if the function is deactivated in the UI
|
||||
if (!acActive) return;
|
||||
|
||||
validKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Escape"];
|
||||
validKeys = ["ArrowUp", "ArrowDown", "Enter", "Tab", "Escape"];
|
||||
if (acConfig.useLeftRightArrowKeys)
|
||||
validKeys.push("ArrowLeft", "ArrowRight");
|
||||
|
||||
if (!validKeys.includes(event.key)) return;
|
||||
if (!isVisible(textArea)) return
|
||||
@@ -500,11 +502,17 @@ function navigateInList(textArea, event) {
|
||||
insertTextAtCursor(textArea, results[selectedTag], tagword);
|
||||
}
|
||||
break;
|
||||
case "Tab":
|
||||
if (selectedTag === null) {
|
||||
selectedTag = 0;
|
||||
}
|
||||
insertTextAtCursor(textArea, results[selectedTag], tagword);
|
||||
break;
|
||||
case "Escape":
|
||||
hideResults(textArea);
|
||||
break;
|
||||
}
|
||||
if (selectedTag == resultCount - 1
|
||||
if (selectedTag === resultCount - 1
|
||||
&& (event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowRight")) {
|
||||
addResultsToList(textArea, results, tagword, false);
|
||||
}
|
||||
@@ -591,7 +599,7 @@ onUiUpdate(function () {
|
||||
try {
|
||||
embeddings = readFile("file/tags/temp/emb.txt").split("\n")
|
||||
.filter(x => x.trim().length > 0) // Remove empty lines
|
||||
.map(x => x.replace(".bin", "").replace(".pt", "")); // Remove file extensions
|
||||
.map(x => x.replace(".bin", "").replace(".pt", "").replace(".png", "")); // Remove file extensions
|
||||
} catch (e) {
|
||||
console.error("Error loading embeddings.txt: " + e);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ def get_wildcards():
|
||||
|
||||
def get_embeddings():
|
||||
"""Returns a list of all embeddings"""
|
||||
return [str(e.relative_to(EMB_PATH)) for e in EMB_PATH.glob("**/*") if e.suffix in {".bin", ".pt"}]
|
||||
return [str(e.relative_to(EMB_PATH)) for e in EMB_PATH.glob("**/*") if e.suffix in {".bin", ".pt", ".png"}]
|
||||
|
||||
|
||||
def write_to_temp_file(name, data):
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"maxResults": 5,
|
||||
"resultStepLength": 500,
|
||||
"showAllResults": false,
|
||||
"useLeftRightArrowKeys": false,
|
||||
"replaceUnderscores": true,
|
||||
"escapeParentheses": true,
|
||||
"useWildcards": true,
|
||||
|
||||
Reference in New Issue
Block a user