diff --git a/javascript/ext_wildcards.js b/javascript/ext_wildcards.js index 0f18661..ae40110 100644 --- a/javascript/ext_wildcards.js +++ b/javascript/ext_wildcards.js @@ -41,7 +41,8 @@ class WildcardParser extends BaseTagParser { } } - wildcards.sort((a, b) => a.localeCompare(b)); + if (TAC_CFG.sortWildcardResults) + wildcards.sort((a, b) => a.localeCompare(b)); let finalResults = []; let tempResults = wildcards.filter(x => (wcWord !== null && wcWord.length > 0) ? x.toLowerCase().includes(wcWord) : x) // Filter by tagword diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index 5b66a43..f78c87d 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -190,6 +190,7 @@ async function syncOptions() { resultStepLength: opts["tac_resultStepLength"], delayTime: opts["tac_delayTime"], useWildcards: opts["tac_useWildcards"], + sortWildcardResults: opts["tac_sortWildcardResults"], useEmbeddings: opts["tac_useEmbeddings"], useHypernetworks: opts["tac_useHypernetworks"], useLoras: opts["tac_useLoras"], diff --git a/scripts/tag_autocomplete_helper.py b/scripts/tag_autocomplete_helper.py index f6c391e..b9e7f69 100644 --- a/scripts/tag_autocomplete_helper.py +++ b/scripts/tag_autocomplete_helper.py @@ -359,6 +359,7 @@ def on_ui_settings(): "tac_resultStepLength": shared.OptionInfo(100, "How many results to load at once"), "tac_delayTime": shared.OptionInfo(100, "Time in ms to wait before triggering completion again").needs_restart(), "tac_useWildcards": shared.OptionInfo(True, "Search for wildcards"), + "tac_sortWildcardResults": shared.OptionInfo(True, "Sort wildcard file contents alphabetically").info("If your wildcard files have a specific custom order, disable this to keep it"), "tac_useEmbeddings": shared.OptionInfo(True, "Search for embeddings"), "tac_useHypernetworks": shared.OptionInfo(True, "Search for hypernetworks"), "tac_useLoras": shared.OptionInfo(True, "Search for Loras"),