Merge pull request #65 from bedovyy/feature/prefixArtist
feat: add prefixArtist for artist tags
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
"AutocompletePlus_Autocompletion_EnableModels": {
|
||||
"name": "LoraとEmbeddingを候補に表示する"
|
||||
},
|
||||
"AutocompletePlus_Autocompletion_PrefixArtist": {
|
||||
"name": "アーティストタグの前に追加する文字列"
|
||||
},
|
||||
"AutocompletePlus_Autocompletion_ReplaceUnderscoreWithSpace": {
|
||||
"name": "'_' を 'スペース' に置き換える",
|
||||
"tooltip": "この設定は関連タグ表示にも影響します"
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
"AutocompletePlus_Autocompletion_EnableModels": {
|
||||
"name": "顯示Lora和Embedding"
|
||||
},
|
||||
"AutocompletePlus_Autocompletion_PrefixArtist": {
|
||||
"name": "在藝術家標籤前添加的字串"
|
||||
},
|
||||
"AutocompletePlus_Autocompletion_ReplaceUnderscoreWithSpace": {
|
||||
"name": "將'_'替換為'空格'",
|
||||
"tooltip": "此設定也會影響相關標籤顯示"
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
"AutocompletePlus_Autocompletion_EnableModels": {
|
||||
"name": "显示Lora和Embedding"
|
||||
},
|
||||
"AutocompletePlus_Autocompletion_PrefixArtist": {
|
||||
"name": "在艺术家标签前添加的字符串"
|
||||
},
|
||||
"AutocompletePlus_Autocompletion_ReplaceUnderscoreWithSpace": {
|
||||
"name": "将'_'替换为'空格'",
|
||||
"tooltip": "此设置也会影响相关标签显示"
|
||||
|
||||
@@ -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
|
||||
|
||||
+11
-1
@@ -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({
|
||||
},
|
||||
},
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user