diff --git a/locales/en/settings.json b/locales/en/settings.json index 25a33cc..902440f 100644 --- a/locales/en/settings.json +++ b/locales/en/settings.json @@ -31,6 +31,9 @@ "AutocompletePlus_Autocompletion_EnableModels": { "name": "Enable Loras and Embeddings" }, + "AutocompletePlus_Autocompletion_PrefixArtist": { + "name": "String to add before artist tags" + }, "AutocompletePlus_Autocompletion_ReplaceUnderscoreWithSpace": { "name": "Replace '_' with 'Space'", "tooltip": "This setting also affects related tags display." diff --git a/locales/ja/settings.json b/locales/ja/settings.json index b163286..91ee2e4 100644 --- a/locales/ja/settings.json +++ b/locales/ja/settings.json @@ -31,6 +31,9 @@ "AutocompletePlus_Autocompletion_EnableModels": { "name": "LoraとEmbeddingを候補に表示する" }, + "AutocompletePlus_Autocompletion_PrefixArtist": { + "name": "アーティストタグの前に追加する文字列" + }, "AutocompletePlus_Autocompletion_ReplaceUnderscoreWithSpace": { "name": "'_' を 'スペース' に置き換える", "tooltip": "この設定は関連タグ表示にも影響します" diff --git a/locales/zh-TW/settings.json b/locales/zh-TW/settings.json index b4b406c..bf3f578 100644 --- a/locales/zh-TW/settings.json +++ b/locales/zh-TW/settings.json @@ -31,6 +31,9 @@ "AutocompletePlus_Autocompletion_EnableModels": { "name": "顯示Lora和Embedding" }, + "AutocompletePlus_Autocompletion_PrefixArtist": { + "name": "在藝術家標籤前添加的字串" + }, "AutocompletePlus_Autocompletion_ReplaceUnderscoreWithSpace": { "name": "將'_'替換為'空格'", "tooltip": "此設定也會影響相關標籤顯示" diff --git a/locales/zh/settings.json b/locales/zh/settings.json index 287b1f4..18a6f3f 100644 --- a/locales/zh/settings.json +++ b/locales/zh/settings.json @@ -31,6 +31,9 @@ "AutocompletePlus_Autocompletion_EnableModels": { "name": "显示Lora和Embedding" }, + "AutocompletePlus_Autocompletion_PrefixArtist": { + "name": "在艺术家标签前添加的字符串" + }, "AutocompletePlus_Autocompletion_ReplaceUnderscoreWithSpace": { "name": "将'_'替换为'空格'", "tooltip": "此设置也会影响相关标签显示" diff --git a/web/js/autocomplete.js b/web/js/autocomplete.js index 5c86a20..bdd2ee1 100644 --- a/web/js/autocomplete.js +++ b/web/js/autocomplete.js @@ -351,11 +351,13 @@ function insertTagToTextArea(inputElement, tagDataToInsert) { const needsSpaceBefore = text[replaceStart - 1] === ','; const prefix = needsSpaceBefore ? ' ' : ''; + const prefixArtist = tagDataToInsert.categoryText == 'artist' ? settingValues.prefixArtist : ''; + // Standard separator (comma + space, or empty if autoInsertComma is disabled) const needsSuffixAfter = !",:".includes(text[replaceEnd]); // TODO: If ":" is part of the emoticon, a suffix is ​​required (e.g. ":o") const suffix = (needsSuffixAfter && settingValues.autoInsertComma) ? ', ' : ''; - const textToInsertWithAffixes = prefix + normalizedTag + suffix; + const textToInsertWithAffixes = prefix + prefixArtist + normalizedTag + suffix; // --- Use execCommand for Undo support --- // 1. Select the text range to be replaced diff --git a/web/js/main.js b/web/js/main.js index 4673fa5..82e1773 100644 --- a/web/js/main.js +++ b/web/js/main.js @@ -377,6 +377,16 @@ app.registerExtension({ settingValues.enableModels = newVal; } }, + { + id: id + ".Autocompletion.PrefixArtist", + name: "String to add before artist tags", + type: "text", + defaultValue: '', + category: [name, "Autocompletion", "String to add before artist tags"], + onChange: (newVal, oldVal) => { + settingValues.prefixArtist = newVal; + } + }, { id: id + ".Autocompletion.ReplaceUnderscoreWithSpace", name: "Replace '_' with 'Space'", @@ -535,4 +545,4 @@ app.registerExtension({ }, }, ] -}); \ No newline at end of file +}); diff --git a/web/js/settings.js b/web/js/settings.js index 726fc79..5688ec6 100644 --- a/web/js/settings.js +++ b/web/js/settings.js @@ -10,6 +10,7 @@ export const settingValues = { enableModels: true, // Enable Lora and Embedding suggestions useFastSearch: false, replaceUnderscoreWithSpace: true, // Replace underscores with spaces in tag insertion + prefixArtist: '', // Prefix to be attached before artist tags autoInsertComma: true, // Related tags feature settings