Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3190cc1443 |
@@ -1,5 +1,42 @@
|
||||
# DEVLOG - ComfyUI-Workflow-Studio
|
||||
|
||||
## 2026-06-10: v0.3.35 — テーブルソート・Load GenUI・ワークフロー保存
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### Modelsタブ テーブルビュー: 列ヘッダークリックでソート(`static/js/models-tab.js`, `static/css/main.css`)
|
||||
- `state` に `sortColumn`(null または列キー)と `sortDir`(`"asc"` / `"desc"`)を追加
|
||||
- `sortModels(models)` 関数を追加:ソート列に応じて ★・ファイル名・サブディレクトリ・Type・Base Model・拡張子・Tags・Memo・E/D の各キーで昇降順ソートを実行
|
||||
- `filterModels()` の末尾で `sortModels()` を呼び出し、フィルタ後の全ビューに適用
|
||||
- `thSortHtml(label, col, extraClass, extraStyle)` ヘルパーを追加:アクティブ列はアクセントカラー(`--wfm-accent`)に変色し ▲/▼ 矢印を表示
|
||||
- `renderTableView` のヘッダーをすべて `thSortHtml` ベースに変更。クリックで asc → desc → 解除のサイクル
|
||||
- Enable/Disable 列の空ヘッダーを **E/D** に変更
|
||||
- `.wfm-table-th-sortable` CSS を追加(`cursor: pointer`、`-webkit-user-select: none`、`white-space: nowrap`、ホバー時アクセントカラー)
|
||||
|
||||
#### ギャラリータブ: Load GenUI ボタン追加(`templates/index.html`, `static/js/gallery-tab.js`, `static/css/gallery-tab.css`)
|
||||
- 詳細パネルのタブナビに **Load GenUI**(青)ボタン(`wfm-gallery-load-genui-btn`)を Metadata ボタンの右隣に追加
|
||||
- `gallery-tab.js` に `loadWorkflowIntoEditor` を `generate-tab.js` からインポート
|
||||
- クリック時の動作:画像未選択 → warning トースト / ワークフロー未埋め込み → warning トースト / 非対応フォーマット → `loadWorkflowIntoEditor` 内でトースト表示 / 成功時 → GenerateUI タブへ自動切り替え
|
||||
- **Metadata** ボタンに `wfm-gallery-action-btn-green` クラスを追加し緑色背景に変更
|
||||
- `gallery-tab.css` に `.wfm-gallery-action-btn-green`(緑)・`.wfm-gallery-action-btn-primary`(`--wfm-primary` 青)スタイルを追加:`padding`・`border-radius`・`align-self: center`・`margin` を共通指定
|
||||
|
||||
#### GenerateUIタブ: Save ボタン追加(`templates/index.html`, `static/js/generate-tab.js`)
|
||||
- `wfm-gen-subtab-nav` の右端(`margin-left:auto`)に **Save** ボタン(`wfm-gen-save-btn`、`wfm-btn-primary`)を設置
|
||||
- `generate-tab.js` のインポートに `openModal`・`closeModal` を追加
|
||||
- `saveCurrentWorkflow()` 関数を追加:
|
||||
- ワークフロー未ロード時は warning トースト
|
||||
- モーダルでファイル名を入力(デフォルト: 現在のワークフロー名)。Enter キーでも確定可能
|
||||
- `comfyUI.currentWorkflow` を JSON シリアライズして `File` オブジェクトを生成、`POST /api/wfm/workflows/import` で Workflow タブに保存
|
||||
- 保存成功後 `wfm-gen-wf-name` の表示・`dataset.filename` を新ファイル名に更新
|
||||
- エラー時はトーストでメッセージ表示
|
||||
|
||||
#### ヘルプ更新(`templates/index.html`)
|
||||
- GenerateUI Tab(`wfm-help-gen-2`):Save ボタンの説明を追加
|
||||
- Gallery Tab(`wfm-help-gallery-8/10`):「Metadata tab」→「JSON tab」に表記修正;`wfm-help-gallery-12/13` として Metadata(緑)・Load GenUI(青)ボタンの説明を新規追加
|
||||
- Models Tab(`wfm-help-models-2`):テーブルヘッダークリックソートと E/D 列の説明を追記
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-09: v0.3.34 — Modelsタブ テーブルビュー強化・バルク操作改善
|
||||
|
||||
### 変更内容
|
||||
|
||||
@@ -5,7 +5,7 @@ A comprehensive workflow management and generation UI plugin for [ComfyUI](https
|
||||
Browse, organize, and execute workflows directly from a dedicated studio interface — without switching between windows or manually editing JSON.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -48,6 +48,7 @@ Browse, organize, and execute workflows directly from a dedicated studio interfa
|
||||
|
||||
### GenerateUI Tab (v0.3.5)
|
||||
- **5-tab layout** — Input / Model / Settings / Feeder / Batch tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
|
||||
- **Save button** — located at the right end of the subtab row; opens a filename dialog (default: current workflow name) and saves the current workflow as a `.json` file to the Workflow tab via the import API
|
||||
- **Input tab** — Prompt (top) and Image drag-and-drop (bottom) in the left column; Raw JSON (540px) in the right column
|
||||
- **Model tab** — Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter; Raw JSON on the right
|
||||
- **Settings tab** — KSampler and Latent Image side by side at 50% width each; Raw JSON on the right
|
||||
@@ -127,6 +128,7 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
|
||||
- **Favorites** — star images inline without reopening the detail panel
|
||||
- **Detail panel** — view filename, path, tags, groups, and metadata in a slide-out panel
|
||||
- **Workflow viewer** — Metadata tab displays workflow JSON from PNG embedded data (`prompt` / `workflow` keys) or from workflow saved by the Generate UI tab
|
||||
- **Load GenUI button** — loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab; shows a warning toast if no workflow is embedded or the format is unsupported; Metadata button is styled green, Load GenUI button uses the primary accent color
|
||||
- **Workflow auto-save** — images generated from the Generate UI tab have their workflow automatically saved to gallery metadata
|
||||
- **Output folder configurable** — set the scanned output folder from Settings tab
|
||||
- **Performance** — folder-level mtime cache (30s TTL) for fast incremental refresh; tree expansion state preserved across folder operations
|
||||
@@ -141,7 +143,8 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
|
||||
|
||||
### Models Tab (v0.2.3)
|
||||
- **Model Browser** — browse all installed ComfyUI models (Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding) with sub-tab switching
|
||||
- **Thumbnail / Table views** — switch between view modes with pagination (24 items per page); Table view includes **Type** and **Base Model** columns sourced from cached CivitAI data, displayed between the Subdirectory and Extension columns
|
||||
- **Thumbnail / Table views** — switch between view modes with pagination (24 items per page); Table view includes **Type** and **Base Model** columns sourced from cached CivitAI data, displayed between the Subdirectory and Extension columns; Enable/Disable column labeled **E/D**
|
||||
- **Table column sort** — click any column header to sort ascending (▲), click again for descending (▼), click a third time to clear; active column highlighted in accent color
|
||||
- **Search & Filter** — full-text search, filter by tags, groups, and favorites
|
||||
- **User-defined badges** — assign free-label badges to models; badge colors shared with the Workflow tab palette
|
||||
- **Side panel tabs** — opens to CivitAI tab by default when a model is selected; Info (file path display with click-to-copy, tags, memo), Groups management, CivitAI integration
|
||||
@@ -283,6 +286,11 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.3.35
|
||||
- **Models tab — Table column sort** — click any column header to sort ascending (▲), click again for descending (▼), click a third time to clear; active column name highlighted in accent color; Enable/Disable column header now labeled **E/D**
|
||||
- **Gallery tab — Load GenUI button** — new button to the right of the Metadata button in the detail panel; loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab; warning toast shown if no workflow is embedded or the format is unsupported; Metadata button restyled green, Load GenUI uses primary accent color
|
||||
- **GenerateUI tab — Save button** — new button at the right end of the subtab row; opens a filename dialog (default: current workflow name) and saves the current workflow as a `.json` file to the Workflow tab via the import API; workflow name label updates to the saved filename on success
|
||||
|
||||
### v0.3.33
|
||||
- **LoRA pane — workflow load no longer overwrites LoraManager** — removed the auto-apply block that replaced `inputs.loras` / `inputs.text` with Stack group contents on every workflow load; Stack is now applied only when the Apply button is pressed
|
||||
- **LoRA pane — 🔄 button no longer resets to Single tab** — active tab state is saved before `innerHTML` rebuild and restored afterwards; staying on Stack tab after refresh
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-workflow-studio"
|
||||
description = "A comprehensive workflow management and generation UI plugin for ComfyUI. Browse, organize, and execute workflows from a dedicated studio interface."
|
||||
version = "0.3.34"
|
||||
version = "0.3.35"
|
||||
license = "MIT"
|
||||
requires-python = ">= 3.10"
|
||||
dependencies = ["jinja2"]
|
||||
|
||||
@@ -602,6 +602,41 @@
|
||||
background: rgba(255,255,255,0.2);
|
||||
}
|
||||
|
||||
/* ── 詳細パネル アクションボタン (タブナビ内) ────────────────── */
|
||||
|
||||
.wfm-gallery-action-btn-green,
|
||||
.wfm-gallery-action-btn-primary {
|
||||
padding: 4px 10px !important;
|
||||
border-radius: 4px !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
cursor: pointer !important;
|
||||
font-size: 12px !important;
|
||||
white-space: nowrap;
|
||||
align-self: center;
|
||||
margin: 2px 3px;
|
||||
}
|
||||
|
||||
.wfm-gallery-action-btn-green {
|
||||
background: var(--wfm-success, #22c55e) !important;
|
||||
color: #fff !important;
|
||||
border-color: var(--wfm-success, #22c55e) !important;
|
||||
}
|
||||
.wfm-gallery-action-btn-green:hover {
|
||||
background: #16a34a !important;
|
||||
border-color: #16a34a !important;
|
||||
}
|
||||
|
||||
.wfm-gallery-action-btn-primary {
|
||||
background: var(--wfm-primary) !important;
|
||||
color: #fff !important;
|
||||
border-color: var(--wfm-primary) !important;
|
||||
}
|
||||
.wfm-gallery-action-btn-primary:hover {
|
||||
background: var(--wfm-primary-hover) !important;
|
||||
border-color: var(--wfm-primary-hover) !important;
|
||||
}
|
||||
|
||||
/* ── ファイル操作ボタン (詳細パネル) ─────────────────────────── */
|
||||
|
||||
.wfm-gallery-file-actions {
|
||||
|
||||
@@ -4254,6 +4254,17 @@ body {
|
||||
}
|
||||
|
||||
|
||||
/* Table sort header */
|
||||
.wfm-table-th-sortable {
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wfm-table-th-sortable:hover {
|
||||
color: var(--wfm-accent, #6366f1);
|
||||
}
|
||||
|
||||
/* Table view toggle cell */
|
||||
.wfm-table-td-toggle {
|
||||
text-align: center;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { showToast } from "./app.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { loadFileIntoMetadataTab } from "./metadata-tab.js";
|
||||
import { loadWorkflowIntoEditor } from "./generate-tab.js";
|
||||
|
||||
// ── 定数 ─────────────────────────────────────────────────────
|
||||
|
||||
@@ -1299,6 +1300,22 @@ function bindEvents() {
|
||||
openImageInMetadataTab(state.selectedImage);
|
||||
});
|
||||
|
||||
// Load in GenerateUI ボタン: 埋め込みワークフローをGenerateUIタブに読み込む
|
||||
document.getElementById("wfm-gallery-load-genui-btn")?.addEventListener("click", async () => {
|
||||
if (!state.selectedImage) {
|
||||
showToast("Please select an image first", "error");
|
||||
return;
|
||||
}
|
||||
if (!state.embeddedWorkflow) {
|
||||
showToast("No ComfyUI workflow embedded in this image.", "warning");
|
||||
return;
|
||||
}
|
||||
const loaded = await loadWorkflowIntoEditor(state.embeddedWorkflow, state.selectedImage.filename);
|
||||
if (loaded !== false) {
|
||||
document.querySelector('.wfm-tab[data-tab="generate"]')?.click();
|
||||
}
|
||||
});
|
||||
|
||||
// 詳細タブ切り替え(Metadataボタンはタブではないので除外)
|
||||
document.querySelectorAll(".wfm-gallery-detail-tab-btn[data-detail-tab]").forEach(btn => {
|
||||
btn.addEventListener("click", () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* GenerateUI Tab - Workflow execution with parameter editing
|
||||
*/
|
||||
|
||||
import { showToast } from "./app.js";
|
||||
import { showToast, openModal, closeModal } from "./app.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { comfyWorkflow } from "./comfyui-workflow.js";
|
||||
import { comfyEditor } from "./comfyui-editor.js";
|
||||
@@ -103,6 +103,84 @@ function updateStatus(connected) {
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Workflow Save
|
||||
// ============================================
|
||||
|
||||
async function saveCurrentWorkflow() {
|
||||
if (!comfyUI.currentWorkflow) {
|
||||
showToast("No workflow loaded", "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
const currentFilename = document.getElementById("wfm-gen-wf-name")?.dataset?.filename || "";
|
||||
const defaultStem = currentFilename.replace(/\.json$/, "") || "workflow";
|
||||
|
||||
const html = `
|
||||
<div style="display:flex;flex-direction:column;gap:14px;min-width:300px;">
|
||||
<div>
|
||||
<label style="font-size:12px;color:var(--wfm-text-secondary);display:block;margin-bottom:4px;">Filename</label>
|
||||
<div style="display:flex;align-items:center;gap:6px;">
|
||||
<input type="text" id="wfm-save-wf-name" class="wfm-input" value="${defaultStem}" style="flex:1;" placeholder="workflow name">
|
||||
<span style="color:var(--wfm-text-secondary);font-size:13px;">.json</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;justify-content:flex-end;">
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-save-wf-cancel-btn">Cancel</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="wfm-save-wf-confirm-btn">Save</button>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
openModal("Save Workflow", html);
|
||||
|
||||
setTimeout(() => {
|
||||
const input = document.getElementById("wfm-save-wf-name");
|
||||
if (input) { input.focus(); input.select(); }
|
||||
}, 50);
|
||||
|
||||
document.getElementById("wfm-save-wf-cancel-btn")?.addEventListener("click", () => closeModal());
|
||||
|
||||
const doSave = async () => {
|
||||
const input = document.getElementById("wfm-save-wf-name");
|
||||
const stem = input?.value?.trim();
|
||||
if (!stem) {
|
||||
showToast("Please enter a filename", "warning");
|
||||
return;
|
||||
}
|
||||
const filename = stem.endsWith(".json") ? stem : `${stem}.json`;
|
||||
try {
|
||||
const blob = new Blob(
|
||||
[JSON.stringify(comfyUI.currentWorkflow, null, 2)],
|
||||
{ type: "application/json" }
|
||||
);
|
||||
const file = new File([blob], filename, { type: "application/json" });
|
||||
const fd = new FormData();
|
||||
fd.append("files", file);
|
||||
const res = await fetch("/api/wfm/workflows/import", { method: "POST", body: fd });
|
||||
const data = await res.json();
|
||||
const ng = (data.results || []).filter(r => r.status === "error");
|
||||
if (ng.length) {
|
||||
showToast(`Save failed: ${ng[0].message || "unknown error"}`, "error");
|
||||
return;
|
||||
}
|
||||
closeModal();
|
||||
const nameEl = document.getElementById("wfm-gen-wf-name");
|
||||
if (nameEl) {
|
||||
nameEl.textContent = filename;
|
||||
nameEl.dataset.filename = filename;
|
||||
}
|
||||
showToast(`Saved: ${filename}`, "success");
|
||||
} catch (err) {
|
||||
showToast(`Save error: ${err.message}`, "error");
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementById("wfm-save-wf-confirm-btn")?.addEventListener("click", doSave);
|
||||
document.getElementById("wfm-save-wf-name")?.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") doSave();
|
||||
});
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Workflow Loading
|
||||
// ============================================
|
||||
@@ -1412,6 +1490,9 @@ export async function initGenerateTab() {
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// Save workflow button
|
||||
document.getElementById("wfm-gen-save-btn")?.addEventListener("click", () => saveCurrentWorkflow());
|
||||
|
||||
document.getElementById("wfm-gen-reset-workflow-btn")?.addEventListener("click", async () => {
|
||||
const filename = document.getElementById("wfm-gen-wf-name")?.dataset?.filename;
|
||||
if (!filename || !filename.endsWith(".json")) {
|
||||
|
||||
@@ -491,6 +491,7 @@ const LANGUAGES = {
|
||||
helpModels9: "User-defined badges: assign free-label badges with custom colors shared with the Workflow tab",
|
||||
helpModels10: "Enable/Disable models: toggle visibility in ComfyUI by renaming file extension (.disabled suffix). Disable per model (⏸ button on each card) or per group (Enable All / Disable All in Group panel). Changes take effect after ComfyUI refresh.",
|
||||
helpModels11: "Multi-select & bulk operations: click Select to enter selection mode, check multiple models, then use the bulk action bar to add/remove from groups or permanently delete files (model file + preview images + sidecar files such as .json/.info).",
|
||||
helpModels12: "After moving or deleting models, ComfyUI may fail to load them because it caches the old file paths. Perform a Hard Reset from the ComfyUI menu (Queue → Hard Reset) or restart ComfyUI to refresh the model cache.",
|
||||
helpGalleryTitle: "Gallery Tab",
|
||||
helpGallery1: "Browse images in the ComfyUI output folder — set the folder path in Settings > Gallery Output Folder",
|
||||
helpGallery2: "3-column layout: folder tree (left) | image grid (center) | detail panel (right)",
|
||||
@@ -538,6 +539,7 @@ const LANGUAGES = {
|
||||
helpTrouble3: "Workflows not showing: Click refresh button, check if loadable in ComfyUI, try restarting browser/ComfyUI",
|
||||
helpTrouble4: "Image generation fails: Check if specified models exist in ComfyUI, verify connection, try restarting",
|
||||
helpTrouble5: "LoRA Stack fails with 'No such file or directory' error: The LoRA may not be recognized by comfyui-lora-manager (known issue). Try a different LoRA or check if the file appears in Lora Manager's own UI",
|
||||
helpTrouble6: "Model loading error after moving or deleting models: ComfyUI caches file paths and may still reference old locations. Perform a Hard Reset from the ComfyUI menu (Queue → Hard Reset) or restart ComfyUI to clear the cache.",
|
||||
helpSupportTitle: "Support",
|
||||
helpSupportDesc: "If you find this plugin useful, please consider supporting its development!",
|
||||
helpGithubDesc: "Report issues, request features, and contribute",
|
||||
@@ -1168,6 +1170,7 @@ const LANGUAGES = {
|
||||
helpModels9: "ユーザー定義バッジ:自由ラベルのバッジをモデルに付与(Workflowタブと色パレットを共有)",
|
||||
helpModels10: "モデルの有効/無効切り替え:拡張子リネーム(.disabledサフィックス)でComfyUIへの表示を制御。各カードの⏸ボタンで単体操作、グループパネルの「全て有効化 / 全て無効化」でグループ一括操作。変更はComfyUIリフレッシュ後に反映。",
|
||||
helpModels11: "複数選択と一括操作:「選択」ボタンで選択モードに入り複数モデルにチェックを入れると、一括操作バーからグループへの追加/削除、またはファイルの完全削除(モデルファイル+プレビュー画像+.json/.infoなどのサイドカーファイル)が行えます。",
|
||||
helpModels12: "モデルの移動・削除後はComfyUIが古いパスをキャッシュしているためモデル読み込みエラーが発生することがあります。ComfyUIメニューのHard Reset(Queue → Hard Reset)またはComfyUIを再起動してモデルキャッシュを更新してください。",
|
||||
helpGalleryTitle: "Galleryタブ",
|
||||
helpGallery1: "ComfyUIの出力フォルダ内画像を閲覧 — Settings > Gallery Output Folder でフォルダパスを設定可能",
|
||||
helpGallery2: "3カラムレイアウト: フォルダツリー (左) | 画像グリッド (中央) | 詳細パネル (右)",
|
||||
@@ -1215,6 +1218,7 @@ const LANGUAGES = {
|
||||
helpTrouble3: "ワークフローが表示されない:更新ボタン押下、ComfyUIで読み込めるか確認、ブラウザ・ComfyUI再起動",
|
||||
helpTrouble4: "画像生成が失敗する:指定モデルの存在確認、ComfyUI接続確認、再起動",
|
||||
helpTrouble5: "LoRAスタック実行時に「No such file or directory」エラー:comfyui-lora-managerが該当LoRAを認識していない可能性があります(既知の問題)。別のLoRAを試すか、Lora Manager自体のUIで該当ファイルが表示されるか確認してください",
|
||||
helpTrouble6: "モデルの移動・削除後にモデル読み込みエラーが発生する:ComfyUIがファイルパスをキャッシュしており、古い場所を参照することがあります。ComfyUIメニューのHard Reset(Queue → Hard Reset)またはComfyUIを再起動してキャッシュをクリアしてください。",
|
||||
helpSupportTitle: "サポート",
|
||||
helpSupportDesc: "このプラグインが役に立ったら、開発を支援していただけると嬉しいです!",
|
||||
helpGithubDesc: "バグ報告、機能リクエスト、コントリビュート",
|
||||
@@ -1841,6 +1845,7 @@ const LANGUAGES = {
|
||||
helpModels9: "用户自定义徽章:为模型添加自由标签徽章(颜色调色板与Workflow标签共享)",
|
||||
helpModels10: "模型启用/禁用:通过重命名文件扩展名(添加.disabled后缀)控制ComfyUI中的显示。点击每个卡片上的⏸按钮单独操作,或在分组面板中使用「全部启用/全部禁用」进行批量操作。更改在刷新ComfyUI后生效。",
|
||||
helpModels11: "多选与批量操作:点击「选择」按钮进入选择模式,勾选多个模型后,可通过批量操作栏将其添加/移出分组,或永久删除文件(模型文件+预览图+.json/.info等附属文件)。",
|
||||
helpModels12: "移动或删除模型后,ComfyUI可能因缓存旧路径而无法加载模型。请通过ComfyUI菜单执行Hard Reset(Queue → Hard Reset)或重启ComfyUI以刷新模型缓存。",
|
||||
helpGalleryTitle: "图库标签页 (Gallery)",
|
||||
helpGallery1: "浏览 ComfyUI 输出文件夹中的图像 — 可以在 设置 > 图库输出文件夹 中设置文件夹路径",
|
||||
helpGallery2: "三列布局:文件夹树(左) | 图像网格(中) | 详情面板(右)",
|
||||
@@ -1888,6 +1893,7 @@ const LANGUAGES = {
|
||||
helpTrouble3: "工作流不显示:点击刷新按钮、确认能在ComfyUI中加载、尝试重启浏览器/ComfyUI",
|
||||
helpTrouble4: "图片生成失败:确认指定模型存在、验证ComfyUI连接、尝试重启",
|
||||
helpTrouble5: "LoRA Stack出现「No such file or directory」错误:该LoRA可能未被comfyui-lora-manager识别(已知问题)。请尝试其他LoRA,或检查该文件是否显示在Lora Manager自身的界面中",
|
||||
helpTrouble6: "移动或删除模型后出现模型加载错误:ComfyUI会缓存文件路径,可能仍引用旧位置。请通过ComfyUI菜单执行Hard Reset(Queue → Hard Reset)或重启ComfyUI以清除缓存。",
|
||||
helpSupportTitle: "支持",
|
||||
helpSupportDesc: "如果您觉得这个插件有用,请考虑支持它的开发!",
|
||||
helpGithubDesc: "报告问题、请求功能和贡献代码",
|
||||
|
||||
+84
-10
@@ -47,6 +47,8 @@ const state = {
|
||||
selectedModel: null,
|
||||
loaded: {},
|
||||
currentPage: 0,
|
||||
sortColumn: null, // "fav" | "filename" | "subdir" | "civtype" | "basemodel" | "ext" | "tags" | "memo" | "enabled"
|
||||
sortDir: "asc", // "asc" | "desc"
|
||||
};
|
||||
|
||||
|
||||
@@ -737,7 +739,53 @@ function filterModels() {
|
||||
});
|
||||
}
|
||||
|
||||
return models;
|
||||
return sortModels(models);
|
||||
}
|
||||
|
||||
function sortModels(models) {
|
||||
if (!state.sortColumn) return models;
|
||||
return [...models].sort((a, b) => {
|
||||
const metaA = state.modelMetadata[a] || {};
|
||||
const metaB = state.modelMetadata[b] || {};
|
||||
let va, vb;
|
||||
switch (state.sortColumn) {
|
||||
case "fav":
|
||||
va = metaA.favorite ? 1 : 0; vb = metaB.favorite ? 1 : 0; break;
|
||||
case "filename": {
|
||||
const pa = parseModelPath(a); const pb = parseModelPath(b);
|
||||
va = pa.name.toLowerCase(); vb = pb.name.toLowerCase(); break;
|
||||
}
|
||||
case "subdir": {
|
||||
const pa = parseModelPath(a); const pb = parseModelPath(b);
|
||||
va = pa.dir.toLowerCase(); vb = pb.dir.toLowerCase(); break;
|
||||
}
|
||||
case "civtype": {
|
||||
const civA = metaA.sha256 && state.civitaiCache[metaA.sha256];
|
||||
const civB = metaB.sha256 && state.civitaiCache[metaB.sha256];
|
||||
va = (civA?.type || "").toLowerCase(); vb = (civB?.type || "").toLowerCase(); break;
|
||||
}
|
||||
case "basemodel": {
|
||||
const civA = metaA.sha256 && state.civitaiCache[metaA.sha256];
|
||||
const civB = metaB.sha256 && state.civitaiCache[metaB.sha256];
|
||||
va = (civA?.baseModel || "").toLowerCase(); vb = (civB?.baseModel || "").toLowerCase(); break;
|
||||
}
|
||||
case "ext": {
|
||||
const pa = parseModelPath(a); const pb = parseModelPath(b);
|
||||
va = getExtension(pa.name).toLowerCase(); vb = getExtension(pb.name).toLowerCase(); break;
|
||||
}
|
||||
case "tags":
|
||||
va = (metaA.tags || []).join(", ").toLowerCase();
|
||||
vb = (metaB.tags || []).join(", ").toLowerCase(); break;
|
||||
case "memo":
|
||||
va = (metaA.memo || "").toLowerCase(); vb = (metaB.memo || "").toLowerCase(); break;
|
||||
case "enabled":
|
||||
va = isModelDisabled(a) ? 1 : 0; vb = isModelDisabled(b) ? 1 : 0; break;
|
||||
default: return 0;
|
||||
}
|
||||
if (va < vb) return state.sortDir === "asc" ? -1 : 1;
|
||||
if (va > vb) return state.sortDir === "asc" ? 1 : -1;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
function getAllTags() {
|
||||
@@ -1058,6 +1106,14 @@ function renderThumbView(grid, models) {
|
||||
|
||||
// ── Table View ────────────────────────────────────────────
|
||||
|
||||
function thSortHtml(label, col, extraClass = "", extraStyle = "") {
|
||||
const isActive = state.sortColumn === col;
|
||||
const arrow = isActive ? (state.sortDir === "asc" ? " ▲" : " ▼") : "";
|
||||
const activeStyle = isActive ? "color:var(--wfm-accent,#6366f1);" : "";
|
||||
const cls = ["wfm-table-th-sortable", extraClass].filter(Boolean).join(" ");
|
||||
return `<th class="${cls}" data-sort-col="${col}" style="${activeStyle}${extraStyle}">${label}${arrow}</th>`;
|
||||
}
|
||||
|
||||
function renderTableView(grid, models) {
|
||||
const showBatchBtn = ["checkpoint", "lora"].includes(state.activeModelType);
|
||||
const showStackBtn = state.activeModelType === "lora";
|
||||
@@ -1103,16 +1159,16 @@ function renderTableView(grid, models) {
|
||||
const checkTh = state.selectMode ? `<th style="width:24px;"></th>` : "";
|
||||
grid.innerHTML = `<table class="wfm-models-table"><thead><tr>
|
||||
${checkTh}
|
||||
<th style="width:30px;">★</th>
|
||||
${thSortHtml("★", "fav", "", "width:30px;text-align:center;")}
|
||||
<th style="width:40px;"></th>
|
||||
<th class="wfm-table-th-filename">${t("modelsFileName")}</th>
|
||||
<th class="wfm-table-th-subdir">${t("modelsSubdir")}</th>
|
||||
<th class="wfm-table-th-civtype">${t("civitaiType")}</th>
|
||||
<th class="wfm-table-th-basemodel">${t("civitaiBaseModel")}</th>
|
||||
<th class="wfm-table-th-ext">${t("modelsExt")}</th>
|
||||
<th>${t("modelsTags")}</th>
|
||||
<th>${t("modelsMemo")}</th>
|
||||
<th style="width:50px;"></th>
|
||||
${thSortHtml(t("modelsFileName"), "filename", "wfm-table-th-filename")}
|
||||
${thSortHtml(t("modelsSubdir"), "subdir", "wfm-table-th-subdir")}
|
||||
${thSortHtml(t("civitaiType"), "civtype", "wfm-table-th-civtype")}
|
||||
${thSortHtml(t("civitaiBaseModel"), "basemodel", "wfm-table-th-basemodel")}
|
||||
${thSortHtml(t("modelsExt"), "ext", "wfm-table-th-ext")}
|
||||
${thSortHtml(t("modelsTags"), "tags")}
|
||||
${thSortHtml(t("modelsMemo"), "memo")}
|
||||
${thSortHtml("E/D", "enabled", "", "width:50px;text-align:center;")}
|
||||
${showBatchBtn ? `<th style="width:30px;">B</th>` : ""}
|
||||
${showStackBtn ? `<th style="width:30px;">S</th>` : ""}
|
||||
</tr></thead><tbody>${rows}</tbody></table>`;
|
||||
@@ -1154,6 +1210,24 @@ function renderTableView(grid, models) {
|
||||
e.currentTarget.classList.toggle("active", isInStack(mn));
|
||||
});
|
||||
});
|
||||
|
||||
grid.querySelectorAll(".wfm-table-th-sortable").forEach((th) => {
|
||||
th.addEventListener("click", () => {
|
||||
const col = th.dataset.sortCol;
|
||||
if (state.sortColumn === col) {
|
||||
if (state.sortDir === "asc") {
|
||||
state.sortDir = "desc";
|
||||
} else {
|
||||
state.sortColumn = null;
|
||||
state.sortDir = "asc";
|
||||
}
|
||||
} else {
|
||||
state.sortColumn = col;
|
||||
state.sortDir = "asc";
|
||||
}
|
||||
renderModelGrid();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ── Batch group helpers ───────────────────────────────────
|
||||
|
||||
+11
-5
@@ -271,6 +271,7 @@
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="settings">Settings</button>
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="feeder">Feeder</button>
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="batch">Batch</button>
|
||||
<button id="wfm-gen-save-btn" class="wfm-btn wfm-btn-sm wfm-btn-primary" style="margin-left:auto;" title="Save current workflow to Workflow tab">Save</button>
|
||||
</div>
|
||||
|
||||
<!-- Tab: Input — left sub-col: Prompt/Image (tabbed), right sub-col: Raw JSON -->
|
||||
@@ -960,7 +961,7 @@
|
||||
<h3>GenerateUI Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-gen-1">Connect/disconnect ComfyUI and check connection status</li>
|
||||
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor</li>
|
||||
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor; <b>Save</b> button (right end of the tab bar) saves the current workflow — including any edits made in the editor — as a new .json file to the Workflow tab; a filename dialog appears with the current workflow name as the default</li>
|
||||
<li id="wfm-help-gen-3">5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
|
||||
<li id="wfm-help-gen-4">Input tab: inner tabs — Prompt (positive/negative textboxes with doubled height) and Image (drag-and-drop upload); switch between tabs with the tab bar at the top of the left column</li>
|
||||
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones</li>
|
||||
@@ -1073,10 +1074,12 @@
|
||||
<li id="wfm-help-gallery-5">Folder tree: click to load images, expand with ▶; "+ New" creates a subfolder inside the selected folder, "Del" deletes it with all contents</li>
|
||||
<li id="wfm-help-gallery-6">Multi-select with Ctrl+click — bulk operations: Add to Group, Favorite All, Unfavorite All, Move To..., Delete</li>
|
||||
<li id="wfm-help-gallery-7">Detail panel — Info tab: filename, size, date, tags (add/remove), memo; "Move To..." moves the image to another folder, "Delete" removes it permanently</li>
|
||||
<li id="wfm-help-gallery-8">Detail panel — Metadata tab: displays workflow JSON from PNG embedded data (prompt / workflow keys) or from metadata saved by the Generate UI tab; one-click clipboard copy</li>
|
||||
<li id="wfm-help-gallery-8">Detail panel — JSON tab: displays workflow JSON from PNG embedded data (prompt / workflow keys) or from metadata saved by the Generate UI tab; one-click clipboard copy</li>
|
||||
<li id="wfm-help-gallery-9">Detail panel — Groups tab: create, assign, remove, rename, and delete groups per image</li>
|
||||
<li id="wfm-help-gallery-10">Workflow auto-save: images generated in the Generate UI tab automatically have their workflow saved to gallery metadata and shown in the Metadata tab</li>
|
||||
<li id="wfm-help-gallery-10">Workflow auto-save: images generated in the Generate UI tab automatically have their workflow saved to gallery metadata and shown in the JSON tab</li>
|
||||
<li id="wfm-help-gallery-11">Supports PNG (tEXt/iTXt), JPEG, WebP, GIF; workflow extraction reads ComfyUI prompt and workflow keys embedded in PNG metadata</li>
|
||||
<li id="wfm-help-gallery-12"><b>Metadata</b> button (green, in the detail panel tab bar): opens the selected image in the Metadata tab for full embedded-data inspection; Alt+click on any image thumbnail has the same effect</li>
|
||||
<li id="wfm-help-gallery-13"><b>Load GenUI</b> button (blue, in the detail panel tab bar): loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab and switches to it; shows a warning toast if no workflow is embedded or the format is not supported</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1086,7 +1089,7 @@
|
||||
<h3>Models Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-models-1">Browse installed models: Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding with sub-tab switching</li>
|
||||
<li id="wfm-help-models-2">Thumbnail, Card, and Table view modes with pagination; Table view shows Type and Base Model columns sourced from CivitAI data alongside filename, subdirectory, and extension</li>
|
||||
<li id="wfm-help-models-2">Thumbnail, Card, and Table view modes with pagination; Table view shows Type and Base Model columns sourced from CivitAI data alongside filename, subdirectory, and extension; <b>column headers are clickable to sort</b> — click once for ascending (▲), again for descending (▼), a third time to clear the sort; the <b>E/D</b> column sorts by enable/disable status</li>
|
||||
<li id="wfm-help-models-3">Search, tag filter, group filter, favorites filter, and status filter (All / Enabled only / Disabled only)</li>
|
||||
<li id="wfm-help-models-4">Side panel: opens to CivitAI tab by default when a model is selected; Info (file path, tags, memo), Groups management, CivitAI integration</li>
|
||||
<li id="wfm-help-models-5">CivitAI integration: fetch model info by SHA256 hash, batch fetch per model type</li>
|
||||
@@ -1096,6 +1099,7 @@
|
||||
<li id="wfm-help-models-9">User-defined badges: assign free-label badges with custom colors shared with the Workflow tab</li>
|
||||
<li id="wfm-help-models-10">Enable/Disable models: toggle visibility in ComfyUI by renaming file extension (.disabled suffix). Disable per model (⏸ button on each card) or per group (Enable All / Disable All in Group panel). Changes take effect after ComfyUI refresh.</li>
|
||||
<li id="wfm-help-models-11">Multi-select & bulk operations: click Select (green) to enter selection mode, then check multiple models; the bulk action bar is organized into three rows — <b>Group row:</b> select an existing group and Add/Remove, or type a new name and Create & Add; <b>Badge row:</b> select a badge and +Badge / −Badge to apply or remove; <b>File row:</b> select a destination subfolder (or type a new folder name) and Move to relocate model files with all sidecar files (.preview.png, .json, .civitai.info, etc.), Delete Files to permanently remove selected models; header row provides Deselect All and ★/☆ Favorite toggles</li>
|
||||
<li id="wfm-help-models-12">After moving or deleting models, ComfyUI may fail to load them because it caches the old file paths. Perform a Hard Reset from the ComfyUI menu (Queue → Hard Reset) or restart ComfyUI to refresh the model cache.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1158,6 +1162,7 @@
|
||||
<li id="wfm-help-trouble-3">Workflows not showing: Click refresh button, check if loadable in ComfyUI, try restarting browser/ComfyUI</li>
|
||||
<li id="wfm-help-trouble-4">Image generation fails: Check if specified models exist in ComfyUI, verify connection, try restarting</li>
|
||||
<li id="wfm-help-trouble-5">LoRA Stack fails with "No such file or directory" error: The LoRA may not be recognized by comfyui-lora-manager (known issue). Try a different LoRA or check if the file appears in Lora Manager's own UI</li>
|
||||
<li id="wfm-help-trouble-6">Model loading error after moving or deleting models: ComfyUI caches file paths and may still reference old locations. Perform a Hard Reset from the ComfyUI menu (Queue → Hard Reset) or restart ComfyUI to clear the cache.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1268,7 +1273,8 @@
|
||||
<button class="wfm-gallery-detail-tab-btn active" data-detail-tab="info">Info</button>
|
||||
<button class="wfm-gallery-detail-tab-btn" data-detail-tab="meta">JSON</button>
|
||||
<button class="wfm-gallery-detail-tab-btn" data-detail-tab="group">Groups</button>
|
||||
<button id="wfm-gallery-open-metadata-btn" class="wfm-gallery-detail-tab-btn" title="Open in Metadata tab (or Alt+click image)">Metadata</button>
|
||||
<button id="wfm-gallery-open-metadata-btn" class="wfm-gallery-detail-tab-btn wfm-gallery-action-btn-green" title="Open in Metadata tab (or Alt+click image)">Metadata</button>
|
||||
<button id="wfm-gallery-load-genui-btn" class="wfm-gallery-detail-tab-btn wfm-gallery-action-btn-primary" title="Load workflow into GenerateUI">Load GenUI</button>
|
||||
</div>
|
||||
<!-- Info タブ -->
|
||||
<div id="wfm-gallery-detail-info" class="wfm-gallery-detail-tab-content active">
|
||||
|
||||
Reference in New Issue
Block a user