From f424c2d2ae27595ae90bd2e5839d731aa0b96d6b Mon Sep 17 00:00:00 2001 From: Christian Bastian <80225746+cdb-boop@users.noreply.github.com> Date: Wed, 27 Mar 2024 01:04:14 -0400 Subject: [PATCH] Download Tab 'model save file name' text input value set for convenient modification. --- README.md | 4 ++-- web/model-manager.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8bc8582..378e254 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Download, browse and delete models in ComfyUI. - Advanced keyword search using `"multiple words in quotes"` or a minus sign to `-exclude`. - Search `/`subdirectories of model directories based on your file structure (for example, `/0/1.5/styles/clothing`). - Add `/` at the start of the search bar to see auto-complete suggestions. -- Include models listed in ComfyUI's `extra_model_paths.yaml` or added in `ComfyUI/models`. +- Include models listed in ComfyUI's `extra_model_paths.yaml` or added in `ComfyUI/models/`. - Sort for models (Date Created, Date Modified, Name). ### Model Info View @@ -97,7 +97,7 @@ Download, browse and delete models in ComfyUI. - Filter directory dropdown - Filter directory content in auto-suggest dropdown (not clear how this should be implemented) - Filters dropdown - - Stable Diffusion model version, if applicable (Maybe dropdown list of "Base Models" is more pratical to impliment?) + - Stable Diffusion model version, if applicable (Maybe dropdown list of "Base Models" is more practical to implement?) - Favorites - Swap between `and` and `or` keyword search? (currently `and`) diff --git a/web/model-manager.js b/web/model-manager.js index 13b692e..677e9b7 100644 --- a/web/model-manager.js +++ b/web/model-manager.js @@ -2150,16 +2150,18 @@ class DownloadTab { true, ); + const default_name = (() => { + const filename = info["fileName"]; + // TODO: only remove valid model file extensions + const i = filename.lastIndexOf("."); + return i === - 1 ? filename : filename.substring(0, i); + })(); const el_filename = $el("input.plain-text-area", { type: "text", name: "model save file name", autocomplete: "off", - placeholder: (() => { - const filename = info["fileName"]; - // TODO: only remove valid model file extensions - const i = filename.lastIndexOf("."); - return i === - 1 ? filename : filename.substring(0, i); - })(), + placeholder: default_name, + value: default_name, }); const filepath = info["downloadFilePath"];