Compare commits

...
3 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 4.6 7395fe2432 feat: add Batch tab to GenerateUI, expand Models bulk actions (v0.3.18)
- GenerateUI: new Batch subtab (5th tab) with 3-pane layout —
  left pane: file-tree checkpoint selector (initially all unchecked);
  center pane: group-based selection with inner tabs (Checkpoint/Lora/
  Prompt/Workflow); right pane: live Batch Queue preview combining both
  selections with duplicates removed
- Checkpoint selector removed from right panel dropdown; Batch tab
  is now the single entry point for checkpoint selection
- Group selection state refactored from flat selectedModels Set to
  selectedGroups + partialSelections so group membership changes in the
  Models tab are always reflected without stale entries
- Models: bulk action bar adds Deselect All, bulk Favorite/Unfavorite,
  bulk +Badge/-Badge; i18n keys added for all three (EN/JA/ZH)
- civitai_service.py: remove SSL CERT_NONE fallback (v0.3.17 patch,
  SSL verification is now never disabled)
- Help, README, DEVLOG updated to v0.3.18

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:55:48 +09:00
ketle-manandClaude Sonnet 4.6 49e2519f89 chore: bump pyproject.toml version to 0.3.17
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 18:20:09 +09:00
ketle-manandClaude Sonnet 4.6 5390f0c94d fix: SSL cert error on CivitAI + Lora Manager UI-to-API conversion
- civitai_service: add _make_ssl_context() that tries certifi first,
  falls back to system store, then CERT_NONE with warning; fixes
  CERTIFICATE_VERIFY_FAILED on Windows Portable Python environments
- comfyui-workflow: convertUiToApi() now detects nodes with
  properties.__lm_widget_ids (Lora Loader (LoraManager)) and maps
  widgets_values via that index, wrapping the loras array as
  {"__value__": [...]} for the API format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 18:18:10 +09:00
10 changed files with 713 additions and 112 deletions
+137
View File
@@ -1,5 +1,142 @@
# DEVLOG - ComfyUI-Workflow-Studio
## 2026-05-31: v0.3.18 — Batch タブ追加・Models 複数選択強化
### 概要
GenerateUI タブに **Batch** サブタブを追加。チェックポイントの一括生成キューを 3 ペインで組み立てられる専用 UI を実装。
Models タブの複数選択バルクアクションバーにお気に入り・バッジ操作・Deselect All を追加。
### 変更内容
#### `templates/index.html`
- **GenerateUI サブタブナビ** に `<button data-subtab="batch">Batch</button>` を追加(5 タブ目)
- **`#wfm-gen-subtab-batch`** コンテンツを追加(3 ペインレイアウト)
- 左ペイン (`.wfm-batch-left`): `wfm-ckpt-search` 検索入力 + `wfm-ckpt-list` フォルダツリー + All/None ボタン
- 中央ペイン (`.wfm-batch-center`): 内部タブナビ(Checkpoint / Lora / Prompt / Workflow)+ Checkpoint タブにグループリスト `#wfm-batch-group-list`; Lora/Prompt/Workflow は "Coming soon" プレースホルダー
- 右ペイン (`.wfm-batch-right`): Batch Queue (`#wfm-batch-preview-count` + `#wfm-batch-preview-list`)
- **Checkpoint Batch Panel** の `body` を簡略化
- 削除: `wfm-ckpt-dropdown-wrap`(フォルダツリー全体)・`wfm-ckpt-batch-info`
- 残す: 有効/無効チェックボックスとプログレス表示(`wfm-ckpt-batch-progress`)のみ
- ヘルプ更新
- `wfm-help-gen-3`: 「4-tab」→「5-tab」、Batch タブを追記
- `wfm-help-gen-11`: Checkpoint Batch をパネルのトグル説明のみに簡略化
- `wfm-help-gen-12〜14`: Batch タブ 3 ペインの説明を新規追加
- `wfm-help-models-11`: バルクアクションの全ボタン(Deselect All / ★ / ☆ / グループ / +Badge / −Badge / Delete)を網羅した説明に更新
#### `static/js/generate-tab.js`
**状態管理の刷新**
- `_batchGroupState` の `selectedModels: Set<modelName>` を廃止
- 旧: グループ選択時にメンバーをフラットな Set に追加 → グループのメンバー変更が反映されない
- 新: `selectedGroups: Set<groupName>` + `partialSelections: { groupName: Set<modelName> }` に変更
- **`_getSelectedGroupModels()`** 追加 — `_batchGroupState.groups` から常に最新のメンバーを解決して返す; グループのメンバーが変わっても自動反映
- **`_getGroupSelCount(name)`** 追加 — グループの選択済みモデル数を返す(ヘッダー CB のカウント表示用)
- **`_getSelectedCheckpoints()`** 更新 — 左ペイン選択 + `_getSelectedGroupModels()` を統合(重複排除)
**Batch タブ初期化**
- **`_loadBatchCheckpointGroups()`** — `/api/wfm/models/groups?type=checkpoint` でグループを取得; 削除されたグループを `selectedGroups` / `partialSelections` からクリーンアップ; 完了後 `_renderBatchGroupList()` と `_renderBatchPreview()` を呼ぶ
- **`_renderBatchGroupList()`** — グループリストを DOM 生成
- グループヘッダー CB: `selectedGroups` に昇格/降格ロジック付き
- 個別メンバー CB: グループ全体選択中に1つ外すと自動的に `partialSelections` に移行; 全員選択になると `selectedGroups` に昇格; 空になると `partialSelections` エントリ削除
- **`initBatchTab()`** — 内部タブ切り替え・左ペイン検索 / All / None・Batch タブ表示時の `_loadBatchCheckpointGroups()` 呼び出しを登録
- **`_renderBatchPreview()`** 追加 — Batch Queue 右ペインを更新(件数 + ファイル名リスト)
**既存コード整理**
- `_updateDropdownLabel()` / `_updateBatchInfo()` を削除 → `_renderBatchPreview()` に統一
- `initCheckpointBatch()` からドロップダウン開閉ロジック(`wfm-ckpt-dropdown-*` 関連)を削除; Pause/Resume ハンドラのみ残す
- `moveRawJsonToTab()`: `"feeder"` に加えて `"batch"` も Raw JSON 非表示対象に追加
- 初期選択状態を `_ckptState = { mode: "none" }` に変更(デフォルト全チェックなし)
#### `static/js/models-tab.js`
**新規関数**
- **`bulkSetFavorite(isFav)`** — 選択中モデルのお気に入りを一括設定(既に同状態のモデルはスキップ)
- **`bulkApplyBadge(badgeLabel, add)`** — 選択中モデルに指定バッジを一括追加 / 削除(重複・不在はスキップ)
**`renderBulkActionBar()` 更新**
- `Deselect All` ボタンを件数表示直後に追加(`clearSelection()` 呼び出し)
- `★ Favorite` / `☆ Unfavorite` ボタンを追加(グループ操作の前)
- バッジセレクト (`wfm-bulk-badge-select`) + `+Badge` / `−Badge` ボタンを追加(バッジ未定義時は disabled)
#### `static/js/i18n.js`
EN / JA / ZH 全言語に以下を追加:
- `modelBulkDeselectAll` — Deselect All / 選択解除 / 取消全选
- `modelBulkFavAdd` / `modelBulkFavRemove` — ★ Favorite / ☆ Unfavorite
- `modelBulkFavDone` / `modelBulkUnfavDone` — 完了トースト
- `modelBulkBadgeApply` / `modelBulkBadgeRemove` — +Badge / −Badge ボタンラベル
- `modelBulkBadgeApplyDone` / `modelBulkBadgeRemoveDone` — 完了トースト
- `modelBulkNoBadge` — バッジ未選択プレースホルダー
#### `static/css/main.css`
`.wfm-batch-*` スタイル一式を追加(Feeder タブの直前):
- `.wfm-batch-layout` — flex 3 ペインレイアウト
- `.wfm-batch-pane` / `.wfm-batch-left` / `.wfm-batch-center` / `.wfm-batch-right` — ペイン幅・ボーダー
- `.wfm-batch-pane-header` / `.wfm-batch-toolbar` / `.wfm-batch-list` — 左ペイン構造
- `.wfm-batch-inner-tab-nav` / `.wfm-batch-inner-tab` / `.wfm-batch-inner-content` — 中央ペイン内部タブ
- `.wfm-batch-group-list` / `.wfm-batch-group-item` / `.wfm-batch-group-header` / `.wfm-batch-group-name` / `.wfm-batch-group-count` / `.wfm-batch-group-members` — グループリスト
- `.wfm-batch-count` / `.wfm-batch-preview-list` / `.wfm-batch-preview-item` — 右ペイン(Batch Queue)
#### `README.md`
- バージョンバッジを `0.3.17` → `0.3.18` に更新
- GenerateUI Tab: "4-tab" → "5-tab"、Checkpoint Batch の説明を簡略化、Batch タブの説明を追加
- Models Tab: bulk operations の説明を全ボタン網羅に更新
- Changelog に `v0.3.18` エントリを追加
---
## 2026-05-31: v0.3.17 patch — SSLコンテキスト セキュリティ強化
### 概要
v0.3.17 のSSL修正で `CERT_NONE`(SSL検証無効)フォールバックがあり、MitM攻撃への脆弱性が指摘された。セキュリティレビューを経て当該フォールバックを削除し、SSL検証が常に維持されるよう修正。
### 変更内容
#### `py/services/civitai_service.py`
- **`_make_ssl_context()`** のフォールバックロジックを変更
- 変更前: 3段目フォールバックとして `ctx.verify_mode = ssl.CERT_NONE`(SSL検証無効)を設定していた
- 変更後: `CERT_NONE` を削除。certifi・システムSSLの両方が失敗した場合は `None` を返し、`urlopen(context=None)` でPythonデフォルトのSSL検証(`ssl.create_default_context()` 相当)にフォールバック。SSL検証が無効になるパスを完全に排除
---
## 2026-05-30: v0.3.17 — SSL証明書エラー修正・Lora Manager対応
### 概要
2つのバグ修正。CivitAI APIへのリクエストでSSL証明書の検証エラーが発生する問題(Windows Portable Python環境で再現)の修正と、ComfyUI-Lora-ManagerのLoRAローダーノードをGenerateUIタブで正しく変換・生成できるよう対応。
### 変更内容
#### `py/services/civitai_service.py`
- **`_make_ssl_context()`** ヘルパー関数を追加
1. `certifi` がインストールされていればそのCA束を使用
2. `certifi` がなければシステムデフォルトのSSLコンテキストを使用
3. いずれも失敗した場合(Windows Portable Python等でCA束が壊れている環境)は `CERT_NONE` でフォールバック(ログ警告を出力)
- **`_get_ssl_context()`** — モジュールレベルでSSLコンテキストを1回だけ生成してキャッシュ
- `fetch_by_hash()` および `download_image()` の `urlopen` 呼び出しに `context=_get_ssl_context()` を追加
- 修正対象エラー: `SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed: certificate has expired`
#### `static/js/comfyui-workflow.js`
- **`convertUiToApi()`** — Lora Loader (LoraManager) ノードの特殊ウィジェットマッピングを追加
- ノードの `properties.__lm_widget_ids`(LoRA Managerが設定するウィジェット識別子配列)が存在する場合、`widgets_values` をその配列のインデックスで直接マッピング
- `loras` キーの値(UI形式: 配列 `[...]`)をAPI形式 `{"__value__": [...]}` にラップして出力
- 修正前は `object_info` ベースのウィジェットマッピングが LoRA Manager の独自型(非 INT/FLOAT/STRING/BOOLEAN/COMBO)を認識できずスキップされていた
---
## 2026-05-20: v0.3.16 — CivitAIプレビューフォールバック表示
### 概要
+18 -4
View File
@@ -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.
![Workflow Studio](https://img.shields.io/badge/ComfyUI-Custom_Node-blue)
![Version](https://img.shields.io/badge/version-0.3.16-green)
![Version](https://img.shields.io/badge/version-0.3.18-green)
## Screenshots
@@ -47,14 +47,18 @@ Browse, organize, and execute workflows directly from a dedicated studio interfa
- **Auto-import** — the captured workflow is automatically imported and appears in the Workflow tab
### GenerateUI Tab (v0.3.5)
- **4-tab layout** — Input / Model / Settings / Feeder tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
- **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
- **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
- **Always-visible Raw JSON** — edit the API-format JSON directly from any tab with syntax highlighting; Apply button reloads the workflow; built-in **search bar** (always shown) finds all matches as you type with count display (`3/12`); navigate with ↑/↓ buttons or Enter / Shift+Enter; Escape or ✕ clears; current match highlighted in orange, other matches in yellow
- **One-click generation** — queue prompts to ComfyUI without leaving the studio
- **Seed control** — randomize, lock, or manually set seeds; seed input and mode selector stacked vertically for readability
- **Checkpoint Batch** — enable via checkbox in the right panel to sequentially generate with every checkpoint model; select checkpoints by folder from the dropdown (check a folder to select all its files, expand with ▶ for individual file selection, supports any subfolder depth); Filter input to search; All / None buttons for quick selection; **Pause/Resume** suspends processing between models; Stop aborts after the current generation; amber progress bar tracks per-model progress
- **Checkpoint Batch** — enable via checkbox in the right panel to activate sequential batch generation; Pause/Resume suspends processing between models; Stop aborts after the current generation; amber progress bar tracks per-model progress
- **Batch tab** (v0.3.18) — dedicated 3-pane layout for assembling the batch queue:
- **Left pane** — file-tree checkpoint selection; Filter input to search; All / None buttons; initial state is all unchecked
- **Center pane** — group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint tab shows groups from the Models tab — check a group to add all its members, expand ▶ to select individual models; group membership always reflects the latest Models tab state
- **Right pane (Batch Queue)** — live preview combining file-tree and group selections with duplicates removed; total count shown at top
- **UI-to-API conversion** — automatic conversion supporting subgraphs (nested workflows), COMBO types, and display-only node exclusion; improved analysis covers SDXL multi-hop CONDITIONING chains, CLIPTextEncodeSDXL, SDXLPromptStyler, KSamplerAdvanced, and more
- **Eagle integration** — auto-save generated images to [Eagle](https://eagle.cool/) with metadata
@@ -147,7 +151,7 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
- **Table view memo** — memo column displayed in table view for quick reference
- **Preview images** — auto-detect `{model_stem}.preview.png` next to model files
- **Enable / Disable models** — hide models from ComfyUI by renaming the file extension (`.disabled` suffix); toggle per card (⏸ button), per group (Enable All / Disable All), or filter by status (All / Enabled / Disabled)
- **Multi-select & bulk operations** — enter selection mode to check multiple models; bulk action bar supports add/remove from groups and permanent file deletion (model file + preview images + sidecar files such as `.json` / `.info`)
- **Multi-select & bulk operations** — enter selection mode to check multiple models; bulk action bar supports: **Deselect All** (clear all without exiting select mode), **★ Favorite / ☆ Unfavorite** (toggle favorites for all selected), **Add / Remove from Group**, **Create & Add** (new group), **+Badge / −Badge** (apply or remove a badge from all selected), and permanent **Delete Files** (model file + preview images + sidecar files such as `.json` / `.info`)
### AI TOOL Tab (v0.3.14)
- **3-pane layout** — Translation (40%) | TOOLS (40%) | Settings (20%); all panes always visible simultaneously; no sub-tab switching required
@@ -271,6 +275,16 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
## Changelog
### v0.3.18
- **Batch tab** — new 5th subtab in GenerateUI with a dedicated 3-pane layout for assembling checkpoint batch queues; left pane: file-tree checkpoint selection (filter, All/None, initially unchecked); center pane: group-based selection with inner tabs (Checkpoint / Lora / Prompt / Workflow — Lora/Prompt/Workflow coming soon); right pane: live Batch Queue preview combining both pane selections with duplicates removed
- **Checkpoint selector moved** — the checkpoint dropdown is removed from the right panel; selection is now done exclusively in the Batch tab left and center panes; the right panel retains only the enable/disable toggle and progress display
- **Group selection fix** — batch group selection now stores selected group names (not raw model names), so changes to group membership in the Models tab are always reflected in the queue without stale entries
- **Models tab bulk operations expanded** — bulk action bar now includes: Deselect All (clear all selections without exiting select mode), ★ Favorite / ☆ Unfavorite, +Badge / −Badge (apply or remove a badge from all selected models); existing group and delete operations unchanged
### v0.3.17
- **CivitAI SSL fix** — resolved `CERTIFICATE_VERIFY_FAILED` errors when fetching model info on Windows Portable Python environments; uses `certifi` CA bundle when available, falls back to system store, and disables verification only as a last resort with a warning log
- **Lora Manager support** — `Lora Loader (LoraManager)` nodes (ComfyUI-Lora-Manager) are now correctly converted from UI format to API format in the GenerateUI tab; the `loras` widget array is wrapped to `{"__value__": [...]}` as required by the node, enabling generation with LoRA Manager workflows
### v0.3.16
- **CivitAI preview fallback** — model cards and the detail panel's Info tab now display the first CivitAI image directly when no local preview file exists; if the backend download fails (e.g. network restriction server-side), the browser fetches the image URL from the CivitAI cache as a fallback so the preview is always shown after fetching
+35 -2
View File
@@ -3,6 +3,7 @@
import hashlib
import json
import logging
import ssl
from pathlib import Path
from urllib.request import Request, urlopen
from urllib.error import URLError, HTTPError
@@ -11,6 +12,38 @@ from ..config import DATA_DIR
logger = logging.getLogger(__name__)
def _make_ssl_context():
"""Return an SSL context with CA verification.
1. certifi CA bundle (available in virtually all ComfyUI envs via torch→requests→certifi)
2. System default SSL context (OS certificate store)
Returns None if both fail — callers fall back to urlopen without context
(Python's own default, which also uses certifi when available).
SSL verification is never disabled to avoid MitM exposure.
"""
try:
import certifi
return ssl.create_default_context(cafile=certifi.where())
except Exception:
pass
try:
return ssl.create_default_context()
except Exception:
pass
logger.warning("CivitAI: could not build SSL context; falling back to urllib default")
return None
_SSL_CONTEXT = _make_ssl_context # lazy sentinel
def _get_ssl_context():
global _SSL_CONTEXT
if callable(_SSL_CONTEXT):
_SSL_CONTEXT = _make_ssl_context()
return _SSL_CONTEXT
CIVITAI_API_BASE = "https://civitai.com/api/v1"
CIVITAI_CACHE_FILE = DATA_DIR / "civitai_cache.json"
@@ -77,7 +110,7 @@ class CivitaiService:
url = f"{CIVITAI_API_BASE}/model-versions/by-hash/{sha256_hash}"
try:
req = Request(url, headers={"User-Agent": "ComfyUI-Workflow-Studio/1.0"})
with urlopen(req, timeout=15) as resp:
with urlopen(req, timeout=15, context=_get_ssl_context()) as resp:
data = json.loads(resp.read().decode("utf-8"))
if not data or "id" not in data:
@@ -201,7 +234,7 @@ class CivitaiService:
"""Download an image from URL and save to save_path. Returns True on success."""
try:
req = Request(url, headers={"User-Agent": "ComfyUI-Workflow-Studio/1.0"})
with urlopen(req, timeout=timeout) as resp:
with urlopen(req, timeout=timeout, context=_get_ssl_context()) as resp:
data = resp.read()
with open(save_path, "wb") as f:
f.write(data)
+1 -1
View File
@@ -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.7"
version = "0.3.18"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+103
View File
@@ -3910,6 +3910,109 @@ body {
margin: 0 4px;
}
/* ── Batch Tab ──────────────────────────────────────────────────── */
.wfm-batch-layout {
display: flex;
height: 100%;
overflow: hidden;
gap: 0;
}
.wfm-batch-pane {
display: flex;
flex-direction: column;
overflow: hidden;
min-width: 0;
border-right: 1px solid var(--wfm-border);
}
.wfm-batch-pane:last-child { border-right: none; }
.wfm-batch-left { width: 240px; flex-shrink: 0; }
.wfm-batch-center { flex: 1; }
.wfm-batch-right { width: 210px; flex-shrink: 0; }
.wfm-batch-pane-header {
font-size: 11px;
font-weight: 600;
color: var(--wfm-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
padding: 6px 10px;
border-bottom: 1px solid var(--wfm-border);
flex-shrink: 0;
}
.wfm-batch-toolbar {
display: flex;
gap: 4px;
padding: 6px 8px;
border-bottom: 1px solid var(--wfm-border);
flex-shrink: 0;
align-items: center;
}
.wfm-batch-toolbar input {
flex: 1;
min-width: 0;
height: 24px;
padding: 2px 6px;
font-size: 11px;
}
.wfm-batch-list { flex: 1; overflow-y: auto; }
.wfm-batch-inner-tab-nav {
display: flex;
border-bottom: 1px solid var(--wfm-border);
flex-shrink: 0;
}
.wfm-batch-inner-tab {
flex: 1;
padding: 5px 6px;
font-size: 11px;
background: transparent;
border: none;
color: var(--wfm-text-secondary);
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
transition: color 0.15s;
}
.wfm-batch-inner-tab:hover { color: var(--wfm-text-primary); background: var(--wfm-surface); }
.wfm-batch-inner-tab.active { color: var(--wfm-primary); border-bottom-color: var(--wfm-primary); }
.wfm-batch-inner-content {
display: none;
flex-direction: column;
flex: 1;
overflow: hidden;
}
.wfm-batch-inner-content.active { display: flex; }
.wfm-batch-group-list { flex: 1; overflow-y: auto; padding: 2px 0; }
.wfm-batch-group-item { border-bottom: 1px solid rgba(255,255,255,0.04); }
.wfm-batch-group-item:last-child { border-bottom: none; }
.wfm-batch-group-header {
display: flex;
align-items: center;
gap: 4px;
padding: 5px 8px;
font-size: 12px;
}
.wfm-batch-group-header:hover { background: rgba(255,255,255,0.05); }
.wfm-batch-group-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfm-batch-group-count { font-size: 10px; color: var(--wfm-text-secondary); white-space: nowrap; }
.wfm-batch-group-members { display: none; }
.wfm-batch-group-item.open .wfm-batch-group-members { display: block; }
.wfm-batch-count {
font-size: 11px;
color: var(--wfm-text-secondary);
padding: 4px 10px;
border-bottom: 1px solid var(--wfm-border);
flex-shrink: 0;
}
.wfm-batch-preview-list { flex: 1; overflow-y: auto; padding: 2px 0; }
.wfm-batch-preview-item {
padding: 3px 10px;
font-size: 11px;
color: var(--wfm-text-primary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wfm-batch-preview-item:hover { background: rgba(255,255,255,0.05); }
/* ── Feeder Tab ─────────────────────────────────────────────────── */
.wfm-feeder-layout {
display: flex;
+16
View File
@@ -305,6 +305,21 @@ export const comfyWorkflow = {
// 2. Map widgets_values to widget input names using object_info
const widgets = node.widgets_values || [];
if (widgets.length > 0) {
// Lora Loader (LoraManager): use __lm_widget_ids from node properties
// widgets_values: [autocomplete_meta_obj, text_str, loras_array]
// API format: {__lm_autocomplete_meta_text: obj, text: str, loras: {__value__: arr}}
const lmWidgetIds = node.properties?.__lm_widget_ids;
if (lmWidgetIds && Array.isArray(lmWidgetIds)) {
lmWidgetIds.forEach((name, idx) => {
if (idx >= widgets.length || linkedInputNames.has(name)) return;
let val = widgets[idx];
if (name === "loras" && Array.isArray(val)) {
val = { "__value__": val };
}
inputs[name] = val;
});
} else {
const widgetNames = _getWidgetInputNames(objectInfo, node.type);
if (widgetNames.length > 0) {
@@ -374,6 +389,7 @@ export const comfyWorkflow = {
});
}
}
} // end else (non-LoraManager path)
}
api[nodeId] = {
+252 -79
View File
@@ -172,25 +172,75 @@ function _setPauseBtnState(paused) {
}
// mode: "all" = 全選択, "some" = 一部選択, "none" = 全解除
const _ckptState = { mode: "all", selected: new Set() };
const _ckptState = { mode: "none", selected: new Set() };
// グループ選択状態(中央ペイン)
// selectedGroups : グループ全体が選択済み(グループ名のSet)
// partialSelections: 部分選択 { groupName: Set<modelName> }
// → モデル一覧は常に _batchGroupState.groups から解決するため
// グループのメンバーが変わっても自動的に最新状態を反映できる
const _batchGroupState = {
groups: {},
selectedGroups: new Set(),
partialSelections: {},
};
// 中央ペインの選択から現在のグループメンバーを解決して返す
function _getSelectedGroupModels() {
const result = new Set();
for (const [name, members] of Object.entries(_batchGroupState.groups)) {
if (_batchGroupState.selectedGroups.has(name)) {
members.forEach((m) => result.add(m));
} else {
const partial = _batchGroupState.partialSelections[name];
if (partial) partial.forEach((m) => { if (members.includes(m)) result.add(m); });
}
}
return result;
}
// グループの選択済みモデル数を返す(UIのカウント表示用)
function _getGroupSelCount(name) {
const members = _batchGroupState.groups[name] || [];
if (_batchGroupState.selectedGroups.has(name)) return members.length;
const partial = _batchGroupState.partialSelections[name];
return partial ? members.filter((m) => partial.has(m)).length : 0;
}
function _getSelectedCheckpoints() {
const all = comfyEditor.models.checkpoints || [];
if (_ckptState.mode === "all") return all;
if (_ckptState.mode === "none") return [];
return all.filter((m) => _ckptState.selected.has(m));
// 左ペイン(ファイルツリー)選択
let leftModels;
if (_ckptState.mode === "all") leftModels = all;
else if (_ckptState.mode === "none") leftModels = [];
else leftModels = all.filter((m) => _ckptState.selected.has(m));
// 中央ペイン(グループ)選択を統合(重複排除)
const seen = new Set(leftModels);
const result = [...leftModels];
for (const m of _getSelectedGroupModels()) {
if (!seen.has(m)) { seen.add(m); result.push(m); }
}
return result;
}
function _updateDropdownLabel() {
const labelEl = document.getElementById("wfm-ckpt-dropdown-label");
if (!labelEl) return;
const total = (comfyEditor.models.checkpoints || []).length;
if (_ckptState.mode === "all") {
labelEl.textContent = total > 0 ? `All (${total})` : "All checkpoints";
} else if (_ckptState.mode === "none") {
labelEl.textContent = `0 / ${total} selected`;
} else {
labelEl.textContent = `${_ckptState.selected.size} / ${total} selected`;
function _renderBatchPreview() {
const countEl = document.getElementById("wfm-batch-preview-count");
const listEl = document.getElementById("wfm-batch-preview-list");
const list = _getSelectedCheckpoints();
const n = list.length;
if (countEl) countEl.textContent = `${n} checkpoint${n !== 1 ? "s" : ""} queued`;
if (listEl) {
if (n === 0) {
listEl.innerHTML = `<p class="wfm-placeholder" style="font-size:11px;padding:12px;">No checkpoints selected</p>`;
return;
}
listEl.innerHTML = list.map((m, i) => {
const name = m.replace(/\\/g, "/").split("/").pop();
const safe = m.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
const safeName = name.replace(/&/g, "&amp;").replace(/</g, "&lt;");
return `<div class="wfm-batch-preview-item" title="${safe}">${i + 1}. ${safeName}</div>`;
}).join("");
}
}
@@ -323,8 +373,7 @@ function _rebuildCkptList() {
const s = _getFolderCheckState(models);
folderCb.checked = s === "checked";
folderCb.indeterminate = s === "indeterminate";
_updateDropdownLabel();
_updateBatchInfo();
_renderBatchPreview();
});
itemLabel.appendChild(fileCb);
@@ -337,8 +386,7 @@ function _rebuildCkptList() {
_toggleFolderModels(models, folderCb.checked, all);
folderCb.indeterminate = false;
filesDiv.querySelectorAll("input[type=checkbox]").forEach((cb) => { cb.checked = folderCb.checked; });
_updateDropdownLabel();
_updateBatchInfo();
_renderBatchPreview();
});
// フォルダ名 / トグル矢印クリックで展開・折りたたみ
@@ -356,70 +404,194 @@ function _rebuildCkptList() {
}
}
function _updateBatchInfo() {
const infoEl = document.getElementById("wfm-ckpt-batch-info");
if (!infoEl) return;
const n = _getSelectedCheckpoints().length;
infoEl.textContent = `${n} checkpoint${n !== 1 ? "s" : ""} will be processed`;
// ============================================
// Batch Tab
// ============================================
async function _loadBatchCheckpointGroups() {
try {
const res = await fetch("/api/wfm/models/groups?type=checkpoint");
if (res.ok) _batchGroupState.groups = await res.json();
else _batchGroupState.groups = {};
} catch { _batchGroupState.groups = {}; }
// 削除されたグループを選択状態からも除去
const currentNames = new Set(Object.keys(_batchGroupState.groups));
for (const name of _batchGroupState.selectedGroups) {
if (!currentNames.has(name)) _batchGroupState.selectedGroups.delete(name);
}
for (const name of Object.keys(_batchGroupState.partialSelections)) {
if (!currentNames.has(name)) delete _batchGroupState.partialSelections[name];
}
_renderBatchGroupList();
_renderBatchPreview();
}
function _renderBatchGroupList() {
const el = document.getElementById("wfm-batch-group-list");
if (!el) return;
const groups = _batchGroupState.groups;
const names = Object.keys(groups).sort();
if (names.length === 0) {
el.innerHTML = `<p class="wfm-placeholder" style="font-size:12px;padding:16px;">No groups defined.<br>Create groups in the Models tab.</p>`;
return;
}
el.innerHTML = "";
for (const name of names) {
const members = groups[name] || [];
const groupDiv = document.createElement("div");
groupDiv.className = "wfm-batch-group-item open";
const headerDiv = document.createElement("div");
headerDiv.className = "wfm-batch-group-header";
const cb = document.createElement("input");
cb.type = "checkbox";
const selCount = _getGroupSelCount(name);
cb.checked = members.length > 0 && selCount === members.length;
cb.indeterminate = selCount > 0 && selCount < members.length;
const toggle = document.createElement("span");
toggle.className = "wfm-ckpt-folder-toggle";
toggle.textContent = "▶";
const nameSpan = document.createElement("span");
nameSpan.className = "wfm-batch-group-name";
nameSpan.textContent = name;
const countSpan = document.createElement("span");
countSpan.className = "wfm-batch-group-count";
countSpan.textContent = `${selCount}/${members.length}`;
const memberDiv = document.createElement("div");
memberDiv.className = "wfm-batch-group-members";
for (const m of members) {
const label = document.createElement("label");
label.className = "wfm-ckpt-item wfm-ckpt-item--indented";
const fileCb = document.createElement("input");
fileCb.type = "checkbox";
fileCb.value = m;
// 選択状態: グループ全体選択 or 部分選択に含まれる
fileCb.checked = _batchGroupState.selectedGroups.has(name)
|| !!(_batchGroupState.partialSelections[name]?.has(m));
const fileName = m.replace(/\\/g, "/").split("/").pop();
const fileSpan = document.createElement("span");
fileSpan.className = "wfm-ckpt-item-label";
fileSpan.textContent = fileName;
fileSpan.title = m;
fileCb.addEventListener("change", () => {
if (_batchGroupState.selectedGroups.has(name)) {
// グループ全体選択中に1つ外す → 部分選択に移行
_batchGroupState.selectedGroups.delete(name);
const partial = new Set(members);
partial.delete(m);
if (partial.size > 0) _batchGroupState.partialSelections[name] = partial;
} else {
if (!_batchGroupState.partialSelections[name]) {
_batchGroupState.partialSelections[name] = new Set();
}
if (fileCb.checked) _batchGroupState.partialSelections[name].add(m);
else _batchGroupState.partialSelections[name].delete(m);
// 全員選択 → selectedGroups に昇格
if (members.every((x) => _batchGroupState.partialSelections[name].has(x))) {
_batchGroupState.selectedGroups.add(name);
delete _batchGroupState.partialSelections[name];
}
// 空になった → partial削除
if (_batchGroupState.partialSelections[name]?.size === 0) {
delete _batchGroupState.partialSelections[name];
}
}
const sc = _getGroupSelCount(name);
cb.checked = sc === members.length && members.length > 0;
cb.indeterminate = sc > 0 && sc < members.length;
countSpan.textContent = `${sc}/${members.length}`;
_renderBatchPreview();
});
label.appendChild(fileCb);
label.appendChild(fileSpan);
memberDiv.appendChild(label);
}
cb.addEventListener("change", () => {
if (cb.checked) {
_batchGroupState.selectedGroups.add(name);
delete _batchGroupState.partialSelections[name];
} else {
_batchGroupState.selectedGroups.delete(name);
delete _batchGroupState.partialSelections[name];
}
memberDiv.querySelectorAll("input[type=checkbox]").forEach((c) => { c.checked = cb.checked; });
countSpan.textContent = `${cb.checked ? members.length : 0}/${members.length}`;
_renderBatchPreview();
});
[toggle, nameSpan].forEach((el) => {
el.addEventListener("click", () => groupDiv.classList.toggle("open"));
});
headerDiv.appendChild(cb);
headerDiv.appendChild(toggle);
headerDiv.appendChild(nameSpan);
headerDiv.appendChild(countSpan);
groupDiv.appendChild(headerDiv);
groupDiv.appendChild(memberDiv);
el.appendChild(groupDiv);
}
}
function initBatchTab() {
// 内部タブ切り替え
document.querySelectorAll(".wfm-batch-inner-tab").forEach((btn) => {
btn.addEventListener("click", () => {
document.querySelectorAll(".wfm-batch-inner-tab").forEach((b) => b.classList.remove("active"));
btn.classList.add("active");
const tabId = btn.dataset.batchInner;
document.querySelectorAll(".wfm-batch-inner-content").forEach((c) => c.classList.remove("active"));
document.getElementById(`wfm-batch-inner-${tabId}`)?.classList.add("active");
});
});
// 検索フィルター(左ペイン)
document.getElementById("wfm-ckpt-search")?.addEventListener("input", _rebuildCkptList);
// 全選択 / 全解除(左ペイン)
document.getElementById("wfm-ckpt-select-all")?.addEventListener("click", () => {
_ckptState.mode = "all";
_ckptState.selected.clear();
_rebuildCkptList();
_renderBatchPreview();
});
document.getElementById("wfm-ckpt-deselect-all")?.addEventListener("click", () => {
_ckptState.mode = "none";
_ckptState.selected.clear();
_rebuildCkptList();
_renderBatchPreview();
});
// Batch タブが表示されたときにグループを読み込む
document.querySelector('[data-subtab="batch"]')?.addEventListener("click", () => {
_rebuildCkptList();
_loadBatchCheckpointGroups();
_renderBatchPreview();
});
}
function initCheckpointBatch() {
const checkbox = document.getElementById("wfm-ckpt-batch-enabled");
const body = document.getElementById("wfm-ckpt-batch-body");
const wrap = document.getElementById("wfm-ckpt-dropdown-wrap");
const btn = document.getElementById("wfm-ckpt-dropdown-btn");
const panel = document.getElementById("wfm-ckpt-dropdown-panel");
checkbox?.addEventListener("change", () => {
if (body) body.style.display = checkbox.checked ? "block" : "none";
if (checkbox.checked) {
_updateDropdownLabel();
_updateBatchInfo();
}
});
// ドロップダウン開閉
btn?.addEventListener("click", (e) => {
e.stopPropagation();
const isOpen = panel.style.display !== "none";
if (isOpen) {
panel.style.display = "none";
wrap.classList.remove("open");
} else {
_rebuildCkptList();
panel.style.display = "block";
wrap.classList.add("open");
document.getElementById("wfm-ckpt-search")?.focus();
}
});
// 外側クリックで閉じる
document.addEventListener("click", (e) => {
if (panel && panel.style.display !== "none" && !wrap?.contains(e.target)) {
panel.style.display = "none";
wrap?.classList.remove("open");
}
});
// 検索フィルター
document.getElementById("wfm-ckpt-search")?.addEventListener("input", _rebuildCkptList);
// 全選択
document.getElementById("wfm-ckpt-select-all")?.addEventListener("click", () => {
_ckptState.mode = "all";
_ckptState.selected.clear();
_rebuildCkptList();
_updateDropdownLabel();
_updateBatchInfo();
});
// 全解除
document.getElementById("wfm-ckpt-deselect-all")?.addEventListener("click", () => {
_ckptState.mode = "none";
_ckptState.selected.clear();
_rebuildCkptList();
_updateDropdownLabel();
_updateBatchInfo();
});
// Pause / Resume
@@ -669,8 +841,7 @@ export async function initGenerateTab() {
comfyEditor.renderAll(comfyUI.currentAnalysis, comfyUI.currentWorkflow);
}
showToast("Model lists refreshed", "success");
_updateDropdownLabel();
_updateBatchInfo();
_renderBatchPreview();
});
// Generate button
@@ -693,7 +864,7 @@ export async function initGenerateTab() {
function moveRawJsonToTab(tabKey) {
const widget = document.getElementById("wfm-gen-rawjson-widget");
if (!widget) return;
if (tabKey === "feeder") {
if (tabKey === "feeder" || tabKey === "batch") {
widget.style.display = "none";
return;
}
@@ -865,6 +1036,9 @@ export async function initGenerateTab() {
// Checkpoint batch UI
initCheckpointBatch();
// Batch tab
initBatchTab();
// Feeder tab
await initFeederTab();
@@ -873,8 +1047,7 @@ export async function initGenerateTab() {
updateStatus(connected);
if (connected) {
await comfyEditor.loadModelLists();
_updateDropdownLabel();
_updateBatchInfo();
_renderBatchPreview();
}
// Auto-load default workflow (doesn't require ComfyUI connection)
+30
View File
@@ -295,6 +295,16 @@ const LANGUAGES = {
modelBulkDeleteConfirm: "Permanently delete {count} model file(s) and their preview images? This cannot be undone.",
modelBulkDeleteDone: "model file(s) deleted",
modelBulkDeleteError: "Failed to delete some models",
modelBulkDeselectAll: "Deselect All",
modelBulkFavAdd: "★ Favorite",
modelBulkFavRemove: "☆ Unfavorite",
modelBulkFavDone: "models favorited",
modelBulkUnfavDone: "models unfavorited",
modelBulkBadgeApply: "+Badge",
modelBulkBadgeRemove: "−Badge",
modelBulkBadgeApplyDone: "badge applied to models",
modelBulkBadgeRemoveDone: "badge removed from models",
modelBulkNoBadge: "Select badge...",
civitaiFetchDesc: "Fetch model information from CivitAI using SHA256 hash.",
civitaiFetch: "Fetch from CivitAI",
civitaiHashing: "Calculating hash... (may take a while for large files)",
@@ -922,6 +932,16 @@ const LANGUAGES = {
modelBulkDeleteConfirm: "{count}件のモデルファイルとプレビュー画像を完全に削除しますか?この操作は取り消せません。",
modelBulkDeleteDone: "件のモデルファイルを削除しました",
modelBulkDeleteError: "一部のモデルの削除に失敗しました",
modelBulkDeselectAll: "選択解除",
modelBulkFavAdd: "★ お気に入り追加",
modelBulkFavRemove: "☆ お気に入り解除",
modelBulkFavDone: "件をお気に入りに追加しました",
modelBulkUnfavDone: "件のお気に入りを解除しました",
modelBulkBadgeApply: "+バッジ",
modelBulkBadgeRemove: "−バッジ",
modelBulkBadgeApplyDone: "件のモデルにバッジを適用しました",
modelBulkBadgeRemoveDone: "件のモデルからバッジを削除しました",
modelBulkNoBadge: "バッジを選択...",
civitaiFetchDesc: "SHA256ハッシュを使用してCivitAIからモデル情報を取得します。",
civitaiFetch: "CivitAIから取得",
civitaiHashing: "ハッシュ計算中...(大きいファイルは時間がかかります)",
@@ -1545,6 +1565,16 @@ const LANGUAGES = {
modelBulkDeleteConfirm: "永久删除 {count} 个模型文件及其预览图?此操作无法撤销。",
modelBulkDeleteDone: "个模型文件已删除",
modelBulkDeleteError: "部分模型删除失败",
modelBulkDeselectAll: "取消全选",
modelBulkFavAdd: "★ 收藏",
modelBulkFavRemove: "☆ 取消收藏",
modelBulkFavDone: "个模型已收藏",
modelBulkUnfavDone: "个模型已取消收藏",
modelBulkBadgeApply: "+徽章",
modelBulkBadgeRemove: "−徽章",
modelBulkBadgeApplyDone: "个模型已应用徽章",
modelBulkBadgeRemoveDone: "个模型已移除徽章",
modelBulkNoBadge: "选择徽章...",
civitaiFetchDesc: "使用SHA256哈希从CivitAI获取模型信息。",
civitaiFetch: "从CivitAI获取",
civitaiHashing: "计算哈希中...(大文件可能需要较长时间)",
+67 -2
View File
@@ -272,20 +272,39 @@ function renderBulkActionBar() {
? `<option value="">${t("modelsNoGroupAvailable")}</option>`
: groupNames.map((g) => `<option value="${escapeHtml(g)}">${escapeHtml(g)}</option>`).join("");
const palette = getBadgePalette();
const badgeLabels = Object.keys(palette).sort();
const noBadges = badgeLabels.length === 0;
const badgeOptions = noBadges
? `<option value="">${t("modelBulkNoBadge")}</option>`
: badgeLabels.map((b) => `<option value="${escapeHtml(b)}">${escapeHtml(b)}</option>`).join("");
bar.style.display = "flex";
bar.innerHTML = `
<span class="wfm-bulk-count">${count} ${t("modelSelected")}</span>
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-deselect-all-btn">${t("modelBulkDeselectAll")}</button>
<span class="wfm-bulk-sep">|</span>
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-fav-add-btn" title="${t("modelBulkFavAdd")}">${t("modelBulkFavAdd")}</button>
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-fav-remove-btn" title="${t("modelBulkFavRemove")}">${t("modelBulkFavRemove")}</button>
<span class="wfm-bulk-sep">|</span>
<select id="wfm-bulk-group-select" class="wfm-select" style="font-size:12px;">${groupOptions}</select>
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="wfm-bulk-add-btn"${noGroups ? " disabled" : ""}>${t("modelBulkAddGroup")}</button>
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-remove-btn"${noGroups ? " disabled" : ""}>${t("modelBulkRemoveGroup")}</button>
<span class="wfm-bulk-sep">|</span>
<input type="text" id="wfm-bulk-new-group-input" class="wfm-search-input" style="width:120px;font-size:12px;" placeholder="${t("modelsGroupName")}">
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-create-add-btn">${t("modelBulkCreateAdd")}</button>
<span class="wfm-bulk-sep">|</span>
<select id="wfm-bulk-badge-select" class="wfm-select" style="font-size:12px;">${badgeOptions}</select>
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="wfm-bulk-badge-apply-btn"${noBadges ? " disabled" : ""}>${t("modelBulkBadgeApply")}</button>
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-badge-remove-btn"${noBadges ? " disabled" : ""}>${t("modelBulkBadgeRemove")}</button>
<span class="wfm-bulk-sep">|</span>
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-clear-btn" title="Clear selection">&times;</button>
<span class="wfm-bulk-sep" style="margin-left:8px;"></span>
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-delete-btn">${t("modelBulkDelete")}</button>
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-delete-btn" style="margin-left:4px;">${t("modelBulkDelete")}</button>
`;
document.getElementById("wfm-bulk-deselect-all-btn")?.addEventListener("click", clearSelection);
document.getElementById("wfm-bulk-fav-add-btn")?.addEventListener("click", () => bulkSetFavorite(true));
document.getElementById("wfm-bulk-fav-remove-btn")?.addEventListener("click", () => bulkSetFavorite(false));
document.getElementById("wfm-bulk-add-btn")?.addEventListener("click", () => {
const g = document.getElementById("wfm-bulk-group-select")?.value;
if (g) bulkAddToGroup(g);
@@ -301,6 +320,14 @@ function renderBulkActionBar() {
if (state.modelGroups[name]) { showToast(t("modelsGroupExists"), "warning"); return; }
bulkAddToGroup(name);
});
document.getElementById("wfm-bulk-badge-apply-btn")?.addEventListener("click", () => {
const label = document.getElementById("wfm-bulk-badge-select")?.value;
if (label) bulkApplyBadge(label, true);
});
document.getElementById("wfm-bulk-badge-remove-btn")?.addEventListener("click", () => {
const label = document.getElementById("wfm-bulk-badge-select")?.value;
if (label) bulkApplyBadge(label, false);
});
document.getElementById("wfm-bulk-clear-btn")?.addEventListener("click", clearSelection);
document.getElementById("wfm-bulk-delete-btn")?.addEventListener("click", bulkDeleteModels);
}
@@ -328,6 +355,44 @@ async function bulkRemoveFromGroup(groupName) {
renderBulkActionBar();
}
async function bulkSetFavorite(isFav) {
const models = [...state.selectedModels];
let count = 0;
for (const mn of models) {
const meta = state.modelMetadata[mn] || {};
if (meta.favorite === isFav) continue;
await saveModelMetadata(mn, { favorite: isFav });
count++;
}
if (count > 0) {
showToast(`${count} ${isFav ? t("modelBulkFavDone") : t("modelBulkUnfavDone")}`, "success");
renderModelGrid();
}
}
async function bulkApplyBadge(badgeLabel, add) {
const models = [...state.selectedModels];
let count = 0;
for (const mn of models) {
const meta = state.modelMetadata[mn] || {};
const badges = [...(meta.badges || [])];
if (add) {
if (badges.includes(badgeLabel)) continue;
badges.push(badgeLabel);
} else {
const idx = badges.indexOf(badgeLabel);
if (idx === -1) continue;
badges.splice(idx, 1);
}
await saveModelMetadata(mn, { badges });
count++;
}
if (count > 0) {
showToast(`${count} ${add ? t("modelBulkBadgeApplyDone") : t("modelBulkBadgeRemoveDone")}`, "success");
renderModelGrid();
}
}
async function bulkDeleteModels() {
const count = state.selectedModels.size;
if (count === 0) return;
+54 -24
View File
@@ -267,6 +267,7 @@
<button class="wfm-gen-subtab-btn" data-subtab="model">Model</button>
<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>
</div>
<!-- Tab: Input — left sub-col: Prompt(top)+Image(bottom), right sub-col: Raw JSON -->
@@ -313,6 +314,52 @@
<div class="wfm-gen-rawjson-col" id="wfm-gen-rawjson-col-settings"></div>
</div>
</div>
<!-- Tab: Batch — 3-pane: file tree | group select | queue preview -->
<div id="wfm-gen-subtab-batch" class="wfm-gen-subtab-content">
<div class="wfm-batch-layout">
<!-- Left pane: file-tree checkpoint selection -->
<div class="wfm-batch-pane wfm-batch-left">
<div class="wfm-batch-pane-header">Checkpoints</div>
<div class="wfm-batch-toolbar">
<input type="text" id="wfm-ckpt-search" class="wfm-input" placeholder="Filter...">
<button type="button" id="wfm-ckpt-select-all" class="wfm-btn wfm-btn-sm">All</button>
<button type="button" id="wfm-ckpt-deselect-all" class="wfm-btn wfm-btn-sm">None</button>
</div>
<div id="wfm-ckpt-list" class="wfm-batch-list"></div>
</div>
<!-- Center pane: group-based selection with inner tabs -->
<div class="wfm-batch-pane wfm-batch-center">
<div class="wfm-batch-inner-tab-nav">
<button class="wfm-batch-inner-tab active" data-batch-inner="checkpoint">Checkpoint</button>
<button class="wfm-batch-inner-tab" data-batch-inner="lora">Lora</button>
<button class="wfm-batch-inner-tab" data-batch-inner="prompt">Prompt</button>
<button class="wfm-batch-inner-tab" data-batch-inner="workflow">Workflow</button>
</div>
<div id="wfm-batch-inner-checkpoint" class="wfm-batch-inner-content active">
<div class="wfm-batch-pane-header" style="border-top:none;">Groups</div>
<div id="wfm-batch-group-list" class="wfm-batch-group-list"></div>
</div>
<div id="wfm-batch-inner-lora" class="wfm-batch-inner-content">
<p class="wfm-placeholder" style="font-size:12px;margin:20px auto;">Coming soon</p>
</div>
<div id="wfm-batch-inner-prompt" class="wfm-batch-inner-content">
<p class="wfm-placeholder" style="font-size:12px;margin:20px auto;">Coming soon</p>
</div>
<div id="wfm-batch-inner-workflow" class="wfm-batch-inner-content">
<p class="wfm-placeholder" style="font-size:12px;margin:20px auto;">Coming soon</p>
</div>
</div>
<!-- Right pane: batch queue preview -->
<div class="wfm-batch-pane wfm-batch-right">
<div class="wfm-batch-pane-header">Batch Queue</div>
<div id="wfm-batch-preview-count" class="wfm-batch-count"></div>
<div id="wfm-batch-preview-list" class="wfm-batch-preview-list"></div>
</div>
</div>
</div>
<!-- Tab: Feeder — full-width: settings(left) + library(center) -->
<div id="wfm-gen-subtab-feeder" class="wfm-gen-subtab-content">
<div class="wfm-feeder-layout">
@@ -469,27 +516,7 @@
<label for="wfm-ckpt-batch-enabled" style="font-weight:600;font-size:13px;cursor:pointer;">Checkpoint Batch</label>
</div>
<div id="wfm-ckpt-batch-body" style="display:none;margin-top:8px;">
<div style="margin-bottom:6px;">
<div style="font-size:11px;color:var(--wfm-text-secondary);margin-bottom:3px;">Checkpoints</div>
<div class="wfm-ckpt-dropdown-wrap" id="wfm-ckpt-dropdown-wrap">
<button type="button" id="wfm-ckpt-dropdown-btn" class="wfm-ckpt-dropdown-trigger">
<span id="wfm-ckpt-dropdown-label">All checkpoints</span>
<span class="wfm-ckpt-dropdown-arrow">&#9660;</span>
</button>
<div id="wfm-ckpt-dropdown-panel" class="wfm-ckpt-dropdown-panel" style="display:none;">
<div style="padding:6px 8px 4px;">
<input type="text" id="wfm-ckpt-search" class="wfm-input" style="height:28px;padding:4px 8px;font-size:11px;" placeholder="Filter...">
</div>
<div style="display:flex;gap:4px;padding:0 8px 4px;">
<button type="button" id="wfm-ckpt-select-all" class="wfm-btn wfm-btn-sm" style="flex:1;font-size:10px;">All</button>
<button type="button" id="wfm-ckpt-deselect-all" class="wfm-btn wfm-btn-sm" style="flex:1;font-size:10px;">None</button>
</div>
<div id="wfm-ckpt-list" class="wfm-ckpt-dropdown-list"></div>
</div>
</div>
</div>
<div id="wfm-ckpt-batch-info" style="font-size:11px;color:var(--wfm-text-secondary);"></div>
<div id="wfm-ckpt-batch-progress" style="margin-top:8px;display:none;">
<div id="wfm-ckpt-batch-progress" style="display:none;">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:4px;font-size:11px;">
<span id="wfm-ckpt-batch-current-name" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:75%;color:var(--wfm-text-primary);"></span>
<span id="wfm-ckpt-batch-count" style="color:var(--wfm-text-secondary);white-space:nowrap;margin-left:8px;"></span>
@@ -822,7 +849,7 @@
<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)</li>
<li id="wfm-help-gen-3">4-tab layout — Input (Prompt + Image), Model, Settings, Feeder — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</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: Prompt (top) and Image drag-and-drop (bottom) in the left column</li>
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter</li>
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
@@ -830,7 +857,10 @@
<li id="wfm-help-gen-8">Seed control: random, fixed, increment, decrement — seed input and mode selector stacked vertically for readability</li>
<li id="wfm-help-gen-9">Generate, progress display, stop, and view results</li>
<li id="wfm-help-gen-10">Eagle integration: auto-save generated images to Eagle</li>
<li id="wfm-help-gen-11">Checkpoint Batch: select checkpoints by folder from the dropdown — check a folder to select all its files, or expand with ▶ to check individual files; use Filter to search; Pause/Resume suspends and continues between models; Stop aborts after the current generation</li>
<li id="wfm-help-gen-11">Checkpoint Batch toggle (right panel): enable/disable batch mode — when enabled, Generate runs through all queued checkpoints sequentially with Pause/Resume and Stop controls</li>
<li id="wfm-help-gen-12">Batch tab — 3-pane layout: Left pane (file tree) selects checkpoints by folder; use Filter to narrow the list, All/None buttons to select or clear all; initial state is all unchecked</li>
<li id="wfm-help-gen-13">Batch tab — Center pane: group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint tab shows groups defined in the Models tab — check a group header to select all its members, or expand ▶ to check individual models; group membership always reflects the current Models tab state</li>
<li id="wfm-help-gen-14">Batch tab — Right pane (Batch Queue): live preview of all checkpoints that will be processed, combining file-tree and group selections with duplicates removed; count shown at top</li>
</ul>
</div>
@@ -937,7 +967,7 @@
<li id="wfm-help-models-8">GenUI Model button: apply the selected model to the corresponding node in GenerateUI's current workflow (Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)</li>
<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 &amp; 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).</li>
<li id="wfm-help-models-11">Multi-select &amp; bulk operations: click Select to enter selection mode, then check multiple models; the bulk action bar provides: Deselect All — clear all selections without exiting select mode; ★ Favorite / ☆ Unfavorite — toggle favorites for all selected models; Add to Group / Remove from Group — assign or remove from an existing group; Create &amp; Add — type a new group name and add all selected; +Badge / −Badge — apply or remove a badge from all selected; Delete Files — permanently remove model files, preview images, and sidecar files (.json/.info)</li>
</ul>
</div>