From 1147725fd74de646b563f408923b4272dc90c098 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Mon, 15 Sep 2025 12:23:46 +0800 Subject: [PATCH] feat(settings): add base model, author, and first tag option to download path templates refactor(constants): reorder preset tag suggestions for consistency --- locales/de.json | 1 + locales/en.json | 1 + locales/es.json | 1 + locales/fr.json | 1 + locales/ja.json | 1 + locales/ko.json | 1 + locales/ru.json | 1 + locales/zh-CN.json | 1 + locales/zh-TW.json | 1 + py/utils/constants.py | 6 +++--- static/js/utils/constants.js | 10 ++++++++-- templates/components/modals/settings_modal.html | 3 +++ 12 files changed, 23 insertions(+), 5 deletions(-) diff --git a/locales/de.json b/locales/de.json index 0f667920..bcff9fc9 100644 --- a/locales/de.json +++ b/locales/de.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "Basis-Modell + Erster Tag", "baseModelAuthor": "Basis-Modell + Autor", "authorFirstTag": "Autor + Erster Tag", + "baseModelAuthorFirstTag": "Basis-Modell + Autor + Erster Tag", "customTemplate": "Benutzerdefinierte Vorlage" }, "customTemplatePlaceholder": "Benutzerdefinierte Vorlage eingeben (z.B. {base_model}/{author}/{first_tag})", diff --git a/locales/en.json b/locales/en.json index 306ba26b..237755c0 100644 --- a/locales/en.json +++ b/locales/en.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "Base Model + First Tag", "baseModelAuthor": "Base Model + Author", "authorFirstTag": "Author + First Tag", + "baseModelAuthorFirstTag": "Base Model + Author + First Tag", "customTemplate": "Custom Template" }, "customTemplatePlaceholder": "Enter custom template (e.g., {base_model}/{author}/{first_tag})", diff --git a/locales/es.json b/locales/es.json index f8aa33e9..a4a8f401 100644 --- a/locales/es.json +++ b/locales/es.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "Modelo base + primera etiqueta", "baseModelAuthor": "Modelo base + autor", "authorFirstTag": "Autor + primera etiqueta", + "baseModelAuthorFirstTag": "Modelo base + autor + primera etiqueta", "customTemplate": "Plantilla personalizada" }, "customTemplatePlaceholder": "Introduce plantilla personalizada (ej., {base_model}/{author}/{first_tag})", diff --git a/locales/fr.json b/locales/fr.json index 7fc405b8..b492d805 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "Modèle de base + Premier tag", "baseModelAuthor": "Modèle de base + Auteur", "authorFirstTag": "Auteur + Premier tag", + "baseModelAuthorFirstTag": "Modèle de base + Auteur + Premier tag", "customTemplate": "Modèle personnalisé" }, "customTemplatePlaceholder": "Entrez un modèle personnalisé (ex: {base_model}/{author}/{first_tag})", diff --git a/locales/ja.json b/locales/ja.json index 80488619..f2f889d4 100644 --- a/locales/ja.json +++ b/locales/ja.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "ベースモデル + 最初のタグ", "baseModelAuthor": "ベースモデル + 作成者", "authorFirstTag": "作成者 + 最初のタグ", + "baseModelAuthorFirstTag": "ベースモデル + 作成者 + 最初のタグ", "customTemplate": "カスタムテンプレート" }, "customTemplatePlaceholder": "カスタムテンプレートを入力(例:{base_model}/{author}/{first_tag})", diff --git a/locales/ko.json b/locales/ko.json index bb8dbe37..4f329b89 100644 --- a/locales/ko.json +++ b/locales/ko.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "베이스 모델 + 첫 번째 태그", "baseModelAuthor": "베이스 모델 + 제작자", "authorFirstTag": "제작자 + 첫 번째 태그", + "baseModelAuthorFirstTag": "베이스 모델 + 제작자 + 첫 번째 태그", "customTemplate": "사용자 정의 템플릿" }, "customTemplatePlaceholder": "사용자 정의 템플릿 입력 (예: {base_model}/{author}/{first_tag})", diff --git a/locales/ru.json b/locales/ru.json index 99f61f5e..a0e78b34 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "Базовая модель + Первый тег", "baseModelAuthor": "Базовая модель + Автор", "authorFirstTag": "Автор + Первый тег", + "baseModelAuthorFirstTag": "Базовая модель + Автор + Первый тег", "customTemplate": "Пользовательский шаблон" }, "customTemplatePlaceholder": "Введите пользовательский шаблон (например, {base_model}/{author}/{first_tag})", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index 7c01d9ac..9b713351 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "基础模型 + 首标签", "baseModelAuthor": "基础模型 + 作者", "authorFirstTag": "作者 + 首标签", + "baseModelAuthorFirstTag": "基础模型 + 作者 + 首标签", "customTemplate": "自定义模板" }, "customTemplatePlaceholder": "输入自定义模板(如:{base_model}/{author}/{first_tag})", diff --git a/locales/zh-TW.json b/locales/zh-TW.json index 4846649c..1c70b7c3 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -240,6 +240,7 @@ "baseModelFirstTag": "基礎模型 + 第一標籤", "baseModelAuthor": "基礎模型 + 作者", "authorFirstTag": "作者 + 第一標籤", + "baseModelAuthorFirstTag": "基礎模型 + 作者 + 第一標籤", "customTemplate": "自訂範本" }, "customTemplatePlaceholder": "輸入自訂範本(例如:{base_model}/{author}/{first_tag})", diff --git a/py/utils/constants.py b/py/utils/constants.py index 88932766..243badff 100644 --- a/py/utils/constants.py +++ b/py/utils/constants.py @@ -53,8 +53,8 @@ AUTO_ORGANIZE_BATCH_SIZE = 50 # Process models in batches to avoid overwhelming # Civitai model tags in priority order for subfolder organization CIVITAI_MODEL_TAGS = [ - 'character', 'style', 'concept', 'clothing', - 'realistic', 'anime', 'toon', 'furry', - 'poses', 'background', 'tool', 'vehicle', 'buildings', + 'character', 'concept', 'clothing', + 'realistic', 'anime', 'toon', 'furry', 'style', + 'poses', 'background', 'tool', 'vehicle', 'buildings', 'objects', 'assets', 'animal', 'action' ] \ No newline at end of file diff --git a/static/js/utils/constants.js b/static/js/utils/constants.js index d27d6283..5690f904 100644 --- a/static/js/utils/constants.js +++ b/static/js/utils/constants.js @@ -92,6 +92,12 @@ export const DOWNLOAD_PATH_TEMPLATES = { description: 'Organize by base model and author', example: 'Flux.1 D/authorname/model-name.safetensors' }, + BASE_MODEL_AUTHOR_TAG: { + value: '{base_model}/{author}/{first_tag}', + label: 'Base Model + Author + First Tag', + description: 'Organize by base model, author, and primary tag', + example: 'Flux.1 D/authorname/style/model-name.safetensors' + }, AUTHOR_TAG: { value: '{author}/{first_tag}', label: 'Author + First Tag', @@ -189,8 +195,8 @@ export const BASE_MODEL_CATEGORIES = { // Preset tag suggestions export const PRESET_TAGS = [ - 'character', 'style', 'concept', 'clothing', - 'realistic', 'anime', 'toon', 'furry', + 'character', 'concept', 'clothing', + 'realistic', 'anime', 'toon', 'furry', 'style', 'poses', 'background', 'vehicle', 'buildings', 'objects', 'animal' ]; diff --git a/templates/components/modals/settings_modal.html b/templates/components/modals/settings_modal.html index 09fea0c9..1cba359d 100644 --- a/templates/components/modals/settings_modal.html +++ b/templates/components/modals/settings_modal.html @@ -254,6 +254,7 @@ + @@ -280,6 +281,7 @@ + @@ -306,6 +308,7 @@ +