mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-21 03:01:27 -03:00
feat(settings): filename templates for download and bulk rename (#1071)
Add per-model-type filename templates ({model_name}, {version_name},
{base_model}, {author}, {first_tag}, {hash_short}, {original_name}) so
downloaded files get informative names instead of e.g. V1.safetensors.
Empty template keeps the current filename (opt-in, off by default).
- apply template automatically after downloads; rename conflicts keep
the original name and never fail the download
- record original_file_name in metadata on rename for traceability
- bulk apply via GET|POST /api/lm/{prefix}/apply-filename-template with
WebSocket progress, sharing the auto-organize lock
- settings UI lives in the new Organization tab with validation, live
preview, and per-type 'apply to library' actions
This commit is contained in:
@@ -360,6 +360,25 @@ export const DEFAULT_PATH_TEMPLATES = {
|
||||
other: ''
|
||||
};
|
||||
|
||||
// Valid placeholders for download filename templates (opt-in rename of
|
||||
// downloaded safetensors; the result is a filename stem, no path separators)
|
||||
export const FILENAME_TEMPLATE_PLACEHOLDERS = [
|
||||
'{model_name}',
|
||||
'{version_name}',
|
||||
'{base_model}',
|
||||
'{author}',
|
||||
'{first_tag}',
|
||||
'{hash_short}',
|
||||
'{original_name}'
|
||||
];
|
||||
|
||||
// Default filename templates per model type; empty string keeps the original filename
|
||||
export const DEFAULT_FILENAME_TEMPLATES = {
|
||||
lora: '',
|
||||
checkpoint: '',
|
||||
embedding: ''
|
||||
};
|
||||
|
||||
// Model type labels for UI
|
||||
export const MODEL_TYPE_LABELS = {
|
||||
lora: 'LoRA Models',
|
||||
|
||||
Reference in New Issue
Block a user