Compare commits

...
3 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 4.6 080d75b8c4 feat: remove card view, add 4-type batch selector UI (v0.3.22)
- Remove Card view from Workflow and Models tabs (Thumbnail/Table only);
  localStorage fallback: stored "card" value defaults to "thumb"
- Replace Checkpoint Batch toggle with per-column-header checkboxes in
  Batch Queue pane (Checkpoint/Lora/Prompt/Workflow, radio behavior);
  Batch panel below Generate repurposed as status display + Pause/Stop
- Add _runBatchLoop() generic loop + _runBatchGenerate() 4-type dispatcher:
  Checkpoint (file-tree + group), Lora (group), Prompt (preset objects →
  positive/negative nodes), Workflow (group, restores original after batch)
- Remove ~86 lines of card-view CSS; keep nodes-tab card view intact
- Update help strings (EN/JA/ZH): helpWf1, helpModels2, helpGen11/13/14
- Update README features and Changelog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 16:22:29 +09:00
ketle-manandClaude Sonnet 4.6 eada3923c7 feat: CivitAI host setting, Info/Sample sub-tabs, URL fix, help i18n (v0.3.21)
- Settings tab: add civitai.com / civitai.red host selector; saved to
  settings.json and synced to localStorage for use across tabs
- CivitAI panel: split into Info / Sample sub-tabs; images moved to
  Sample tab with count in label; images open full-size in new tab
- URL fix: modelId=null entries now use /model-versions/{versionId}
  fallback (fixes all 324 existing cache entries client-side)
- Help: add helpGen12/13/14 (Batch tab panes) and helpSettings11/12/13
  (Text Size / RAW JSON Colors / CivitAI Host) with EN/JA/ZH; update
  helpGen3 (4-tab→5-tab) and helpGen11; fix JA/ZH English-mixed terms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 22:47:21 +09:00
ketle-manandClaude Sonnet 4.6 ef0fccbd36 feat: CivitAI panel — Type/Hash display, image new-tab, URL fix, 3-state UI (v0.3.20)
- Add Type badge, Base Model row, Hash row (BLAKE3/SHA256) to CivitAI side panel
- Extract fileHashes (BLAKE3, SHA256, AutoV2 etc.) in _extract_info
- Sample images wrapped in <a target="_blank"> to open full-size in new tab
- Fix broken model page URL caused by batch POST API omitting model.id;
  fall back to top-level modelId field in _extract_info; also reconstruct
  URL client-side from modelId+versionId for existing cached data
- Add 3-state CivitAI tab UI: unchecked / checked-not-found / found
- CivitAI tab click now calls renderSideCivitai to always show latest state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 20:35:45 +09:00
14 changed files with 1570 additions and 295 deletions
+15
View File
@@ -185,3 +185,18 @@ os.environ["HF_HOME"] = "D:\\hf_cache"
5. `INPUT_TYPES` 変更時は `widgets_values` も同時更新
6. 削除した依存への参照が残っていないか grep で確認
7. ComfyUI完全再起動 → ワークフロー読み込み → エンドツーエンド実行確認
---
## リリース手順
コミット・プッシュ・GitHub リリース(`gh release create`)を行う際は、**必ず以下の順序**で実施する。
1. `pyproject.toml` の `version` を新バージョン番号に更新してステージングに含める
2. `README.md` のバージョンバッジを更新(`![Version](https://img.shields.io/badge/version-X.Y.Z-green)`)
3. `README.md` の Changelog に新バージョンのエントリを追加
4. `DEVLOG.md` の先頭に変更詳細エントリを追加
5. 上記すべてを同一コミットにまとめてプッシュ
6. `gh release create vX.Y.Z` でリリースを作成
`pyproject.toml` のバージョン変更が GitHub Actions のトリガー(`paths: pyproject.toml`)になっており、ComfyUI Registry への自動公開もここで行われる。バージョン更新を忘れると Registry に反映されない。
+459
View File
@@ -1,5 +1,464 @@
# DEVLOG - ComfyUI-Workflow-Studio
## 2026-06-05: v0.3.22 — カードビュー廃止 + Batch タイプ切り替え UI + 4タイプバッチ生成
### 概要
WorkflowタブとModelsタブのカードビューを廃止(サムネイル/テーブルの2択に統一)。
生成UIタブのBatch機能を4タイプ(Checkpoint/Lora/Prompt/Workflow)のいずれかを有効化する
ラジオ選択型に拡張し、バッチ実行ループも全タイプ対応。
**カードビュー廃止(Workflow・Models タブ)**
- ビュー切り替えボタンから Card(&#9776;)を削除(Thumb・Table の2択)
- `viewMode` の初期値に `"card"` が保存されている場合は `"thumb"` にフォールバック
- Nodes タブのカードビューは変更なし
**Batch タイプ切り替え(BATCH QUEUE ヘッダー)**
- 各列ヘッダー右端にチェックボックスを追加(Checkpoint / Lora / Prompt / Workflow)
- ラジオ動作:1つを選択すると他3つは自動解除(`_activeBatchType` 変数で管理)
- バッチ有効時に Generate ボタンを押すと対応タイプのバッチ実行
**Batch ステータスパネル(旧 Checkpoint Batch)**
- "Checkpoint Batch" チェックボックス+ラベルを廃止
- 「Batch」+ アクティブタイプ名の常時表示に変更(実行中は青色ハイライト)
- 進捗バー・Pause ボタンはバッチ実行中のみ表示
**バッチ生成 4タイプ対応**
- 汎用ループ `_runBatchLoop(items, applyFn, labelFn)` を実装
- `_runBatchGenerate()` が `_activeBatchType` に応じてディスパッチ:
- Checkpoint: `checkpoint_nodes` の `ckpt_name` を差し替え
- Lora: `lora_nodes` の `lora_name` を差し替え
- Prompt: `prompt_nodes` の positive に `text`、negative に `negText` を適用(`textKey` 経由)
- Workflow: 各ファイルをロード → 生成 → 完了後に元ワークフローを復元
**バグ修正**
- Prompt バッチ: `_getSelectedPromptGroupItems()` がすでにプリセットオブジェクト配列を返すにもかかわらず、ID として再解決しようとして `list` が空になるバグを修正
### 変更内容
#### `templates/index.html`
- Workflow タブ・Models タブのビュー切り替えから Card ボタンを削除
- BATCH QUEUE 各列ヘッダー: テキストを `<span>` でラップ + `<input class="wfm-batch-type-cb" data-batch-type="...">` を追加
- Checkpoint Batch パネル: チェックボックス削除 → `wfm-batch-type-label` スパン(アクティブタイプ名表示)に置換。`wfm-ckpt-batch-body` の `display:none` 初期非表示を廃止
#### `static/js/workflow-tab.js`
- `viewMode` 初期値: `localStorage` の値が `"table"` 以外なら `"thumb"` にフォールバック
- `renderGrid()`: `thumb`/`card` の分岐を削除。常にサムネイルビューを描画
- `tags` 変数宣言を削除(カードビューでしか使用していなかったため)
#### `static/js/models-tab.js`
- `viewMode` 初期値: 同上フォールバック
- `renderModelGrid()`: `else if (viewMode === "card")` 分岐を削除。`thumb`/`table` の2択に
- `renderCardView()` 関数を削除(62行)
#### `static/js/generate-tab.js`
- `_activeBatchType` 変数追加(`null | "checkpoint" | "lora" | "prompt" | "workflow"`)
- `_updateBatchTypeLabel(running)`: バッチステータスパネルのタイプ名ラベルを更新
- `initCheckpointBatch()`: 旧チェックボックスハンドラを削除 → `.wfm-batch-type-cb` のラジオ動作ハンドラに置換
- `_runBatchLoop(items, applyFn, labelFn)`: 汎用バッチループ実装(進捗表示・一時停止・中断対応)
- `_runBatchGenerate()`: Checkpoint単体から4タイプディスパッチャに書き換え
- `handleGenerate()`: `wfm-ckpt-batch-enabled` チェック → `_activeBatchType !== null` に変更
#### `static/css/main.css`
- Workflow/Models カードビュー関連スタイルを削除(計約86行):
- `.wfm-view-card` 系全ルール / `.wfm-card-io` / `.wfm-model-card` / `.wfm-view-card .wfm-toggle-btn` 等
- `.wfm-batch-queue-col-header`: `display: flex; justify-content: space-between` 追加
- `.wfm-batch-type-cb`: チェックボックス用スタイル追加(12px、accent-color 指定)
---
## 2026-06-05: (未リリース) — 生成UIタブ Batch 4タイプ対応(Lora/Prompt/Workflow グループ選択 + BATCH QUEUE 4列化)
### 概要
生成UIタブの Batch ペインを Checkpoint 単体から Lora・Prompt・Workflow を含む4タイプ対応に拡張。
グループチェックペイン(中央ペイン)の Lora・Prompt・Workflow タブに実際のグループリストを実装し、
BATCH QUEUE(右ペイン)を4列横並びレイアウトに変更。
**グループチェックペイン(中央)**
- Lora タブ: `/api/wfm/models/groups?type=lora` からグループ取得。ファイル名(末尾)を表示
- Prompt タブ: `/api/wfm/prompts` でプリセット取得 + `localStorage[wfm_prompt_preset_groups]` でグループ取得。ID を `name` フィールドで解決して表示
- Workflow タブ: `localStorage[wfm_groups]` からグループ取得。`.json` 除去したファイル名を表示
- 各タブクリック時に対応するグループを再ロード。Batchサブタブ表示時は全タイプを一括ロード
**BATCH QUEUE(右ペイン)**
- Checkpoint / Lora / Prompt / Workflow の4列横並び表示
- 各列ヘッダー・件数・アイテムリストを独立表示
- 右ペイン幅を `flex: 1.2; min-width: 320px` に拡大
**バグ修正**
- ワークフロー カードビュー の B ボタンを左端から右下(★の下)に移動
- Prompt グループ選択ペインで UUID がそのまま表示されていた問題を修正(`title` → `name` フィールド)
### 変更内容
#### `templates/index.html`
- Lora/Prompt/Workflow タブ: "Coming soon" プレースホルダー → グループリストコンテナ(`wfm-batch-lora-group-list` / `wfm-batch-prompt-group-list` / `wfm-batch-wf-group-list`)に置換
- BATCH QUEUE 右ペイン: 単一リスト → `wfm-batch-queue-grid` 内に4列(各 `wfm-batch-queue-col`)
#### `static/js/generate-tab.js`
**`_batchGroupState` 拡張**
- Lora: `loraGroups` / `loraSelectedGroups` / `loraPartialSelections`
- Prompt: `promptGroups` / `promptPresets` / `promptSelectedGroups` / `promptPartialSelections`
- Workflow: `wfGroups` / `wfSelectedGroups` / `wfPartialSelections`
**新規汎用関数**
- `_getItemsFromGroupState(groupsData, selectedGroups, partialSelections)` — グループ状態からメンバーSet取得
- `_getGroupSelCountFrom(name, ...)` — 汎用選択数カウント
- `_renderAnyGroupList(listEl, groupsData, ...)` — Checkpoint と同じグループリストUIを任意タイプで再利用
**新規選択取得関数**
- `_getSelectedLoraGroupItems()` / `_getSelectedPromptGroupItems()` / `_getSelectedWfGroupItems()`
**新規ロード/レンダー関数**
- `_loadBatchLoraGroups()` / `_renderBatchLoraGroupList()`
- `_loadPromptGroupsForBatch()` / `_renderBatchPromptGroupList()`
- `_loadWorkflowGroupsForBatch()` / `_renderBatchWfGroupList()`
**`_renderBatchPreview()` リファクタリング**
- `_renderQueueColumn(countId, listId, items, displayFn, singular, plural)` を抽出
- 4タイプ(Checkpoint/Lora/Prompt/Workflow)を各列に独立レンダリング
**`initBatchTab()` 更新**
- 内部タブクリック時に対応する load 関数を呼び出し
- Batch サブタブ表示時に全タイプを一括ロード
**バグ修正**
- Prompt グループ表示: `presetsMap.get(id)?.title` → `presetsMap.get(id)?.name`(APIフィールド名修正)
#### `static/js/workflow-tab.js`
- カードビュー HTML: B ボタンと★ボタンを `wfm-card-actions` ラッパーで包み縦並び(★上・B下)に変更
#### `static/css/main.css`
- `.wfm-batch-right`: 固定210px → `flex: 1.2; min-width: 320px`
- `.wfm-batch-queue-grid` / `.wfm-batch-queue-col` / `.wfm-batch-queue-col-header`: 4列横並びレイアウト用スタイル追加
- `.wfm-view-card .wfm-card`: `align-items: stretch` に変更
- `.wfm-view-card .wfm-card-actions`: `flex-direction: column; justify-content: space-between` で縦並び配置
---
## 2026-06-05: (未リリース) — Prompt・Workflow Batchグループ登録UI
### 概要
Prompt タブと Workflow タブに Batch グループへの登録・解除 UI を追加。
モデルタブと同じ操作感で統一されており、B ボタンで登録/解除、B フィルターで絞り込み、BC ボタンで一括解除が可能。
**Prompt タブ**
- 各プリセットアイテムの★ボタン左隣に B ボタンを追加(黄色=登録済み)
- 検索ボックス右端に BC ボタンを追加(`wfm-pm-search` 行を flex 化)
**Workflow タブ**
- サムネイルビュー:`wfm-card-thumb` 左上に B ボタン(絶対配置)
- カードビュー:カード左下に B ボタン(絶対配置)
- テーブルビュー:右端に B 列追加
- フィルター行の★ボタン右隣に B フィルタリングボタンを追加
- View Settings ボタン右隣に BC ボタンを追加
### 変更内容
#### `static/js/prompt-tab.js`
**新規関数**
- `isInBatchPreset(id)` — `pmGroups["Batch"]` に id が含まれるか判定
- `toggleBatchPreset(id)` — バッチへの登録/解除トグル → `saveGroups()` で LocalStorage 保存
- `clearBatchPresets()` — `pmGroups["Batch"] = []` で一括解除
**`createPmItem()`**
- `inBatch` 変数を追加し `.pm-batch-btn` クラスに `batch-active` を付与
- ★ボタンの左に `<button class="wfm-pm-action-btn pm-batch-btn">B</button>` を追加
- `.pm-batch-btn` クリックで `toggleBatchPreset()` を呼び出し
**`initPromptTab()`**
- `wfm-pm-batch-clear-btn` クリック → `clearBatchPresets()` 呼び出し
#### `static/js/workflow-tab.js`
**新規 state フィールド**
- `state.showBatchOnly: false`
**新規関数**
- `isInBatch(filename)` / `toggleBatch(filename)` / `clearBatch()` — groups.data["Batch"] を操作
**`filterWorkflows()`**
- `state.showBatchOnly` が true のとき Batch グループメンバーのみに絞り込む処理を追加
**`renderModelFilters()`**
- ★フィルターボタンの右に B フィルタリングボタン(`.wfm-wf-batch-filter-btn`)を追加
- クリックで `state.showBatchOnly` トグル
**`renderGrid()` — thumbビュー**
- `wfm-card-thumb` 内に `<button class="wfm-batch-btn">B</button>` を追加(左上絶対配置)
**`renderGrid()` — cardビュー**
- favBtnの前に `<button class="wfm-batch-btn">B</button>` を追加(左下絶対配置)
**`renderTableView()`**
- thead 右端に空の th を追加(width:30px)
- 各行右端に `<td class="wfm-table-td-batch">B ボタン</td>` を追加
**`initWorkflowTab()`**
- `wfm-wf-batch-clear-btn` クリック → `clearBatch()` 呼び出し
#### `templates/index.html`
- Prompt タブ: `wfm-pm-search` 内にBC ボタン(`wfm-pm-batch-clear-btn`)を追加、入力ボックスに `flex:1` 追加
- Workflow タブ: View Settings ボタン(`wfm-badge-settings-btn`)の右に BC ボタン(`wfm-wf-batch-clear-btn`)を追加
#### `static/css/main.css`
- `.wfm-pm-search { display: flex; gap: 4px; align-items: center; }` — BC ボタン配置用
- `.wfm-pm-action-btn.batch-active { color: #f0c040; }` — Prompt タブ Bボタン active 時
- `.wfm-card-thumb { position: relative; }` — ワークフローthumbビューの Bボタン絶対配置基準
- `#wfm-workflow-grid.wfm-view-card .wfm-batch-btn { position: absolute; bottom: 6px; left: 6px; }` — ワークフローcardビュー専用(モデルタブと区別)
#### `static/js/i18n.js`
- `promptBatchClear` / `wfBatchClear` を英語・日本語・中国語で追加
---
## 2026-06-04: (未リリース) — モデルBatchグループ登録UI(サムネイル/カード/テーブル・フィルター・一括解除)
### 概要
Models タブ(Checkpoint / Lora)の Batch グループへの登録・解除 UI を全ビューに追加。
お気に入り(★)と同じ操作感で、1クリックで登録/解除できる「B」ボタンをサムネイル・カード・テーブルの各ビューに配置。
フィルターボタン(B)でバッチ登録済みモデルのみ絞り込み表示、BC ボタンで一括解除が可能。
### 変更内容
#### `templates/index.html`
- ★フィルターボタンの右隣に **B** フィルターボタン(`wfm-models-batch-filter-btn`)を追加
- Select ボタンの右隣に **BC** ボタン(`wfm-models-batch-clear-btn`)を追加
#### `static/css/main.css`
- `.wfm-batch-btn` スタイルを追加
- 通常時: グレー (`var(--wfm-text-secondary)`)・opacity 0.5
- `.active` 時: 黄色 (`#f0c040`)・opacity 1
- サムネイルビュー: `position: absolute; top: 6px; left: 6px;`(プレビュー左上)
- カードビュー: `position: static; flex-shrink: 0;`(★ボタンの左隣)
- テーブルビュー: `position: static`
- `.wfm-table-td-batch` セル幅スタイルを追加
#### `static/js/models-tab.js`
**新規 state フィールド**
- `state.showBatchOnly: false` — Bフィルターの有効状態
**新規ヘルパー関数**
- `isInBatch(modelName)` — `state.modelGroups["Batch"]` に含まれるか判定
- `toggleBatch(modelName)` — バッチへの登録/解除トグル → `saveModelGroups()` でサーバー保存
- `clearBatchGroup()` — `state.modelGroups["Batch"] = []` で一括解除、Bフィルターも解除
**フィルター処理**
- `state.showBatchOnly` が true のとき `modelGroups["Batch"]` メンバーのみに絞り込む処理を追加(`showFavoritesOnly` の直後)
**renderThumbView**
- `batchClass` 変数を追加(active で黄色クラス付与)
- プレビュー画像エリア左上に `<button class="wfm-batch-btn">B</button>` を追加
- `.wfm-batch-btn` クリックで `toggleBatch()` を呼び出し
- selectMode のクリックガードに `.wfm-batch-btn` を追加
**renderCardView**
- 同様に `batchClass` を追加し ★ボタンの左に `<button class="wfm-batch-btn">B</button>` を追加
- イベントハンドラ・selectMode ガードを同様に追加
**renderTableView**
- 各行に `<td class="wfm-table-td-batch">B ボタン</td>` を右端に追加
- thead に `<th style="width:30px;">B</th>` を追加
- `.wfm-batch-btn` クリックイベントを各行にバインド
- selectMode のクリックガードに `.wfm-batch-btn` を追加
**イベントハンドラ**
- `wfm-models-batch-filter-btn` クリック → `state.showBatchOnly` トグル・`renderModelGrid()` 呼び出し
- `wfm-models-batch-clear-btn` クリック → `clearBatchGroup()` 呼び出し
#### `static/js/i18n.js`
- `modelsBatch` / `modelsBatchClear` を英語・日本語・中国語で追加
---
## 2026-06-04: (未リリース) — Batch予約グループ・Presets Save後リセット・グループフィルター種別絞り込み
### 概要
Workflow / Prompt / Models(Checkpoint・Lora)に「Batch」予約グループを追加。
予約グループはシステム側で自動作成され、ユーザーによる削除・リネームをブロックする。
合わせて Prompt タブの Presets で Save 後に選択が `--New Preset--` へリセットされるよう修正し、
Models タブのグループフィルタードロップダウンが現在選択中のモデル種別のグループのみ表示するよう改善。
### 変更内容
#### `static/js/models-tab.js`
**Batch 予約グループの自動作成(Checkpoint / Lora)**
- `RESERVED_GROUPS = ["Batch"]` / `BATCH_MODEL_TYPES = ["checkpoint", "lora"]` 定数を追加
- `loadModelsForCurrentType()` のキャッシュヒット時・フル読み込み時の両パスで、対象タイプに "Batch" グループが存在しなければ API 経由で自動作成
**削除・リネームのブロック**
- グループ削除ボタン・リネームボタンのイベントハンドラで `RESERVED_GROUPS` チェックを追加
- 予約グループを操作しようとした場合 `modelsGroupReserved` トーストを表示して処理を中断
**グループフィルター種別絞り込み**
- `renderGroupFilter()` を改修: 全タイプ横断表示から `state.activeModelType` のグループのみ表示するよう変更
- `[タイプラベル] グループ名` 形式を廃止し、グループ名のみを表示
#### `static/js/prompt-tab.js`
**Batch 予約グループの自動確保**
- `PROMPT_RESERVED_GROUPS = ["Batch"]` 定数を追加
- `loadAllPresets()` のクリーニング処理で予約グループを空でも削除しないよう修正
- クリーニング後に予約グループが存在しなければ `pmGroups["Batch"] = []` で確保し `saveGroups()` へ反映
**削除ブロック**
- グループ削除ボタンのイベントハンドラで `PROMPT_RESERVED_GROUPS` チェックを追加
**Save 後の Preset 選択リセット**
- Preset 保存(新規作成・更新どちらも)成功後に `pmSelectedId = null` / `presetSelect.value = ""` で `--New Preset--` へ戻す
- 旧: 新規作成後は保存した Preset が選択されたまま → 誤って上書きするリスクがあった
#### `static/js/workflow-tab.js`
**Batch 予約グループの自動作成**
- `WF_RESERVED_GROUPS = ["Batch"]` 定数を追加
- `groups.load()` に予約グループ確保ロジックを追加(存在しなければ LocalStorage へ即時保存)
**削除・リネームのブロック**
- `groups.deleteGroup()` / `groups.renameGroup()` に `WF_RESERVED_GROUPS` チェックを追加(`false` 返却で中断)
- 削除・リネームボタンのイベントハンドラにもフロントエンド側チェックを追加してトースト表示
#### `static/js/i18n.js`
- `modelsGroupReserved` を英語・日本語・中国語で追加(「予約済みグループは削除・リネーム不可」のメッセージ)
---
## 2026-05-31: v0.3.21 — CivitAI ホスト設定・Sample サブタブ・URL 修正・ヘルプ i18n 整備
### 概要
CivitAI 連携に 3 つの改善を追加。モデルリンクを開くサイトを civitai.com / civitai.red から選択できる
ホスト設定を Settings タブに追加。CivitAI パネルを Info / Sample のサブタブに分割し、
サンプル画像を専用タブに移動。`modelId` が null のキャッシュエントリの URL を
`/model-versions/{versionId}` にフォールバックさせ、全 324 件の既存キャッシュも即時修正。
ヘルプを Batch tab / Text Size / RAW JSON などの新項目を含めて更新し、JA/ZH 翻訳の英語混じりも解消。
### 変更内容
#### `py/services/civitai_service.py`
**`_extract_info()` — `modelUrl` フォールバックを修正**
- 旧: `modelId` が null のとき `https://civitai.com/models?modelVersionId={id}`(モデル一覧ページに飛ぶ壊れた URL)
- 新: `https://civitai.com/model-versions/{versionId}` にフォールバック(モデルページへリダイレクト)
#### `static/js/models-tab.js`
**`renderCivitaiInfo()` — Info / Sample サブタブを追加**
- CivitAI パネルを「情報」「サンプル (N)」の 2 サブタブに分割
- Info タブ: モデル名リンク・Type/Base Model/Hash 詳細行・タグ・トリガーワード・説明・更新ボタン
- Sample タブ: 全サンプル画像(件数をタブ名に表示)。画像は別タブで開く
**`renderCivitaiInfo()` — URL 修正(クライアントサイド)**
- `info.modelId` がある場合: `https://{host}/models/{modelId}?modelVersionId={versionId}`
- `info.modelId` が null: `https://{host}/model-versions/{versionId}` にフォールバック
- `{host}` は `localStorage.getItem("wfm_civitai_host")` から取得(デフォルト `civitai.com`)
#### `static/js/settings-tab.js`
**CivitAI セクションにホスト選択を追加**
- CivitAI API Key アコーディオンの先頭に `wfm-select` ドロップダウンを追加
- 選択肢: `civitai.com(SFW のみ)` / `civitai.red(制限なし)`
- 変更で即座に `POST /api/wfm/settings` へ保存 + `localStorage.setItem("wfm_civitai_host", host)` を実行
- 設定タブ読み込み時に `civitai_host` を localStorage へ同期(他タブが追加 fetch 不要で参照できる)
#### `static/js/i18n.js`
**新規文字列(EN / JA / ZH)**
- `civitaiTabInfo` / `civitaiTabSample` / `civitaiNoImages`: サブタブ名・空メッセージ
- `civitaiHostSetting` / `civitaiHostHint` / `civitaiHostCom` / `civitaiHostRed` / `civitaiHostSaved`: ホスト設定
- `helpGen12` / `helpGen13` / `helpGen14`: Batch タブの 3 ペイン詳細
- `helpSettings11` / `helpSettings12` / `helpSettings13`: Text Size・RAW JSON Colors・CivitAI ホスト
**既存文字列を更新(JA / ZH)**
- `helpGen3`: 「4タブ → 5タブ(Batch 追加)」
- `helpGen11`: Batch トグルの説明に更新、Filter/Pause/Resume/Stop の英語混じりを解消
#### `static/js/app.js`
- `wfm-help-gen-12/13/14` → `helpGen12/13/14` のマッピングを追加
- `wfm-help-settings-11/12/13` → `helpSettings11/12/13` のマッピングを追加
#### `templates/index.html`
- `wfm-help-settings-13`(CivitAI ホスト)を Settings カードに追加
---
## 2026-05-31: v0.3.20 — CivitAI 詳細パネル強化(Type / Hash 表示・URL 修正・画像別タブ)
### 概要
Models タブのサイドパネル CivitAI タブを強化。Type・Base Model・Hash(BLAKE3/SHA256)の詳細行を追加し、
サンプル画像をクリックで別タブ表示できるようにした。バッチ POST API の `model.id` 欠落による
モデルページ URL の壊れを修正。CivitAI タブの 3 状態 UI と再描画タイミングも改善。
### 変更内容
#### `py/services/civitai_service.py`
**`_extract_info()` — `fileHashes` フィールドを追加**
- プライマリファイルの `hashes` オブジェクト(BLAKE3 / SHA256 / AutoV2 等)を `fileHashes` として保存
- 新規取得・更新後はサイドパネルで各ハッシュ値を表示できる
**`_extract_info()` — `modelId` フォールバックを追加**
- バッチ POST API(`POST /model-versions/by-hash`)はレスポンスの `model` オブジェクト内に `id` を含まない場合がある
- `model.get("id") or data.get("modelId")` でトップレベルの `modelId` をフォールバックとして使用
- これにより `modelUrl` が `https://civitai.com/models?modelVersionId=XXXX`(モデル一覧ページ)になる問題を修正
#### `static/js/models-tab.js`
**`renderCivitaiInfo()` — 詳細行を追加**
| 追加要素 | 内容 |
|---|---|
| Type | `info.type` を大文字バッジで表示("CHECKPOINT"、"LORA" 等)|
| Base Model | `info.baseModel` をラベル付き行で表示(旧サブタイトルから分離)|
| Hash | BLAKE3 優先・SHA256 フォールバック。先頭 16 文字を表示、クリックでフルハッシュをクリップボードコピー |
- ローカルメタデータの `sha256`(既存キャッシュでも利用可能)を SHA256 として自動補完
- 既存キャッシュで `modelUrl` が壊れている場合も `info.modelId` + `info.versionId` から URL を再構築(更新不要)
- サンプル画像を `<a target="_blank">` でラップ → クリックで原寸画像を別タブに表示
- モデル名サブタイトル行から `baseModel` を除去(Detail 行に移動)
**`renderSideCivitai()` — 3 状態 UI に変更**
- `sha256` なし → 「CivitAIから取得」ボタン(未確認)
- `sha256` あり・キャッシュなし → 「確認済みですが、CivitAIに見つかりませんでした。」+「再確認する」ボタン
- キャッシュあり → CivitAI 情報を表示
**CivitAI タブ切り替え時の再描画**
- サイドパネルのタブ切り替えハンドラで CivitAI タブをクリックした際に `renderSideCivitai` を呼び出すよう追加
- バッチ取得後に状態が更新されていても、タブをクリックすれば必ず最新内容が表示される
#### `static/js/i18n.js`
新規文字列を追加(EN / JA / ZH):
`civitaiType` / `civitaiBaseModel` / `civitaiHashLabel` / `civitaiCopyHash` / `civitaiHashCopied` / `civitaiOpenImage`
---
## 2026-05-31: v0.3.19 — CivitAI 連携強化(バッチ高速化・リトライ・APIキー・フィールド拡充)
### 概要
+31 -8
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.19-green)
![Version](https://img.shields.io/badge/version-0.3.22-green)
## Screenshots
@@ -30,7 +30,7 @@ Browse, organize, and execute workflows directly from a dedicated studio interfa
## Features
### Workflow Tab
- **Thumbnail / Card / Table views** — switch between view modes to browse your workflow library
- **Thumbnail / Table views** — switch between view modes to browse your workflow library
- **Thumbnail side panel** — preview workflow canvas snapshots in the side panel
- **Badge filtering** — filter by user-defined badges (free labels you assign to each workflow)
- **Search** — full-text search across workflow names and metadata
@@ -38,7 +38,7 @@ Browse, organize, and execute workflows directly from a dedicated studio interfa
- **Badge management** — add, rename, delete badges with custom colors shared with the Models tab (⚙ Badge button)
- **AI summary** — generate workflow descriptions using Ollama
- **Import / Export** — import workflows from files or clipboard, open in ComfyUI directly
- **Default view setting** — persist your preferred view mode (Thumbnail / Card / Table)
- **Default view setting** — persist your preferred view mode (Thumbnail / Table)
### Canvas Snapshot (v0.1.2)
- **One-click capture** — click the camera button in ComfyUI's top bar to snapshot the current workflow canvas
@@ -54,11 +54,11 @@ Browse, organize, and execute workflows directly from a dedicated studio interfa
- **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 activate sequential batch generation; Pause/Resume suspends processing between models; Stop aborts after the current generation; amber progress bar tracks per-model progress
- **Batch type selector** — check one of the column header checkboxes in the Batch Queue pane (Checkpoint / Lora / Prompt / Workflow) to activate that batch type; only one type can be active at a time; the Batch panel below Generate shows the active type, progress, and Pause/Resume/Stop controls
- **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
- **Center pane** — group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint/Lora groups come from the Models tab, Prompt groups from the Prompt tab, Workflow groups from the Workflow tab — check a group to add all its members, expand ▶ to select individually
- **Right pane (Batch Queue)** — shows items queued for each batch type; column headers (Checkpoint / Lora / Prompt / Workflow) each have a checkbox — check one to activate that batch type (radio behavior: only one at a time); 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
@@ -107,6 +107,7 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
- **Gallery output directory** — configure which output folder the Gallery tab scans for images
- **Eagle connection** — set Eagle API endpoint for auto-save
- **Ollama connection** — configure Ollama server URL
- **CivitAI Host** — choose which site opens when clicking a model link: `civitai.com` (SFW only) or `civitai.red` (unrestricted); saved to `settings.json` and synced to `localStorage` for the Models tab to use without extra fetches
- **CivitAI API Key** — optional Bearer token for authenticated CivitAI access; stored in `settings.json` (excluded from data exports); environment variable `CIVITAI_API_KEY` takes priority if set
- **Default workflow** — set a workflow to auto-load on startup
- **Data Management** — export all plugin data (settings, metadata, prompts, etc.) to a single JSON file; import to restore data (useful when migrating or reinstalling); API keys are excluded from exports for security
@@ -140,11 +141,13 @@ 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 / Card / Table views** — switch between view modes with pagination (24 items per page)
- **Thumbnail / Table views** — switch between view modes with pagination (24 items per page)
- **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** — Info (file path display with click-to-copy, tags, memo), Groups management, CivitAI integration
- **CivitAI integration** — fetch model metadata by SHA256 hash; displays base model, trained words, tags, NSFW level, download/like stats, AIR identifier, and model page link; preview image is automatically downloaded and saved if none exists
- **CivitAI integration** — fetch model metadata by SHA256 hash; side panel shows **Type** (badge), **Base Model**, **Hash** (BLAKE3/SHA256, click to copy), trained words, tags, and model page link; model link opens in the site selected in Settings (civitai.com or civitai.red)
- **CivitAI panel — Info / Sample sub-tabs** — Info tab shows model details (name, type, base model, hash, trigger words, tags, description); Sample tab shows all sample images (count shown in tab label); clicking any image opens the full-size version in a new tab
- **CivitAI panel states** — three distinct states: not yet checked (fetch button), checked but not found on CivitAI (re-check button with notice), and found (full info display); clicking the CivitAI tab always refreshes to the latest state
- **Batch CivitAI fetch** — one-click batch fetch using `POST /model-versions/by-hash` (up to 100 models per request) with SSE progress streaming; previews are auto-saved for models without one
- **Detail modal** — preview image, CivitAI info, thumbnail change via file upload
- **GenUI Model button** — apply the selected model directly to the corresponding node in GenerateUI's current workflow (Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder)
@@ -276,6 +279,26 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
## Changelog
### v0.3.22
- **Card view removed** — Workflow tab and Models tab no longer offer Card view; Thumbnail and Table remain; if `"card"` was previously stored in localStorage it falls back to Thumbnail automatically
- **Batch type selector** — replaced the Checkpoint Batch toggle with per-type checkboxes on the Batch Queue column headers (Checkpoint / Lora / Prompt / Workflow); radio behavior ensures only one type is active at a time; the Batch panel below Generate repurposed as a status display showing the active type, amber progress bar, and Pause/Resume / Stop controls
- **4-type batch generation** — `_runBatchGenerate()` dispatches to Checkpoint (file-tree + group selection), Lora (group selection), Prompt (preset group items applied to positive/negative nodes), and Workflow (group selection, restores original workflow after batch); all types use the same generic `_runBatchLoop()` with pause/abort support
- **Help updated** — EN / JA / ZH strings updated for `helpWf1`, `helpModels2`, `helpGen11`, `helpGen13`, `helpGen14`
### v0.3.21
- **CivitAI Host setting** — new dropdown in Settings tab (CivitAI section): choose `civitai.com` (SFW only) or `civitai.red` (unrestricted); selection is saved to `settings.json` and synced to `localStorage` so the Models tab uses it immediately without extra server calls
- **CivitAI panel — Info / Sample sub-tabs** — the CivitAI side panel is split into two sub-tabs; Info tab contains model details and actions; Sample tab shows all sample images (count displayed in label); images open full-size in a new browser tab on click
- **Bug fix: model page URL for existing cache** — `modelId: null` entries (the majority of the cache) previously generated broken links (`/models?modelVersionId=…`); both the Python service and the JS renderer now fall back to `/{host}/model-versions/{versionId}` which redirects correctly to the model page; all 324 existing cache entries are fixed immediately without re-fetching
- **Help updated** — Batch tab entries (gen-12 / gen-13 / gen-14) and Settings entries (settings-11 Text Size / settings-12 RAW JSON Colors / settings-13 CivitAI Host) are now fully localized in EN / JA / ZH; `helpGen3` updated to reflect 5-tab layout; `helpGen11` rewritten to describe the Batch toggle; JA/ZH translations no longer contain untranslated English terms (Filter, Pause/Resume, Stop)
### v0.3.20
- **CivitAI panel — Type / Base Model / Hash display** — side panel CivitAI tab now shows a Type badge (e.g. CHECKPOINT, LORA), Base Model row, and Hash row (BLAKE3 preferred, SHA256 fallback from CivitAI API or local metadata); click the hash to copy the full value to clipboard
- **CivitAI panel — images open in new tab** — sample images in the CivitAI tab are now wrapped in links; clicking an image opens the full-size version in a new browser tab
- **CivitAI panel — 3-state UI** — the panel now distinguishes between "not yet checked" (blue fetch button), "checked but not found on CivitAI" (re-check button with a notice), and "found" (full info); no more ambiguity after running batch fetch
- **CivitAI tab click refresh** — clicking the CivitAI tab in the side panel now re-renders its content, ensuring the latest fetch state is always shown without needing to reselect the model
- **Bug fix: model page URL broken after batch fetch** — the batch `POST /model-versions/by-hash` endpoint can omit `model.id` inside the version object; `_extract_info` now falls back to the top-level `modelId` field so the model page link is always correct; existing cached entries with a broken URL are also fixed client-side from `modelId` + `versionId`
- **CivitAI cache — `fileHashes` field added** — `_extract_info` now stores the primary file's full hash map (BLAKE3, SHA256, AutoV2, etc.) so the Hash row is populated for newly fetched or refreshed models
### v0.3.19
- **CivitAI batch fetch — major speedup** — switched from one-by-one `GET` requests (0.5 s delay each) to `POST /model-versions/by-hash` batch endpoint; up to 100 hashes per request, reducing 100-model fetch from ~50 s to a few seconds
- **Retry with exponential backoff** — `fetch_by_hash` and the new batch POST both retry on HTTP 429 / 500 / 502 / 503 / 504 with 1 s → 2 s → 4 s delays (max 3 attempts), as recommended in the CivitAI API docs
+16 -4
View File
@@ -281,6 +281,7 @@ class CivitaiService:
# プライマリファイルのメタ情報(精度・フォーマット)
file_meta = {}
file_hashes = {}
if primary_file:
pm = primary_file.get("metadata", {})
file_meta = {
@@ -288,12 +289,19 @@ class CivitaiService:
"size": pm.get("size"),
"format": pm.get("format"),
}
# BLAKE3, SHA256, AutoV2 等のハッシュ
file_hashes = primary_file.get("hashes", {})
stats = data.get("stats", {})
# バッチ POST API は model オブジェクト内に id を含まない場合がある
# トップレベルの modelId をフォールバックとして使用する
model_id = model.get("id") or data.get("modelId")
version_id = data.get("id", "")
return {
"versionId": data.get("id"),
"modelId": model.get("id"),
"versionId": version_id,
"modelId": model_id,
"modelName": model.get("name", ""),
"versionName": data.get("name", ""),
"type": model.get("type", ""),
@@ -310,10 +318,14 @@ class CivitaiService:
"baseModel": data.get("baseModel", ""),
"fileSize": primary_file.get("sizeKB", 0) if primary_file else 0,
"fileMeta": file_meta,
"fileHashes": file_hashes,
"downloadUrl": data.get("downloadUrl", ""),
"modelUrl": (
f"https://civitai.com/models/{model.get('id', '')}"
f"?modelVersionId={data.get('id', '')}"
f"https://civitai.com/models/{model_id}?modelVersionId={version_id}"
if model_id else (
f"https://civitai.com/model-versions/{version_id}"
if version_id else ""
)
),
"stats": {
"downloadCount": stats.get("downloadCount", 0),
+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.19"
version = "0.3.22"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+79 -62
View File
@@ -290,6 +290,7 @@ body {
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
}
.wfm-card-thumb img {
@@ -1045,58 +1046,42 @@ body {
}
/* ============================================
Card View Mode (no thumbnail, compact)
Batch Button
============================================ */
.wfm-view-card {
grid-template-columns: repeat(auto-fill, 220px) !important;
grid-auto-rows: max-content !important;
gap: 8px !important;
justify-items: stretch !important;
align-items: start !important;
}
.wfm-view-card .wfm-card {
display: flex;
flex-direction: row;
align-items: center;
width: 220px !important;
min-width: 220px !important;
min-height: 56px;
}
.wfm-view-card .wfm-card-body {
flex: 1;
min-width: 0;
padding: 8px 10px;
}
.wfm-view-card .wfm-fav-btn {
flex-shrink: 0;
margin-right: 6px;
}
.wfm-view-card .wfm-card-title {
margin-bottom: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 12px;
}
.wfm-card-io {
font-size: 11px;
.wfm-batch-btn {
position: absolute;
top: 6px;
left: 6px;
background: none;
border: none;
color: var(--wfm-text-secondary);
margin-top: 4px;
font-size: 11px;
font-weight: bold;
cursor: pointer;
line-height: 1;
opacity: 0.5;
transition: opacity 0.15s, color 0.15s;
padding: 0 2px;
}
.wfm-card-tags {
display: flex;
gap: 4px;
flex-wrap: wrap;
margin-top: 4px;
.wfm-batch-btn:hover {
opacity: 1;
}
.wfm-batch-btn.active {
color: #f0c040;
opacity: 1;
}
.wfm-table-row .wfm-batch-btn,
.wfm-models-table-row .wfm-batch-btn {
position: static;
opacity: 0.7;
}
.wfm-tag {
font-size: 10px;
color: var(--wfm-primary);
@@ -1798,6 +1783,9 @@ body {
.wfm-pm-search {
padding: 8px;
flex-shrink: 0;
display: flex;
gap: 4px;
align-items: center;
}
.wfm-pm-list {
flex: 1;
@@ -1866,6 +1854,10 @@ body {
.wfm-pm-action-btn.fav-active {
color: #ffd700;
}
.wfm-pm-action-btn.batch-active {
color: #f0c040;
opacity: 1;
}
.wfm-pm-empty {
padding: 24px 16px;
text-align: center;
@@ -3634,14 +3626,6 @@ body {
border-color: var(--wfm-accent);
}
/* Model card (card view, no thumbnail) */
.wfm-model-card {
position: relative;
}
.wfm-model-card .wfm-card-body {
position: relative;
}
/* Badge: subdirectory (italic, muted) */
.wfm-badge-dir {
@@ -3822,12 +3806,6 @@ body {
opacity: 0.7;
}
/* Card view: fav and toggle are flex siblings */
.wfm-view-card .wfm-toggle-btn {
position: static;
flex-shrink: 0;
margin-right: 4px;
}
/* Table view toggle cell */
.wfm-table-td-toggle {
@@ -3840,6 +3818,11 @@ body {
opacity: 0.5;
}
.wfm-table-td-batch {
text-align: center;
width: 30px;
}
/* Disabled badge in card title */
.wfm-badge-disabled {
background: rgba(255, 107, 107, 0.2);
@@ -3877,7 +3860,6 @@ body {
content: "✓";
}
.wfm-view-thumb .wfm-model-card.wfm-card-checked,
.wfm-view-card .wfm-model-card.wfm-card-checked {
outline: 2px solid #6c8ef5;
outline-offset: -2px;
}
@@ -3927,7 +3909,7 @@ body {
.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-right { flex: 1.2; min-width: 320px; flex-shrink: 0; }
.wfm-batch-pane-header {
font-size: 11px;
font-weight: 600;
@@ -4002,9 +3984,44 @@ body {
border-bottom: 1px solid var(--wfm-border);
flex-shrink: 0;
}
.wfm-batch-queue-grid {
display: flex;
flex: 1;
overflow: hidden;
gap: 0;
}
.wfm-batch-queue-col {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
border-right: 1px solid var(--wfm-border);
min-width: 0;
}
.wfm-batch-queue-col:last-child { border-right: none; }
.wfm-batch-queue-col-header {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 10px;
font-weight: 600;
color: var(--wfm-text-secondary);
text-transform: uppercase;
letter-spacing: 0.04em;
padding: 4px 6px 4px 8px;
border-bottom: 1px solid var(--wfm-border);
flex-shrink: 0;
}
.wfm-batch-type-cb {
width: 12px;
height: 12px;
cursor: pointer;
flex-shrink: 0;
accent-color: var(--wfm-primary);
}
.wfm-batch-preview-list { flex: 1; overflow-y: auto; padding: 2px 0; }
.wfm-batch-preview-item {
padding: 3px 10px;
padding: 3px 8px;
font-size: 11px;
color: var(--wfm-text-primary);
overflow: hidden;
+4 -1
View File
@@ -326,7 +326,8 @@ function applyI18nToHtml() {
"wfm-help-gen-3": "helpGen3", "wfm-help-gen-4": "helpGen4",
"wfm-help-gen-5": "helpGen5", "wfm-help-gen-6": "helpGen6", "wfm-help-gen-7": "helpGen7",
"wfm-help-gen-8": "helpGen8", "wfm-help-gen-9": "helpGen9", "wfm-help-gen-10": "helpGen10",
"wfm-help-gen-11": "helpGen11",
"wfm-help-gen-11": "helpGen11", "wfm-help-gen-12": "helpGen12",
"wfm-help-gen-13": "helpGen13", "wfm-help-gen-14": "helpGen14",
"wfm-help-feeder-title": "helpFeederTitle",
"wfm-help-feeder-desc": "helpFeederDesc",
"wfm-help-feeder-1": "helpFeeder1", "wfm-help-feeder-2": "helpFeeder2",
@@ -344,6 +345,8 @@ function applyI18nToHtml() {
"wfm-help-settings-5": "helpSettings5", "wfm-help-settings-6": "helpSettings6",
"wfm-help-settings-7": "helpSettings7", "wfm-help-settings-8": "helpSettings8",
"wfm-help-settings-9": "helpSettings9", "wfm-help-settings-10": "helpSettings10",
"wfm-help-settings-11": "helpSettings11", "wfm-help-settings-12": "helpSettings12",
"wfm-help-settings-13": "helpSettings13",
"wfm-help-nodes-1": "helpNodes1", "wfm-help-nodes-2": "helpNodes2",
"wfm-help-nodes-3": "helpNodes3", "wfm-help-nodes-4": "helpNodes4",
"wfm-help-nodes-5": "helpNodes5", "wfm-help-nodes-6": "helpNodes6",
+450 -75
View File
@@ -153,10 +153,11 @@ export async function loadWorkflowIntoEditor(workflow, filename) {
}
// ============================================
// Checkpoint Batch
// Batch (multi-type: Checkpoint / Lora / Prompt / Workflow)
// ============================================
const _ckptBatch = { aborted: false, paused: false, _resumeResolve: null };
let _activeBatchType = null; // "checkpoint" | "lora" | "prompt" | "workflow" | null
async function _waitIfPaused() {
if (!_ckptBatch.paused) return;
@@ -171,42 +172,93 @@ function _setPauseBtnState(paused) {
btn.style.color = paused ? "#fff" : "";
}
function _updateBatchTypeLabel(running = false) {
const el = document.getElementById("wfm-batch-type-label");
if (!el) return;
const labels = { checkpoint: "Checkpoint", lora: "Lora", prompt: "Prompt", workflow: "Workflow" };
if (_activeBatchType) {
el.textContent = labels[_activeBatchType];
el.style.color = running ? "var(--wfm-primary)" : "";
} else {
el.textContent = "—";
el.style.color = "";
}
}
// mode: "all" = 全選択, "some" = 一部選択, "none" = 全解除
const _ckptState = { mode: "none", selected: new Set() };
// グループ選択状態(中央ペイン)
// selectedGroups : グループ全体が選択済み(グループ名のSet)
// partialSelections: 部分選択 { groupName: Set<modelName> }
// → モデル一覧は常に _batchGroupState.groups から解決するため
// グループのメンバーが変わっても自動的に最新状態を反映できる
// partialSelections: 部分選択 { groupName: Set<memberValue> }
const _batchGroupState = {
// Checkpoint
groups: {},
selectedGroups: new Set(),
partialSelections: {},
// Lora
loraGroups: {},
loraSelectedGroups: new Set(),
loraPartialSelections: {},
// Prompt (グループ値はpresetId、表示はtitleで解決)
promptGroups: {},
promptPresets: [],
promptSelectedGroups: new Set(),
promptPartialSelections: {},
// Workflow
wfGroups: {},
wfSelectedGroups: new Set(),
wfPartialSelections: {},
};
// 中央ペインの選択から現在のグループメンバーを解決して返す
function _getSelectedGroupModels() {
// 汎用: groupsData/selectedGroups/partialSelectionsからメンバーSetを返す
function _getItemsFromGroupState(groupsData, selectedGroups, partialSelections) {
const result = new Set();
for (const [name, members] of Object.entries(_batchGroupState.groups)) {
if (_batchGroupState.selectedGroups.has(name)) {
for (const [name, members] of Object.entries(groupsData)) {
if (selectedGroups.has(name)) {
members.forEach((m) => result.add(m));
} else {
const partial = _batchGroupState.partialSelections[name];
const partial = 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];
// 中央ペインCheckpointグループの選択モデルSet
function _getSelectedGroupModels() {
return _getItemsFromGroupState(_batchGroupState.groups, _batchGroupState.selectedGroups, _batchGroupState.partialSelections);
}
// Loraグループの選択アイテムSet
function _getSelectedLoraGroupItems() {
return _getItemsFromGroupState(_batchGroupState.loraGroups, _batchGroupState.loraSelectedGroups, _batchGroupState.loraPartialSelections);
}
// Promptグループの選択プリセット配列 (idではなくpresetオブジェクト)
function _getSelectedPromptGroupItems() {
const ids = _getItemsFromGroupState(_batchGroupState.promptGroups, _batchGroupState.promptSelectedGroups, _batchGroupState.promptPartialSelections);
return [...ids].map((id) => _batchGroupState.promptPresets.find((p) => p.id === id)).filter(Boolean);
}
// Workflowグループの選択ファイル名Set
function _getSelectedWfGroupItems() {
return _getItemsFromGroupState(_batchGroupState.wfGroups, _batchGroupState.wfSelectedGroups, _batchGroupState.wfPartialSelections);
}
// グループの選択済みメンバー数(汎用)
function _getGroupSelCountFrom(name, groupsData, selectedGroups, partialSelections) {
const members = groupsData[name] || [];
if (selectedGroups.has(name)) return members.length;
const partial = partialSelections[name];
return partial ? members.filter((m) => partial.has(m)).length : 0;
}
// グループの選択済みモデル数を返す(Checkpoint用 UIカウント表示)
function _getGroupSelCount(name) {
return _getGroupSelCountFrom(name, _batchGroupState.groups, _batchGroupState.selectedGroups, _batchGroupState.partialSelections);
}
function _getSelectedCheckpoints() {
const all = comfyEditor.models.checkpoints || [];
// 左ペイン(ファイルツリー)選択
@@ -224,24 +276,57 @@ function _getSelectedCheckpoints() {
return result;
}
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("");
function _renderQueueColumn(countId, listId, items, displayFn, singular, plural) {
const countEl = document.getElementById(countId);
const listEl = document.getElementById(listId);
const n = items.length;
if (countEl) countEl.textContent = `${n} ${n !== 1 ? plural : singular}`;
if (!listEl) return;
if (n === 0) {
listEl.innerHTML = `<p class="wfm-placeholder" style="font-size:11px;padding:8px 10px;">None selected</p>`;
return;
}
listEl.innerHTML = items.map((item, i) => {
const label = displayFn(item);
const tip = typeof item === "string" ? item.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;") : "";
const safeLabel = label.replace(/&/g, "&amp;").replace(/</g, "&lt;");
return `<div class="wfm-batch-preview-item" title="${tip}">${i + 1}. ${safeLabel}</div>`;
}).join("");
}
function _renderBatchPreview() {
// Checkpoint
const ckptList = _getSelectedCheckpoints();
_renderQueueColumn(
"wfm-batch-preview-count", "wfm-batch-preview-list",
ckptList,
(m) => m.replace(/\\/g, "/").split("/").pop(),
"checkpoint", "checkpoints"
);
// Lora
const loraList = [..._getSelectedLoraGroupItems()];
_renderQueueColumn(
"wfm-batch-lora-count", "wfm-batch-lora-list",
loraList,
(m) => m.replace(/\\/g, "/").split("/").pop(),
"lora", "loras"
);
// Prompt
const promptList = _getSelectedPromptGroupItems();
_renderQueueColumn(
"wfm-batch-prompt-count", "wfm-batch-prompt-list",
promptList,
(p) => p.name || p.id,
"prompt", "prompts"
);
// Workflow
const wfList = [..._getSelectedWfGroupItems()];
_renderQueueColumn(
"wfm-batch-wf-count", "wfm-batch-wf-list",
wfList,
(f) => f.replace(/\.json$/i, "").replace(/\\/g, "/").split("/").pop(),
"workflow", "workflows"
);
}
// モデルパスリストをフォルダ → [modelPath, ...] のMapに変換
@@ -549,8 +634,227 @@ function _renderBatchGroupList() {
}
}
// ============================================
// 汎用グループリストレンダリング
// displayFn: (memberValue) => 表示文字列
// ============================================
function _renderAnyGroupList(listEl, groupsData, selectedGroups, partialSelections, displayFn, onPreviewChange) {
if (!listEl) return;
const names = Object.keys(groupsData).sort();
if (names.length === 0) {
listEl.innerHTML = `<p class="wfm-placeholder" style="font-size:12px;padding:16px;">No groups defined.</p>`;
return;
}
listEl.innerHTML = "";
for (const name of names) {
const members = groupsData[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 getSelCount = () => _getGroupSelCountFrom(name, groupsData, selectedGroups, partialSelections);
let selCount = getSelCount();
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;
fileCb.checked = selectedGroups.has(name) || !!(partialSelections[name]?.has(m));
const fileSpan = document.createElement("span");
fileSpan.className = "wfm-ckpt-item-label";
fileSpan.textContent = displayFn(m);
fileSpan.title = m;
fileCb.addEventListener("change", () => {
if (selectedGroups.has(name)) {
selectedGroups.delete(name);
const partial = new Set(members);
partial.delete(m);
if (partial.size > 0) partialSelections[name] = partial;
} else {
if (!partialSelections[name]) partialSelections[name] = new Set();
if (fileCb.checked) partialSelections[name].add(m);
else partialSelections[name].delete(m);
if (members.every((x) => partialSelections[name].has(x))) {
selectedGroups.add(name);
delete partialSelections[name];
}
if (partialSelections[name]?.size === 0) delete partialSelections[name];
}
const sc = getSelCount();
cb.checked = sc === members.length && members.length > 0;
cb.indeterminate = sc > 0 && sc < members.length;
countSpan.textContent = `${sc}/${members.length}`;
onPreviewChange();
});
label.appendChild(fileCb);
label.appendChild(fileSpan);
memberDiv.appendChild(label);
}
cb.addEventListener("change", () => {
if (cb.checked) {
selectedGroups.add(name);
delete partialSelections[name];
} else {
selectedGroups.delete(name);
delete partialSelections[name];
}
memberDiv.querySelectorAll("input[type=checkbox]").forEach((c) => { c.checked = cb.checked; });
countSpan.textContent = `${cb.checked ? members.length : 0}/${members.length}`;
onPreviewChange();
});
[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);
listEl.appendChild(groupDiv);
}
}
// ============================================
// Lora グループ
// ============================================
async function _loadBatchLoraGroups() {
try {
const res = await fetch("/api/wfm/models/groups?type=lora");
if (res.ok) _batchGroupState.loraGroups = await res.json();
else _batchGroupState.loraGroups = {};
} catch { _batchGroupState.loraGroups = {}; }
const currentNames = new Set(Object.keys(_batchGroupState.loraGroups));
for (const name of _batchGroupState.loraSelectedGroups) {
if (!currentNames.has(name)) _batchGroupState.loraSelectedGroups.delete(name);
}
for (const name of Object.keys(_batchGroupState.loraPartialSelections)) {
if (!currentNames.has(name)) delete _batchGroupState.loraPartialSelections[name];
}
_renderBatchLoraGroupList();
_renderBatchPreview();
}
function _renderBatchLoraGroupList() {
const el = document.getElementById("wfm-batch-lora-group-list");
_renderAnyGroupList(
el,
_batchGroupState.loraGroups,
_batchGroupState.loraSelectedGroups,
_batchGroupState.loraPartialSelections,
(m) => m.replace(/\\/g, "/").split("/").pop(),
_renderBatchPreview
);
}
// ============================================
// Prompt グループ
// ============================================
async function _loadPromptGroupsForBatch() {
try {
const res = await fetch("/api/wfm/prompts");
_batchGroupState.promptPresets = res.ok ? await res.json() : [];
} catch { _batchGroupState.promptPresets = []; }
try {
_batchGroupState.promptGroups = JSON.parse(localStorage.getItem("wfm_prompt_preset_groups") || "{}");
} catch { _batchGroupState.promptGroups = {}; }
const validIds = new Set(_batchGroupState.promptPresets.map((p) => p.id));
for (const g of Object.keys(_batchGroupState.promptGroups)) {
_batchGroupState.promptGroups[g] = (_batchGroupState.promptGroups[g] || []).filter((id) => validIds.has(id));
}
const currentNames = new Set(Object.keys(_batchGroupState.promptGroups));
for (const name of _batchGroupState.promptSelectedGroups) {
if (!currentNames.has(name)) _batchGroupState.promptSelectedGroups.delete(name);
}
for (const name of Object.keys(_batchGroupState.promptPartialSelections)) {
if (!currentNames.has(name)) delete _batchGroupState.promptPartialSelections[name];
}
_renderBatchPromptGroupList();
_renderBatchPreview();
}
function _renderBatchPromptGroupList() {
const el = document.getElementById("wfm-batch-prompt-group-list");
const presetsMap = new Map(_batchGroupState.promptPresets.map((p) => [p.id, p]));
_renderAnyGroupList(
el,
_batchGroupState.promptGroups,
_batchGroupState.promptSelectedGroups,
_batchGroupState.promptPartialSelections,
(id) => presetsMap.get(id)?.name || id,
_renderBatchPreview
);
}
// ============================================
// Workflow グループ
// ============================================
function _loadWorkflowGroupsForBatch() {
try {
_batchGroupState.wfGroups = JSON.parse(localStorage.getItem("wfm_groups") || "{}");
} catch { _batchGroupState.wfGroups = {}; }
const currentNames = new Set(Object.keys(_batchGroupState.wfGroups));
for (const name of _batchGroupState.wfSelectedGroups) {
if (!currentNames.has(name)) _batchGroupState.wfSelectedGroups.delete(name);
}
for (const name of Object.keys(_batchGroupState.wfPartialSelections)) {
if (!currentNames.has(name)) delete _batchGroupState.wfPartialSelections[name];
}
_renderBatchWfGroupList();
_renderBatchPreview();
}
function _renderBatchWfGroupList() {
const el = document.getElementById("wfm-batch-wf-group-list");
_renderAnyGroupList(
el,
_batchGroupState.wfGroups,
_batchGroupState.wfSelectedGroups,
_batchGroupState.wfPartialSelections,
(f) => f.replace(/\.json$/i, "").replace(/\\/g, "/").split("/").pop(),
_renderBatchPreview
);
}
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"));
@@ -558,6 +862,10 @@ function initBatchTab() {
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");
if (tabId === "checkpoint") _loadBatchCheckpointGroups();
else if (tabId === "lora") _loadBatchLoraGroups();
else if (tabId === "prompt") _loadPromptGroupsForBatch();
else if (tabId === "workflow") _loadWorkflowGroupsForBatch();
});
});
@@ -578,20 +886,31 @@ function initBatchTab() {
_renderBatchPreview();
});
// Batch タブが表示されたときにグループを読み込む
// Batch タブが表示されたときに全グループを読み込む
document.querySelector('[data-subtab="batch"]')?.addEventListener("click", () => {
_rebuildCkptList();
_loadBatchCheckpointGroups();
_loadBatchLoraGroups();
_loadPromptGroupsForBatch();
_loadWorkflowGroupsForBatch();
_renderBatchPreview();
});
}
function initCheckpointBatch() {
const checkbox = document.getElementById("wfm-ckpt-batch-enabled");
const body = document.getElementById("wfm-ckpt-batch-body");
checkbox?.addEventListener("change", () => {
if (body) body.style.display = checkbox.checked ? "block" : "none";
// Batch type checkboxes — radio behavior (only one at a time)
document.querySelectorAll(".wfm-batch-type-cb").forEach((cb) => {
cb.addEventListener("change", () => {
if (cb.checked) {
_activeBatchType = cb.dataset.batchType;
document.querySelectorAll(".wfm-batch-type-cb").forEach((other) => {
if (other !== cb) other.checked = false;
});
} else {
_activeBatchType = null;
}
_updateBatchTypeLabel();
});
});
// Pause / Resume
@@ -688,39 +1007,26 @@ async function _coreGenerate(silent = false) {
// Batch generation loop
// ============================================
async function _runBatchGenerate() {
const ckptNodes = comfyUI.currentAnalysis?.checkpoint_nodes || [];
if (ckptNodes.length === 0) {
showToast("No checkpoint node found in workflow", "error");
return;
}
const list = _getSelectedCheckpoints();
if (list.length === 0) {
showToast("No checkpoints selected", "error");
return;
}
const batchProgress = document.getElementById("wfm-ckpt-batch-progress");
// 汎用バッチループ: items を順に applyFn(item) → _coreGenerate() で処理する
async function _runBatchLoop(items, applyFn, labelFn = (x) => String(x)) {
const batchProgress = document.getElementById("wfm-ckpt-batch-progress");
const batchCurrentName = document.getElementById("wfm-ckpt-batch-current-name");
const batchCount = document.getElementById("wfm-ckpt-batch-count");
const batchBar = document.getElementById("wfm-ckpt-batch-bar");
const progressText = document.getElementById("wfm-gen-progress-text");
const batchCount = document.getElementById("wfm-ckpt-batch-count");
const batchBar = document.getElementById("wfm-ckpt-batch-bar");
const progressText = document.getElementById("wfm-gen-progress-text");
const pauseBtn = document.getElementById("wfm-ckpt-batch-pause-btn");
if (batchProgress) batchProgress.style.display = "block";
const pauseBtn = document.getElementById("wfm-ckpt-batch-pause-btn");
if (pauseBtn) { pauseBtn.style.display = "block"; pauseBtn.disabled = false; }
_setPauseBtnState(false);
_updateBatchTypeLabel(true);
let completed = 0;
let failed = 0;
let completed = 0, failed = 0;
try {
for (let i = 0; i < list.length; i++) {
for (let i = 0; i < items.length; i++) {
if (_ckptBatch.aborted) break;
// 一時停止中は次のモデルへ進む前に待機
if (_ckptBatch.paused) {
if (batchCurrentName) batchCurrentName.textContent = "Paused...";
if (progressText) progressText.textContent = "Paused";
@@ -728,25 +1034,21 @@ async function _runBatchGenerate() {
await _waitIfPaused();
if (_ckptBatch.aborted) break;
const model = list[i];
if (batchCurrentName) batchCurrentName.textContent = model;
if (batchCount) batchCount.textContent = `${i + 1} / ${list.length}`;
if (batchBar) batchBar.style.width = `${((i / list.length) * 100).toFixed(1)}%`;
if (progressText) progressText.textContent = `[${i + 1}/${list.length}] Loading...`;
for (const node of ckptNodes) {
if (comfyUI.currentWorkflow?.[node.id]) {
comfyUI.currentWorkflow[node.id].inputs.ckpt_name = model;
}
}
const item = items[i];
const label = labelFn(item);
if (batchCurrentName) batchCurrentName.textContent = label;
if (batchCount) batchCount.textContent = `${i + 1} / ${items.length}`;
if (batchBar) batchBar.style.width = `${((i / items.length) * 100).toFixed(1)}%`;
if (progressText) progressText.textContent = `[${i + 1}/${items.length}] Loading...`;
try {
await applyFn(item);
await _coreGenerate(true);
completed++;
} catch (err) {
if (_ckptBatch.aborted) break;
failed++;
showToast(`[${i + 1}/${list.length}] Failed: ${err.message}`, "error");
showToast(`[${i + 1}/${items.length}] Failed: ${err.message}`, "error");
}
}
} finally {
@@ -757,6 +1059,7 @@ async function _runBatchGenerate() {
_ckptBatch._resumeResolve = null;
}
_setPauseBtnState(false);
_updateBatchTypeLabel(false);
}
if (batchBar) batchBar.style.width = "100%";
@@ -766,12 +1069,84 @@ async function _runBatchGenerate() {
showToast(`Batch stopped — ${completed} completed, ${failed} failed`, "info");
} else {
showToast(
`Batch complete: ${completed}/${list.length}${failed > 0 ? ` (${failed} failed)` : ""}`,
`Batch complete: ${completed}/${items.length}${failed > 0 ? ` (${failed} failed)` : ""}`,
failed > 0 ? "error" : "success"
);
}
}
// アクティブなバッチタイプに応じてバッチを実行するディスパッチャ
async function _runBatchGenerate() {
switch (_activeBatchType) {
case "checkpoint": {
const ckptNodes = comfyUI.currentAnalysis?.checkpoint_nodes || [];
if (ckptNodes.length === 0) { showToast("No checkpoint node found in workflow", "error"); return; }
const list = _getSelectedCheckpoints();
if (list.length === 0) { showToast("No checkpoints selected", "error"); return; }
await _runBatchLoop(list, (model) => {
for (const node of ckptNodes) {
if (comfyUI.currentWorkflow?.[node.id])
comfyUI.currentWorkflow[node.id].inputs.ckpt_name = model;
}
});
break;
}
case "lora": {
const loraNodes = comfyUI.currentAnalysis?.lora_nodes || [];
if (loraNodes.length === 0) { showToast("No LoRA node found in workflow", "error"); return; }
const list = [..._getSelectedLoraGroupItems()];
if (list.length === 0) { showToast("No LoRAs selected", "error"); return; }
await _runBatchLoop(list, (loraName) => {
for (const node of loraNodes) {
if (comfyUI.currentWorkflow?.[node.id])
comfyUI.currentWorkflow[node.id].inputs.lora_name = loraName;
}
}, (name) => name.replace(/\.[^.]+$/, ""));
break;
}
case "prompt": {
const positiveNodes = (comfyUI.currentAnalysis?.prompt_nodes || []).filter((n) => n.role === "positive");
const negativeNodes = (comfyUI.currentAnalysis?.prompt_nodes || []).filter((n) => n.role === "negative");
if (positiveNodes.length === 0 && negativeNodes.length === 0) {
showToast("No prompt node found in workflow", "error"); return;
}
// _getSelectedPromptGroupItems() はすでにプリセットオブジェクトの配列を返す
const list = _getSelectedPromptGroupItems();
if (list.length === 0) { showToast("No prompts selected", "error"); return; }
await _runBatchLoop(list, (preset) => {
for (const node of positiveNodes) {
if (comfyUI.currentWorkflow?.[node.id])
comfyUI.currentWorkflow[node.id].inputs[node.textKey || "text"] = preset.text || "";
}
for (const node of negativeNodes) {
if (comfyUI.currentWorkflow?.[node.id])
comfyUI.currentWorkflow[node.id].inputs[node.textKey || "text"] = preset.negText || "";
}
}, (preset) => preset.name || preset.id);
break;
}
case "workflow": {
const list = [..._getSelectedWfGroupItems()];
if (list.length === 0) { showToast("No workflows selected", "error"); return; }
const savedWorkflow = comfyUI.currentWorkflow ? JSON.stringify(comfyUI.currentWorkflow) : null;
const savedFilename = document.getElementById("wfm-gen-workflow-name")?.textContent || "";
try {
await _runBatchLoop(list, async (filename) => {
const resp = await fetch(`/api/wfm/workflows/${encodeURIComponent(filename)}`);
if (!resp.ok) throw new Error(`Failed to load: ${filename}`);
const data = await resp.json();
await loadWorkflowIntoEditor(data, filename);
}, (filename) => filename.replace(/\.json$/, ""));
} finally {
if (savedWorkflow) {
try { await loadWorkflowIntoEditor(JSON.parse(savedWorkflow), savedFilename); } catch {}
}
}
break;
}
}
}
// ============================================
// Generate entry point
// ============================================
@@ -794,7 +1169,7 @@ async function handleGenerate() {
_ckptBatch.paused = false;
_ckptBatch._resumeResolve = null;
const batchEnabled = document.getElementById("wfm-ckpt-batch-enabled")?.checked;
const batchEnabled = _activeBatchType !== null;
try {
if (batchEnabled) {
+93 -12
View File
@@ -240,6 +240,10 @@ const LANGUAGES = {
modelsBadges: "Badges",
modelsInfo: "Info",
modelsFavorite: "Favorite",
modelsBatch: "Batch",
modelsBatchClear: "Clear Batch",
promptBatchClear: "Cleared batch presets",
wfBatchClear: "Cleared batch workflows",
modelsMemo: "Memo",
modelsMemoPlaceholder: "Notes about this model...",
modelsSave: "Save",
@@ -273,6 +277,7 @@ const LANGUAGES = {
modelsGroupExists: "Group already exists",
modelsRenamePrompt: "Enter new group name:",
modelsDeleteGroupConfirm: "Delete group \"{name}\"?",
modelsGroupReserved: "This group is reserved and cannot be deleted or renamed.",
modelEnable: "Enable",
modelDisable: "Disable",
modelDisabled: "Disabled",
@@ -310,7 +315,15 @@ const LANGUAGES = {
civitaiHashing: "Calculating hash... (may take a while for large files)",
civitaiFound: "CivitAI info loaded",
civitaiNotFound: "Model not found on CivitAI",
civitaiNotFoundDesc: "This model was checked but not found on CivitAI.",
civitaiRefetchBtn: "Re-check CivitAI",
civitaiError: "Error fetching from CivitAI",
civitaiType: "Type",
civitaiBaseModel: "Base Model",
civitaiHashLabel: "Hash",
civitaiCopyHash: "Click to copy hash",
civitaiHashCopied: "Hash copied",
civitaiOpenImage: "Open image in new tab",
civitaiTriggerWords: "Trigger Words",
civitaiCopyWord: "Click to copy",
civitaiWordCopied: "Trigger word copied",
@@ -324,6 +337,14 @@ const LANGUAGES = {
civitaiApiKeyPlaceholder: "Paste your CivitAI API key here",
civitaiApiKeySave: "Save",
civitaiApiKeySaved: "CivitAI API key saved",
civitaiTabInfo: "Info",
civitaiTabSample: "Sample",
civitaiNoImages: "No sample images available",
civitaiHostSetting: "CivitAI Host",
civitaiHostHint: "Choose which CivitAI site opens when you click a model link. civitai.com is SFW-only; civitai.red has no content restrictions.",
civitaiHostCom: "civitai.com (SFW only)",
civitaiHostRed: "civitai.red (unrestricted)",
civitaiHostSaved: "CivitAI host saved",
modelsSideInfo: "Info",
modelsSideGroup: "Group",
modelsSideCivitai: "CivitAI",
@@ -392,7 +413,7 @@ const LANGUAGES = {
helpAboutDesc: "A centralized control UI for managing ComfyUI workflow JSON files, generating images via API, assisting with prompt creation, and browsing/organizing nodes.",
helpAbout1: "Install via ComfyUI Manager or git clone to custom_nodes",
helpAbout2: "Launch from the Workflow Studio button in the ComfyUI toolbar, or open http://127.0.0.1:8188/wfm",
helpWf1: "Switch between Thumbnail, Card, and Table view modes",
helpWf1: "Switch between Thumbnail and Table view modes",
helpWf2: "Search, category filter, favorites filter, and group filter",
helpWf3: "Create, rename, delete groups and assign/remove workflows",
helpWf4: "Import JSON/PNG files via button or drag & drop",
@@ -401,7 +422,7 @@ const LANGUAGES = {
helpWf7: "Badge management: add, rename, delete badges with custom colors shared with the Models tab (⚙ Badge button)",
helpGen1: "Connect/disconnect ComfyUI and check connection status",
helpGen2: "Load workflows from Workflow tab (App format .app.json not supported)",
helpGen3: "4-tab layout — Input (Prompt + Image), Model, Settings, Feeder — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing",
helpGen3: "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",
helpGen4: "Input tab: Prompt (top) and Image drag-and-drop (bottom) in the left column",
helpGen5: "Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter",
helpGen6: "Settings tab: KSampler and Latent Image side by side, each at 50% width",
@@ -409,7 +430,10 @@ const LANGUAGES = {
helpGen8: "Seed control: random, fixed, increment, decrement",
helpGen9: "Generate, progress display, stop, and view results",
helpGen10: "Eagle integration: auto-save generated images to Eagle",
helpGen11: "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",
helpGen11: "Batch type selector: check one of the column header checkboxes in the Batch Queue pane (Checkpoint / Lora / Prompt / Workflow) to activate that batch type — only one type can be active at a time; the Batch panel below Generate shows the active type, progress, and Pause/Resume/Stop controls",
helpGen12: "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",
helpGen13: "Batch tab — Center pane: group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint/Lora groups come from the Models tab, Prompt groups from the Prompt tab, Workflow groups from the Workflow tab — check a group header to select all its members, or expand ▶ to select individually",
helpGen14: "Batch tab — Right pane (Batch Queue): shows items queued for each batch type; column headers (Checkpoint / Lora / Prompt / Workflow) each have a checkbox — check one to activate that batch type (radio behavior: only one at a time); count shown at top",
helpFeederTitle: "GenerateUI Tab — Feeder subtab",
helpFeederDesc: "Requires the comfyui-image-feeder custom node. Controls ImageFeeder nodes and runs continuous generation loops over an image library stored in user/default/image-loop-data/.",
helpFeeder1: "Left pane — Node settings: select the target ImageFeeder node from the dropdown; edit all node parameters (Directory, Sort Mode, Index, Start/End Index, Batch Size, Seed, Use Selection); click Apply to write changes to the loaded workflow",
@@ -440,6 +464,9 @@ const LANGUAGES = {
helpSettings8: "Data Management: export all plugin data (settings, metadata, prompts, etc.) to a JSON file, or import to restore. After importing, restart ComfyUI.",
helpSettings9: "All sections are collapsible accordion panels",
helpSettings10: "Wildcard Integration: link WFS wildcard dir to ComfyUI-Impact-Pack wildcards (directory junction on Windows / symlink on other OS); existing files migrated automatically",
helpSettings11: "Text Size: one slider (10–28 px) adjusts font size for all prompt and chat textareas at once — Generate UI positive/negative prompts, AI Assistant chat input, Preset positive/negative, Wildcard prompt and file editor, and Metadata prompt full preview; takes effect immediately and saved with Save Settings",
helpSettings12: "RAW JSON Colors: customize the 6 syntax highlight colors for the Raw JSON editor in Generate UI — Default Text, Name/Scheduler, Title, Width/Height, Prompt/Text, Image/File; changes apply immediately on color pick; Reset Defaults restores the original color scheme",
helpSettings13: "CivitAI Host: choose between civitai.com (SFW only) and civitai.red (unrestricted) — determines which site opens when clicking a model link in the Models tab CivitAI panel",
helpNodes1: "Node Browser: search by name/description/alias/tag, filter by category, package, tag, group, favorites",
helpNodes2: "Card and Table view modes with pagination",
helpNodes3: "Favorite nodes and add custom tags for organization",
@@ -447,7 +474,7 @@ const LANGUAGES = {
helpNodes5: "Side panel: Details (class name, package, category, description, flags), I/O Spec (inputs/outputs with types and defaults), Groups management",
helpNodes6: "Node Sets: create reusable node collections with descriptions, tags, and link definitions between nodes",
helpModels1: "Browse installed models: Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding with sub-tab switching",
helpModels2: "Thumbnail, Card, and Table view modes with pagination",
helpModels2: "Thumbnail and Table view modes with pagination",
helpModels3: "Search, tag filter, group filter, favorites filter, and status filter (All / Enabled only / Disabled only)",
helpModels4: "Side panel: Info (file path, tags, memo), Groups management, CivitAI integration",
helpModels5: "CivitAI integration: fetch model info by SHA256 hash, batch fetch per model type; preview image is automatically downloaded and saved if none exists",
@@ -882,6 +909,10 @@ const LANGUAGES = {
modelsBadges: "バッジ",
modelsInfo: "情報",
modelsFavorite: "お気に入り",
modelsBatch: "バッチ",
modelsBatchClear: "バッチ一括解除",
promptBatchClear: "バッチプリセットを一括解除しました",
wfBatchClear: "バッチワークフローを一括解除しました",
modelsMemo: "メモ",
modelsMemoPlaceholder: "このモデルについてのメモ...",
modelsSave: "保存",
@@ -915,6 +946,7 @@ const LANGUAGES = {
modelsGroupExists: "同名のグループが既に存在します",
modelsRenamePrompt: "新しいグループ名を入力:",
modelsDeleteGroupConfirm: "グループ「{name}」を削除しますか?",
modelsGroupReserved: "このグループは予約済みのため削除・名前変更できません。",
modelEnable: "有効化",
modelDisable: "無効化",
modelDisabled: "無効",
@@ -952,7 +984,15 @@ const LANGUAGES = {
civitaiHashing: "ハッシュ計算中...(大きいファイルは時間がかかります)",
civitaiFound: "CivitAI情報を取得しました",
civitaiNotFound: "CivitAIにモデルが見つかりません",
civitaiNotFoundDesc: "確認済みですが、このモデルはCivitAIに見つかりませんでした。",
civitaiRefetchBtn: "再確認する",
civitaiError: "CivitAIからの取得エラー",
civitaiType: "タイプ",
civitaiBaseModel: "ベースモデル",
civitaiHashLabel: "ハッシュ",
civitaiCopyHash: "クリックでハッシュをコピー",
civitaiHashCopied: "ハッシュをコピーしました",
civitaiOpenImage: "画像を別タブで開く",
civitaiTriggerWords: "トリガーワード",
civitaiCopyWord: "クリックでコピー",
civitaiWordCopied: "トリガーワードをコピーしました",
@@ -966,6 +1006,14 @@ const LANGUAGES = {
civitaiApiKeyPlaceholder: "CivitAI APIキーを貼り付けてください",
civitaiApiKeySave: "保存",
civitaiApiKeySaved: "CivitAI APIキーを保存しました",
civitaiTabInfo: "情報",
civitaiTabSample: "サンプル",
civitaiNoImages: "サンプル画像がありません",
civitaiHostSetting: "CivitAI ホスト",
civitaiHostHint: "モデルリンクをクリックしたときに開くCivitAIサイトを選択します。civitai.comはSFWコンテンツのみ、civitai.redはコンテンツ制限なしです。",
civitaiHostCom: "civitai.com(SFW のみ)",
civitaiHostRed: "civitai.red(制限なし)",
civitaiHostSaved: "CivitAI ホストを保存しました",
modelsSideInfo: "基本情報",
modelsSideGroup: "グループ",
modelsSideCivitai: "CivitAI",
@@ -1034,7 +1082,7 @@ const LANGUAGES = {
helpAboutDesc: "ComfyUIのワークフローJSONファイルの管理、API接続による画像生成、プロンプト作成支援、ノードの閲覧・整理を行う集中コントロールUIです。",
helpAbout1: "ComfyUIマネージャーからインストール、またはcustom_nodesフォルダへgit clone",
helpAbout2: "ComfyUIツールバーのWorkflow Studioボタンから起動、またはhttp://127.0.0.1:8188/wfmを開く",
helpWf1: "サムネイル / カード / テーブルの表示モード切り替え",
helpWf1: "サムネイル / テーブルの表示モード切り替え",
helpWf2: "テキスト検索、カテゴリフィルタ、お気に入りフィルタ、グループフィルタ",
helpWf3: "グループの作成・名前変更・削除、ワークフローの割り当て・解除",
helpWf4: "JSON/PNGファイルのインポート(ボタンまたはドラッグ&ドロップ)",
@@ -1043,7 +1091,7 @@ const LANGUAGES = {
helpWf7: "バッジ管理:バッジの追加・名前変更・削除、カスタム色設定(Modelsタブと共有)— ⚙ Badgeボタン",
helpGen1: "ComfyUIの接続・切断、接続状態の確認",
helpGen2: "Workflowタブからワークフローを読み込み(App形式 .app.json は非対応)",
helpGen3: "4タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder — Input/Model/SettingsタブにはRaw JSON列を常時表示",
helpGen3: "5タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder、Batch — Input/Model/SettingsタブにはRaw JSON列を常時表示",
helpGen4: "Inputタブ:左列にPrompt(上段)+ Image ドラッグ&ドロップ(下段)",
helpGen5: "Modelタブ:Checkpoint/VAE/LoRA/ControlNet/UNET/TextEncoderのセレクタ(フィルタ検索付き)",
helpGen6: "Settingsタブ:KSamplerとLatent Imageを横並び(各50%幅)",
@@ -1051,7 +1099,10 @@ const LANGUAGES = {
helpGen8: "シード管理:ランダム / 固定 / 増加 / 減少",
helpGen9: "画像生成、進捗表示、生成停止、結果表示",
helpGen10: "Eagle連携:生成画像をEagleへ自動保存",
helpGen11: "Checkpoint Batch:ドロップダウンのフォルダツリーからチェックポイントを選択 — フォルダにチェックでそのフォルダ内を一括選択、▶で展開して個別選択も可能;Filterで絞り込み;Pause/Resumeでモデル間の処理を一時停止・再開;Stopで現在の生成完了後に中断",
helpGen11: "バッチタイプ選択:Batchキュー右ペインのカラムヘッダーチェックボックス(Checkpoint / Lora / Prompt / Workflow)で実行タイプを選択 — 同時に1種類のみ有効;Generateボタン下のBatchパネルで有効タイプ・進捗・一時停止/再開・停止を操作可能",
helpGen12: "Batchタブ — 3ペインレイアウト:左ペイン(ファイルツリー)でフォルダ単位にチェックポイントを選択;フィルタで絞り込み、All/Noneボタンで一括選択・解除;初期状態は全てチェックなし",
helpGen13: "Batchタブ — 中央ペイン:グループ選択(Checkpoint | Lora | Prompt | Workflowの内部タブ);Checkpoint/LoraグループはModelsタブ、PromptグループはPromptタブ、WorkflowグループはWorkflowタブの定義を反映 — グループヘッダーにチェックで全メンバーを選択、▶で展開して個別選択も可能",
helpGen14: "Batchタブ — 右ペイン(バッチキュー):各バッチタイプのキュー項目を表示;カラムヘッダー(Checkpoint / Lora / Prompt / Workflow)のチェックボックスで実行タイプを選択(ラジオ動作:1種類のみ);上部に件数を表示",
helpFeederTitle: "GenerateUI Tab — Feeder サブタブ",
helpFeederDesc: "comfyui-image-feeder カスタムノードが必要です。ImageFeeder ノードを操作し、user/default/image-loop-data/ に保存された画像ライブラリを使って連続生成ループを実行します。",
helpFeeder1: "左ペイン — ノード設定:ドロップダウンで対象 ImageFeeder ノードを選択;Directory・Sort Mode・Index・Start/End Index・Batch Size・Seed・Use Selection の各パラメータを編集;Apply で読み込み済みワークフローに反映",
@@ -1082,6 +1133,9 @@ const LANGUAGES = {
helpSettings8: "データ管理:設定・メタデータ・プロンプトなど全データをJSONにエクスポート、またはインポートして復元。インポート後はComfyUIを再起動してください。",
helpSettings9: "各セクションはアコーディオン式で折りたたみ可能",
helpSettings10: "Wildcard Integration:WFSのワイルドカードディレクトリをComfyUI-Impact-Packのwildcardsディレクトリへリンク(Windowsはジャンクション、他OSはシンボリックリンク)。既存ファイルは自動で移行されます",
helpSettings11: "テキストサイズ:スライダー1本(10〜28px)でプロンプト・チャット全テキストエリアのフォントサイズを一括調整 — GenerateUI ポジティブ/ネガティブプロンプト、AIアシスタントチャット入力、プリセット ポジティブ/ネガティブ、ワイルドカードプロンプト・ファイルエディタ、メタデータプロンプト全文プレビュー;即時反映・保存で確定",
helpSettings12: "RAW JSON カラー:GenerateUI の Raw JSON エディタの構文ハイライト色(6色)をカスタマイズ — デフォルトテキスト・名前/スケジューラー・タイトル・幅/高さ・プロンプト/テキスト・画像/ファイル;カラーピッカーで即時反映;「デフォルトにリセット」で元の配色に戻す",
helpSettings13: "CivitAI ホスト:civitai.com(SFWのみ)と civitai.red(制限なし)を切り替え — ModelsタブのCivitAIパネルでモデルリンクをクリックしたときに開くサイトを指定",
helpNodes1: "ノードブラウザ:名前/説明/エイリアス/タグで検索、カテゴリ・パッケージ・タグ・グループ・お気に入りフィルタ",
helpNodes2: "カード / テーブル表示モード切り替え(ページネーション付き)",
helpNodes3: "ノードのお気に入り登録、カスタムタグの追加で整理",
@@ -1089,7 +1143,7 @@ const LANGUAGES = {
helpNodes5: "サイドパネル:詳細(クラス名、パッケージ、カテゴリ、説明、フラグ)、I/O仕様(入出力の型・デフォルト値)、グループ管理",
helpNodes6: "ノードセット:再利用可能なノードコレクションの作成(説明、タグ、ノード間リンク定義付き)",
helpModels1: "インストール済みモデルの閲覧:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embeddingをサブタブで切り替え",
helpModels2: "サムネイル / カード / テーブル表示モード切り替え(ページネーション付き)",
helpModels2: "サムネイル / テーブル表示モード切り替え(ページネーション付き)",
helpModels3: "検索、タグフィルタ、グループフィルタ、お気に入りフィルタ、ステータスフィルタ(すべて / 有効のみ / 無効のみ)",
helpModels4: "サイドパネル:基本情報(ファイルパス、タグ、メモ)、グループ管理、CivitAI連携",
helpModels5: "CivitAI連携:SHA256ハッシュでモデル情報取得、モデルタイプごとの一括取得;プレビュー画像がない場合は自動でダウンロード・保存",
@@ -1520,6 +1574,10 @@ const LANGUAGES = {
modelsBadges: "标签",
modelsInfo: "信息",
modelsFavorite: "收藏",
modelsBatch: "批次",
modelsBatchClear: "清空批次",
promptBatchClear: "已清空批次预设",
wfBatchClear: "已清空批次工作流",
modelsMemo: "备注",
modelsMemoPlaceholder: "关于此模型的备注...",
modelsSave: "保存",
@@ -1553,6 +1611,7 @@ const LANGUAGES = {
modelsGroupExists: "同名分组已存在",
modelsRenamePrompt: "输入新分组名称:",
modelsDeleteGroupConfirm: "删除分组「{name}」?",
modelsGroupReserved: "此分组为系统保留分组,无法删除或重命名。",
modelEnable: "启用",
modelDisable: "禁用",
modelDisabled: "已禁用",
@@ -1590,7 +1649,15 @@ const LANGUAGES = {
civitaiHashing: "计算哈希中...(大文件可能需要较长时间)",
civitaiFound: "已加载CivitAI信息",
civitaiNotFound: "在CivitAI上未找到该模型",
civitaiNotFoundDesc: "已检查,但在CivitAI上未找到此模型。",
civitaiRefetchBtn: "重新检查",
civitaiError: "从CivitAI获取时出错",
civitaiType: "类型",
civitaiBaseModel: "基础模型",
civitaiHashLabel: "哈希",
civitaiCopyHash: "点击复制哈希",
civitaiHashCopied: "哈希已复制",
civitaiOpenImage: "在新标签页中打开图片",
civitaiTriggerWords: "触发词",
civitaiCopyWord: "点击复制",
civitaiWordCopied: "触发词已复制",
@@ -1604,6 +1671,14 @@ const LANGUAGES = {
civitaiApiKeyPlaceholder: "在此粘贴您的CivitAI API密钥",
civitaiApiKeySave: "保存",
civitaiApiKeySaved: "CivitAI API密钥已保存",
civitaiTabInfo: "信息",
civitaiTabSample: "样本图",
civitaiNoImages: "没有样本图片",
civitaiHostSetting: "CivitAI 站点",
civitaiHostHint: "选择点击模型链接时打开的 CivitAI 站点。civitai.com 仅限 SFW 内容;civitai.red 无内容限制。",
civitaiHostCom: "civitai.com(仅 SFW)",
civitaiHostRed: "civitai.red(无限制)",
civitaiHostSaved: "CivitAI 站点已保存",
modelsSideInfo: "基本信息",
modelsSideGroup: "分组",
modelsSideCivitai: "CivitAI",
@@ -1672,7 +1747,7 @@ const LANGUAGES = {
helpAboutDesc: "用于管理ComfyUI工作流JSON文件、通过API生成图片、辅助提示词创作、浏览和整理节点的集中控制UI。",
helpAbout1: "通过ComfyUI Manager安装,或git clone到custom_nodes文件夹",
helpAbout2: "从ComfyUI工具栏的Workflow Studio按钮启动,或打开http://127.0.0.1:8188/wfm",
helpWf1: "切换缩略图/卡片/表格视图模式",
helpWf1: "切换缩略图/表格视图模式",
helpWf2: "文本搜索、分类筛选、收藏筛选、分组筛选",
helpWf3: "创建、重命名、删除分组,分配/移除工作流",
helpWf4: "通过按钮或拖放导入JSON/PNG文件",
@@ -1681,7 +1756,7 @@ const LANGUAGES = {
helpWf7: "徽章管理:添加、重命名、删除徽章并自定义颜色(与Models标签共享)— ⚙ Badge按钮",
helpGen1: "连接/断开ComfyUI,检查连接状态",
helpGen2: "从工作流标签页加载工作流(不支持App格式.app.json)",
helpGen3: "4标签布局 — Input(提示词+图片)、Model、Settings、Feeder — Input/Model/Settings标签各含Raw JSON列实时预览",
helpGen3: "5标签布局 — Input(提示词+图像)、Model、Settings、Feeder、Batch — Input/Model/Settings各含实时预览和直接编辑的Raw JSON列",
helpGen4: "Input标签:左列为Prompt(上)+ Image拖放(下)",
helpGen5: "Model标签:Checkpoint/VAE/LoRA/ControlNet/UNET/TextEncoder选择器(含筛选)",
helpGen6: "Settings标签:KSampler与Latent Image并排显示(各占50%宽度)",
@@ -1689,7 +1764,10 @@ const LANGUAGES = {
helpGen8: "种子管理:随机/固定/递增/递减",
helpGen9: "生成图片、进度显示、停止生成、查看结果",
helpGen10: "Eagle集成:自动保存生成图片到Eagle",
helpGen11: "Checkpoint Batch:从下拉框文件夹树中选择检查点 — 勾选文件夹可一键选中该文件夹内的所有文件,▶展开后也可单独选择;使用Filter筛选;Pause/Resume可在模型之间暂停和继续;Stop在当前生成完成后中止",
helpGen11: "批次类型选择:勾选批次队列右窗格列标题复选框(Checkpoint / Lora / Prompt / Workflow)激活对应批次类型 — 每次只能激活一种;Generate按钮下方的Batch面板显示当前类型、进度及暂停/继续/停止控制",
helpGen12: "Batch标签 — 3窗格布局:左窗格(文件树)按文件夹选择检查点;使用筛选器缩小列表,All/None按钮全选或清除;初始状态全部未勾选",
helpGen13: "Batch标签 — 中央窗格:基于组的选择(含Checkpoint | Lora | Prompt | Workflow内部标签);Checkpoint/Lora组来自Models标签,Prompt组来自Prompt标签,Workflow组来自Workflow标签 — 勾选组标题选中所有成员,▶展开后也可单独选择",
helpGen14: "Batch标签 — 右窗格(批量队列):显示各批次类型的队列项目;列标题(Checkpoint / Lora / Prompt / Workflow)各有复选框 — 勾选一个激活该类型(单选行为);顶部显示数量",
helpFeederTitle: "GenerateUI Tab — Feeder 子标签",
helpFeederDesc: "需要 comfyui-image-feeder 自定义节点。用于操控 ImageFeeder 节点,并对存储在 user/default/image-loop-data/ 中的图片库执行连续生成循环。",
helpFeeder1: "左侧面板 — 节点设置:从下拉框选择目标 ImageFeeder 节点;编辑所有节点参数(Directory、Sort Mode、Index、Start/End Index、Batch Size、Seed、Use Selection);点击 Apply 将更改写入当前工作流",
@@ -1720,6 +1798,9 @@ const LANGUAGES = {
helpSettings8: "数据管理:将所有插件数据(设置、元数据、提示词等)导出为JSON文件,或导入以恢复。导入后请重启ComfyUI。",
helpSettings9: "各部分可折叠展开",
helpSettings10: "Wildcard Integration:将WFS通配符目录链接到ComfyUI-Impact-Pack的wildcards目录(Windows为目录联结,其他OS为符号链接);现有文件自动迁移",
helpSettings11: "文字大小:单个滑块(10–28 px)可一次性调整所有提示词和聊天文本框的字体大小 — GenerateUI正/负向提示词、AI助手聊天输入、预设正/负向提示、通配符提示和文件编辑器、元数据提示词全文预览;即时生效并通过「保存设置」保存",
helpSettings12: "RAW JSON 配色:自定义GenerateUI中Raw JSON编辑器的6种语法高亮颜色 — 默认文本、名称/调度器、标题、宽度/高度、提示词/文本、图像/文件;颜色选择即时生效;「重置默认」恢复原始配色",
helpSettings13: "CivitAI 站点:在 civitai.com(仅SFW)和 civitai.red(无限制)之间切换 — 决定在Models标签CivitAI面板中点击模型链接时打开的站点",
helpNodes1: "节点浏览器:按名称/描述/别名/标签搜索,按分类、包、标签、组、收藏筛选",
helpNodes2: "卡片和表格视图模式切换(带分页)",
helpNodes3: "收藏节点,添加自定义标签进行整理",
@@ -1727,7 +1808,7 @@ const LANGUAGES = {
helpNodes5: "侧面板:详情(类名、包、分类、描述、标志)、I/O规格(输入输出类型和默认值)、组管理",
helpNodes6: "节点集:创建可复用的节点集合(含描述、标签、节点间链接定义)",
helpModels1: "浏览已安装模型:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embedding,通过子标签切换",
helpModels2: "缩略图、卡片和表格视图模式切换(带分页)",
helpModels2: "缩略图和表格视图模式切换(带分页)",
helpModels3: "搜索、标签筛选、分组筛选、收藏筛选、状态筛选(全部 / 仅启用 / 仅禁用)",
helpModels4: "侧面板:基本信息(文件路径、标签、备注)、分组管理、CivitAI集成",
helpModels5: "CivitAI集成:通过SHA256哈希获取模型信息,按模型类型批量获取;无预览图时自动下载并保存",
+209 -90
View File
@@ -8,6 +8,10 @@ import { t } from "./i18n.js";
import { comfyUI } from "./comfyui-client.js";
import { comfyEditor } from "./comfyui-editor.js";
// ── Constants ─────────────────────────────────────────────
const RESERVED_GROUPS = ["Batch"];
const BATCH_MODEL_TYPES = ["checkpoint", "lora"];
// ── State ─────────────────────────────────────────────────
const state = {
@@ -35,7 +39,8 @@ const state = {
groupFilter: "",
statusFilter: "all", // "all" | "enabled" | "disabled"
showFavoritesOnly: false,
viewMode: localStorage.getItem("wfm_models_view") || "thumb",
showBatchOnly: false,
viewMode: localStorage.getItem("wfm_models_view") === "table" ? "table" : "thumb",
activeModelType: "checkpoint",
selectedModel: null,
loaded: {},
@@ -554,6 +559,11 @@ function filterModels() {
});
}
if (state.showBatchOnly) {
const batchMembers = state.modelGroups["Batch"] || [];
models = models.filter((m) => batchMembers.includes(m));
}
if (state.tagFilter) {
models = models.filter((m) => {
const meta = state.modelMetadata[m];
@@ -740,17 +750,8 @@ function renderGroupFilter() {
const select = document.getElementById("wfm-models-group-filter");
if (!select) return;
// Collect groups across all types with type labels
const options = [];
const typeOrder = Object.keys(TYPE_LABELS);
typeOrder.forEach((type) => {
const groups = state.allModelGroups[type];
if (!groups) return;
const names = Object.keys(groups).sort();
names.forEach((g) => {
options.push({ type, name: g });
});
});
const groups = state.allModelGroups[state.activeModelType] || {};
const names = Object.keys(groups).sort();
const currentValue = state.groupFilter
? `${state.activeModelType}::${state.groupFilter}`
@@ -758,11 +759,10 @@ function renderGroupFilter() {
select.innerHTML =
`<option value="">${t("modelsAllGroups")}</option>` +
options.map(({ type, name }) => {
const typeLabel = TYPE_LABELS[type] || type;
const value = `${type}::${name}`;
names.map((name) => {
const value = `${state.activeModelType}::${name}`;
const isActive = value === currentValue;
return `<option value="${escapeHtml(value)}"${isActive ? " selected" : ""}>[${typeLabel}] ${escapeHtml(name)}</option>`;
return `<option value="${escapeHtml(value)}"${isActive ? " selected" : ""}>${escapeHtml(name)}</option>`;
}).join("");
}
@@ -829,8 +829,6 @@ function renderModelGrid() {
if (state.viewMode === "table") {
renderTableView(grid, filtered);
} else if (state.viewMode === "card") {
renderCardView(grid, filtered);
} else {
renderThumbView(grid, filtered);
}
@@ -848,6 +846,8 @@ function renderThumbView(grid, models) {
const tagsHtml = (meta.tags || []).map((tag) => `<span class="wfm-badge wfm-badge-sm">${escapeHtml(tag)}</span>`).join("");
const favStar = meta.favorite ? "\u2605" : "\u2606";
const favClass = meta.favorite ? "wfm-fav-btn active" : "wfm-fav-btn";
const inBatch = isInBatch(modelName);
const batchClass = inBatch ? "wfm-batch-btn active" : "wfm-batch-btn";
const card = document.createElement("div");
card.className = "wfm-card";
@@ -865,6 +865,7 @@ function renderThumbView(grid, models) {
<div class="wfm-card-title" title="${escapeHtml(modelName)}">${escapeHtml(getStem(name))}</div>
<div class="wfm-card-meta">${userBadges} ${tagsHtml}</div>
</div>
<button class="${batchClass}" title="${t("modelsBatch")}">B</button>
<button class="${favClass}" title="${t("modelsFavorite")}">${favStar}</button>
<button class="wfm-toggle-btn${disabled ? " wfm-toggle-disabled" : ""}" title="${disabled ? t("modelEnable") : t("modelDisable")}">${disabled ? "▶" : "⏸"}</button>`;
@@ -873,6 +874,10 @@ function renderThumbView(grid, models) {
const placeholder = card.querySelector(".wfm-card-thumb-placeholder");
loadPreviewImage(img, placeholder, modelName);
card.querySelector(".wfm-batch-btn").addEventListener("click", (e) => {
e.stopPropagation();
toggleBatch(modelName);
});
card.querySelector(".wfm-fav-btn").addEventListener("click", (e) => {
e.stopPropagation();
toggleFavorite(modelName);
@@ -888,7 +893,7 @@ function renderThumbView(grid, models) {
checkEl.className = "wfm-select-check" + (isChecked ? " checked" : "");
card.appendChild(checkEl);
card.addEventListener("click", (e) => {
if (e.target.closest(".wfm-fav-btn, .wfm-toggle-btn")) return;
if (e.target.closest(".wfm-batch-btn, .wfm-fav-btn, .wfm-toggle-btn")) return;
toggleModelSelection(modelName);
});
} else {
@@ -899,61 +904,6 @@ function renderThumbView(grid, models) {
});
}
// ── Card View (no thumbnail, compact) ─────────────────────
function renderCardView(grid, models) {
grid.innerHTML = "";
models.forEach((modelName) => {
const meta = state.modelMetadata[modelName] || {};
const { dir, name } = parseModelPath(modelName);
const ext = getExtension(name);
const disabled = isModelDisabled(modelName);
const userBadges = modelBadgesHtml(modelName);
const tagsHtml = (meta.tags || []).map((tag) => `<span class="wfm-badge wfm-badge-sm">${escapeHtml(tag)}</span>`).join("");
const favStar = meta.favorite ? "\u2605" : "\u2606";
const favClass = meta.favorite ? "wfm-fav-btn active" : "wfm-fav-btn";
const card = document.createElement("div");
card.className = "wfm-card wfm-model-card";
if (disabled) card.classList.add("wfm-model-disabled");
if (state.selectedModel === modelName) card.classList.add("wfm-card-selected");
card.dataset.modelName = modelName;
card.innerHTML = `
<div class="wfm-card-body">
<div class="wfm-card-title" title="${escapeHtml(modelName)}">${escapeHtml(name)}${disabled ? ` <span class="wfm-badge wfm-badge-disabled">${t("modelDisabled")}</span>` : ""}</div>
<div class="wfm-card-meta">
${userBadges} ${tagsHtml}
</div>
</div>
<button class="${favClass}" title="${t("modelsFavorite")}">${favStar}</button>
<button class="wfm-toggle-btn${disabled ? " wfm-toggle-disabled" : ""}" title="${disabled ? t("modelEnable") : t("modelDisable")}">${disabled ? "▶" : "⏸"}</button>`;
card.querySelector(".wfm-fav-btn").addEventListener("click", (e) => {
e.stopPropagation();
toggleFavorite(modelName);
});
card.querySelector(".wfm-toggle-btn").addEventListener("click", (e) => {
e.stopPropagation();
toggleModelEnable(modelName);
});
if (state.selectMode) {
const isChecked = state.selectedModels.has(modelName);
card.classList.toggle("wfm-card-checked", isChecked);
const checkEl = document.createElement("div");
checkEl.className = "wfm-select-check" + (isChecked ? " checked" : "");
card.appendChild(checkEl);
card.addEventListener("click", (e) => {
if (e.target.closest(".wfm-fav-btn, .wfm-toggle-btn")) return;
toggleModelSelection(modelName);
});
} else {
card.addEventListener("click", () => showSidePanel(modelName));
card.addEventListener("dblclick", (e) => { e.stopPropagation(); openDetailModal(modelName); });
}
grid.appendChild(card);
});
}
// ── Table View ────────────────────────────────────────────
@@ -966,6 +916,7 @@ function renderTableView(grid, models) {
const disabled = isModelDisabled(modelName);
const isChecked = state.selectMode && state.selectedModels.has(modelName);
const favIcon = meta.favorite ? "&#9733;" : "&#9734;";
const batchIcon = isInBatch(modelName) ? `<button class="wfm-batch-btn active" title="${t("modelsBatch")}">B</button>` : `<button class="wfm-batch-btn" title="${t("modelsBatch")}">B</button>`;
const tagsStr = (meta.tags || []).join(", ");
const memo = meta.memo || "";
const toggleLabel = disabled ? t("modelEnable") : t("modelDisable");
@@ -983,6 +934,7 @@ function renderTableView(grid, models) {
<td>${escapeHtml(tagsStr)}</td>
<td class="wfm-table-td-memo" title="${escapeHtml(memo)}">${escapeHtml(memo)}</td>
<td class="wfm-table-td-toggle"><button class="wfm-toggle-btn${disabled ? " wfm-toggle-disabled" : ""}" title="${toggleLabel}">${toggleIcon}</button></td>
<td class="wfm-table-td-batch">${batchIcon}</td>
</tr>`;
})
.join("");
@@ -998,6 +950,7 @@ function renderTableView(grid, models) {
<th>${t("modelsTags")}</th>
<th>${t("modelsMemo")}</th>
<th style="width:50px;"></th>
<th style="width:30px;">B</th>
</tr></thead><tbody>${rows}</tbody></table>`;
grid.querySelectorAll(".wfm-models-table-row").forEach((row) => {
@@ -1007,7 +960,7 @@ function renderTableView(grid, models) {
if (state.selectMode) {
row.addEventListener("click", (e) => {
if (e.target.closest(".wfm-models-table-fav, .wfm-toggle-btn")) return;
if (e.target.closest(".wfm-models-table-fav, .wfm-toggle-btn, .wfm-batch-btn")) return;
toggleModelSelection(mn);
});
} else {
@@ -1022,9 +975,45 @@ function renderTableView(grid, models) {
e.stopPropagation();
toggleModelEnable(mn);
});
row.querySelector(".wfm-batch-btn").addEventListener("click", (e) => {
e.stopPropagation();
toggleBatch(mn);
});
});
}
// ── Batch group helpers ───────────────────────────────────
function isInBatch(modelName) {
return (state.modelGroups["Batch"] || []).includes(modelName);
}
async function toggleBatch(modelName) {
const batch = state.modelGroups["Batch"] || [];
const idx = batch.indexOf(modelName);
if (idx >= 0) {
batch.splice(idx, 1);
} else {
batch.push(modelName);
}
state.modelGroups["Batch"] = batch;
state.allModelGroups[state.activeModelType] = state.modelGroups;
await saveModelGroups(state.modelGroups);
renderModelGrid();
}
async function clearBatchGroup() {
state.modelGroups["Batch"] = [];
state.allModelGroups[state.activeModelType] = state.modelGroups;
await saveModelGroups(state.modelGroups);
if (state.showBatchOnly) {
state.showBatchOnly = false;
document.getElementById("wfm-models-batch-filter-btn")?.classList.remove("active");
}
renderModelGrid();
showToast(t("modelsBatchClear"), "success");
}
// ── Favorite toggle ───────────────────────────────────────
async function toggleFavorite(modelName) {
@@ -1439,6 +1428,10 @@ function renderSideGroup(modelName) {
const sel = document.getElementById("wfm-models-group-manage-select");
const oldName = sel?.value;
if (!oldName) return;
if (RESERVED_GROUPS.includes(oldName)) {
showToast(t("modelsGroupReserved"), "warning");
return;
}
const newName = prompt(t("modelsRenamePrompt"), oldName);
if (!newName || newName === oldName) return;
if (state.modelGroups[newName]) {
@@ -1458,6 +1451,10 @@ function renderSideGroup(modelName) {
const sel = document.getElementById("wfm-models-group-manage-select");
const g = sel?.value;
if (!g) return;
if (RESERVED_GROUPS.includes(g)) {
showToast(t("modelsGroupReserved"), "warning");
return;
}
if (!confirm(t("modelsDeleteGroupConfirm").replace("{name}", g))) return;
delete state.modelGroups[g];
saveModelGroups(state.modelGroups).then(() => {
@@ -1496,6 +1493,21 @@ function renderSideCivitai(modelName) {
if (cached) {
renderCivitaiInfo(el, cached, modelName);
} else if (sha256) {
// SHA256 is known but model was not found on CivitAI
el.innerHTML = `
<div style="padding:0 4px;text-align:center;">
<p style="color:var(--wfm-text-secondary);font-size:13px;margin-bottom:12px;">
${t("civitaiNotFoundDesc")}
</p>
<button class="wfm-btn wfm-btn-sm" id="wfm-civitai-fetch-btn">
${t("civitaiRefetchBtn")}
</button>
<div id="wfm-civitai-status" style="margin-top:8px;font-size:12px;color:var(--wfm-text-secondary);"></div>
</div>`;
document.getElementById("wfm-civitai-fetch-btn")?.addEventListener("click", () => {
fetchCivitaiForModel(modelName, el);
});
} else {
el.innerHTML = `
<div style="padding:0 4px;text-align:center;">
@@ -1569,9 +1581,47 @@ async function fetchCivitaiForModel(modelName, el) {
}
function renderCivitaiInfo(el, info, modelName) {
const imagesHtml = (info.images || []).map((url) =>
`<img src="${escapeHtml(url)}" style="width:100%;border-radius:4px;margin-bottom:6px;" loading="lazy" />`
).join("");
// URL: ユーザー設定ホスト(localStorage)を使用、modelId なし時は /model-versions/ にフォールバック
const civitaiHost = localStorage.getItem("wfm_civitai_host") || "civitai.com";
const modelUrl = info.modelId && info.versionId
? `https://${civitaiHost}/models/${info.modelId}?modelVersionId=${info.versionId}`
: info.versionId
? `https://${civitaiHost}/model-versions/${info.versionId}`
: (info.modelUrl || "#");
// Hash: BLAKE3 優先、なければ SHA256
const fileHashes = info.fileHashes || {};
const blake3 = fileHashes.BLAKE3 || fileHashes.Blake3 || "";
const sha256 = fileHashes.SHA256 || (state.modelMetadata[modelName] || {}).sha256 || "";
const hashType = blake3 ? "BLAKE3" : (sha256 ? "SHA256" : "");
const hashFull = blake3 || sha256;
// Detail rows
const ROW = "display:flex;align-items:center;font-size:12px;margin-bottom:5px;";
const LABEL = "color:var(--wfm-text-secondary);min-width:80px;flex-shrink:0;";
const typeRow = info.type ? `
<div style="${ROW}">
<span style="${LABEL}">${t("civitaiType")}</span>
<span style="font-size:10px;font-weight:700;background:var(--wfm-bg-tertiary,rgba(255,255,255,0.1));padding:2px 7px;border-radius:3px;letter-spacing:0.6px;">${escapeHtml(info.type.toUpperCase())}</span>
</div>` : "";
const baseModelRow = info.baseModel ? `
<div style="${ROW}">
<span style="${LABEL}">${t("civitaiBaseModel")}</span>
<span>${escapeHtml(info.baseModel)}</span>
</div>` : "";
const hashRow = hashFull ? `
<div style="${ROW}">
<span style="${LABEL}">${t("civitaiHashLabel")}</span>
<code class="wfm-hash-value" data-hash="${escapeHtml(hashFull)}"
style="background:var(--wfm-bg-secondary);padding:2px 6px;border-radius:3px;cursor:pointer;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 84px);"
title="${t("civitaiCopyHash")}">${escapeHtml(hashType)}: ${escapeHtml(hashFull.substring(0, 16).toUpperCase())}…</code>
</div>` : "";
const detailSection = (typeRow || baseModelRow || hashRow)
? `<div style="margin-bottom:10px;">${typeRow}${baseModelRow}${hashRow}</div>` : "";
const tagsHtml = (info.tags || []).map((tag) =>
`<span class="wfm-badge wfm-badge-sm">${escapeHtml(tag)}</span>`
@@ -1581,25 +1631,64 @@ function renderCivitaiInfo(el, info, modelName) {
`<code style="font-size:11px;background:var(--wfm-bg-secondary);padding:1px 4px;border-radius:3px;cursor:pointer;" class="wfm-trained-word" title="${t("civitaiCopyWord")}">${escapeHtml(w)}</code>`
).join(" ");
// Sample images — all go to Sample pane
const images = info.images || [];
const sampleImagesHtml = images.map((url) =>
`<a href="${escapeHtml(url)}" target="_blank" rel="noopener" title="${t("civitaiOpenImage")}"><img src="${escapeHtml(url)}" style="width:100%;border-radius:4px;margin-bottom:6px;cursor:pointer;display:block;" loading="lazy" /></a>`
).join("");
el.innerHTML = `
<div style="padding:0 4px;">
<div style="margin-bottom:10px;">
<div style="font-weight:700;font-size:14px;margin-bottom:2px;">
<a href="${escapeHtml(info.modelUrl)}" target="_blank" style="color:var(--wfm-primary);text-decoration:none;">${escapeHtml(info.modelName)}</a>
<div style="display:flex;border-bottom:1px solid var(--wfm-border);margin-bottom:10px;">
<button class="wfm-civitai-subtab-btn" data-pane="info"
style="padding:4px 10px;font-size:12px;border:none;background:none;cursor:pointer;border-bottom:2px solid var(--wfm-primary);color:var(--wfm-primary);font-weight:600;margin-bottom:-1px;">
${t("civitaiTabInfo")}
</button>
<button class="wfm-civitai-subtab-btn" data-pane="sample"
style="padding:4px 10px;font-size:12px;border:none;background:none;cursor:pointer;border-bottom:2px solid transparent;color:var(--wfm-text-secondary);margin-bottom:-1px;">
${t("civitaiTabSample")}${images.length ? ` (${images.length})` : ""}
</button>
</div>
<div id="wfm-civitai-pane-info">
<div style="margin-bottom:10px;">
<div style="font-weight:700;font-size:14px;margin-bottom:2px;">
<a href="${escapeHtml(modelUrl)}" target="_blank" style="color:var(--wfm-primary);text-decoration:none;">${escapeHtml(info.modelName)}</a>
</div>
<div style="font-size:12px;color:var(--wfm-text-secondary);">
${escapeHtml(info.versionName)}${info.creator ? ` · by ${escapeHtml(info.creator)}` : ""}
</div>
</div>
<div style="font-size:12px;color:var(--wfm-text-secondary);">
${escapeHtml(info.versionName)} · ${escapeHtml(info.baseModel)} · by ${escapeHtml(info.creator)}
${detailSection}
${tagsHtml ? `<div style="margin-bottom:8px;">${tagsHtml}</div>` : ""}
${trainedWordsHtml ? `<div style="margin-bottom:10px;"><div style="font-weight:600;font-size:12px;margin-bottom:4px;">${t("civitaiTriggerWords")}</div>${trainedWordsHtml}</div>` : ""}
${info.description ? `<div style="font-size:12px;color:var(--wfm-text-secondary);line-height:1.5;max-height:120px;overflow-y:auto;">${info.description}</div>` : ""}
<div style="margin-top:10px;">
<button class="wfm-btn wfm-btn-sm" id="wfm-civitai-refresh-btn">${t("civitaiRefresh")}</button>
</div>
</div>
${imagesHtml ? `<div style="margin-bottom:10px;">${imagesHtml}</div>` : ""}
${tagsHtml ? `<div style="margin-bottom:8px;">${tagsHtml}</div>` : ""}
${trainedWordsHtml ? `<div style="margin-bottom:10px;"><div style="font-weight:600;font-size:12px;margin-bottom:4px;">${t("civitaiTriggerWords")}</div>${trainedWordsHtml}</div>` : ""}
${info.description ? `<div style="font-size:12px;color:var(--wfm-text-secondary);line-height:1.5;max-height:200px;overflow-y:auto;">${info.description}</div>` : ""}
<div style="margin-top:10px;">
<button class="wfm-btn wfm-btn-sm" id="wfm-civitai-refresh-btn">${t("civitaiRefresh")}</button>
<div id="wfm-civitai-pane-sample" style="display:none;">
${sampleImagesHtml || `<p style="color:var(--wfm-text-secondary);font-size:13px;text-align:center;margin-top:20px;">${t("civitaiNoImages")}</p>`}
</div>
</div>`;
// Sub-tab switching
const subtabBtns = el.querySelectorAll(".wfm-civitai-subtab-btn");
subtabBtns.forEach((btn) => {
btn.addEventListener("click", () => {
const pane = btn.dataset.pane;
subtabBtns.forEach((b) => {
const isActive = b === btn;
b.style.borderBottom = isActive ? "2px solid var(--wfm-primary)" : "2px solid transparent";
b.style.color = isActive ? "var(--wfm-primary)" : "var(--wfm-text-secondary)";
b.style.fontWeight = isActive ? "600" : "400";
});
el.querySelector("#wfm-civitai-pane-info").style.display = pane === "info" ? "" : "none";
el.querySelector("#wfm-civitai-pane-sample").style.display = pane === "sample" ? "" : "none";
});
});
// Copy trigger word on click
el.querySelectorAll(".wfm-trained-word").forEach((wordEl) => {
wordEl.addEventListener("click", () => {
@@ -1609,9 +1698,17 @@ function renderCivitaiInfo(el, info, modelName) {
});
});
// Copy hash on click
el.querySelectorAll(".wfm-hash-value").forEach((hashEl) => {
hashEl.addEventListener("click", () => {
navigator.clipboard.writeText(hashEl.dataset.hash).then(() => {
showToast(t("civitaiHashCopied"), "success");
});
});
});
// Refresh button
document.getElementById("wfm-civitai-refresh-btn")?.addEventListener("click", () => {
// Clear cache for this model and re-fetch
const meta = state.modelMetadata[modelName] || {};
if (meta.sha256) delete state.civitaiCache[meta.sha256];
delete meta.sha256;
@@ -1628,6 +1725,10 @@ async function loadModelsForCurrentType() {
if (state.loaded[type] && state.modelsByType[type].length > 0) {
// Reload groups for this type (groups are per-type)
state.modelGroups = await fetchModelGroups();
if (BATCH_MODEL_TYPES.includes(type) && !state.modelGroups["Batch"]) {
state.modelGroups["Batch"] = [];
await saveModelGroups(state.modelGroups);
}
state.allModelGroups[type] = state.modelGroups;
renderTagFilter();
renderDirFilter();
@@ -1647,6 +1748,10 @@ async function loadModelsForCurrentType() {
]);
const disabledSet = new Set(Array.isArray(disabledList) ? disabledList : []);
state.disabledModels[type] = disabledSet;
if (BATCH_MODEL_TYPES.includes(type) && !groups["Batch"]) {
groups["Batch"] = [];
await saveModelGroups(groups);
}
state.modelGroups = groups;
state.allModelGroups[type] = groups;
@@ -1888,6 +1993,19 @@ export function initModelsTab() {
});
}
// Batch filter
document.getElementById("wfm-models-batch-filter-btn")?.addEventListener("click", () => {
state.showBatchOnly = !state.showBatchOnly;
document.getElementById("wfm-models-batch-filter-btn").classList.toggle("active", state.showBatchOnly);
state.currentPage = 0;
renderModelGrid();
});
// Batch clear
document.getElementById("wfm-models-batch-clear-btn")?.addEventListener("click", () => {
clearBatchGroup();
});
// View mode (thumb / card / table)
document.querySelectorAll("[data-models-view]").forEach((btn) => {
if (btn.dataset.modelsView === state.viewMode) {
@@ -1933,6 +2051,7 @@ export function initModelsTab() {
const map = { info: "wfm-models-side-info", group: "wfm-models-side-group", civitai: "wfm-models-side-civitai" };
const target = document.getElementById(map[tabId]);
if (target) target.style.display = "block";
if (tabId === "civitai" && state.selectedModel) renderSideCivitai(state.selectedModel);
});
});
+46 -8
View File
@@ -21,6 +21,7 @@ let pmSearchText = "";
let pmSelectedId = null; // currently selected preset id
let pmGroups = {}; // { groupName: [presetId, ...] }
const PM_GROUPS_KEY = "wfm_prompt_preset_groups";
const PROMPT_RESERVED_GROUPS = ["Batch"];
// ============================================
// Preset API helpers
@@ -118,11 +119,15 @@ async function loadAllPresets() {
pmGroups = JSON.parse(localStorage.getItem(PM_GROUPS_KEY) || "{}");
} catch { pmGroups = {}; }
// Clean stale entries from groups
// Clean stale entries from groups (preserve reserved groups even if empty)
const validIds = new Set(promptPresets.map(p => p.id));
for (const g of Object.keys(pmGroups)) {
pmGroups[g] = (pmGroups[g] || []).filter(id => validIds.has(id));
if (pmGroups[g].length === 0) delete pmGroups[g];
if (pmGroups[g].length === 0 && !PROMPT_RESERVED_GROUPS.includes(g)) delete pmGroups[g];
}
// Ensure reserved groups always exist
for (const g of PROMPT_RESERVED_GROUPS) {
if (!pmGroups[g]) pmGroups[g] = [];
}
saveGroups();
@@ -213,6 +218,25 @@ function matchesSearch(p) {
(p.tags || []).some(t => t.toLowerCase().includes(s));
}
function isInBatchPreset(id) {
return (pmGroups["Batch"] || []).includes(id);
}
function toggleBatchPreset(id) {
const batch = pmGroups["Batch"] || [];
const idx = batch.indexOf(id);
if (idx >= 0) { batch.splice(idx, 1); } else { batch.push(id); }
pmGroups["Batch"] = batch;
saveGroups();
}
function clearBatchPresets() {
pmGroups["Batch"] = [];
saveGroups();
renderPresetManager();
showToast(t("promptBatchClear"), "success");
}
function createPmItem(preset) {
const el = document.createElement("div");
el.className = "wfm-pm-item" + (pmSelectedId === preset.id ? " active" : "");
@@ -225,12 +249,15 @@ function createPmItem(preset) {
? `<span style="font-size:9px;color:var(--wfm-primary);margin-left:4px;">[${esc(preset.category)}]</span>`
: "";
const inBatch = isInBatchPreset(preset.id);
el.innerHTML = `
<div class="wfm-pm-item-body">
<div class="wfm-pm-item-name">${preset.favorite ? '<span style="color:#ffd700;">&#9733;</span> ' : ""}${esc(preset.name)}${catBadge}</div>
<div class="wfm-pm-item-sub">${esc(previewText)}</div>
</div>
<div class="wfm-pm-item-actions">
<button class="wfm-pm-action-btn pm-batch-btn${inBatch ? " batch-active" : ""}" title="Batch">B</button>
<button class="wfm-pm-action-btn pm-fav-btn${preset.favorite ? " fav-active" : ""}" title="Favorite">&#9733;</button>
<button class="wfm-pm-action-btn pm-del-btn" title="Delete" style="color:var(--wfm-danger);">&#10005;</button>
</div>
@@ -242,6 +269,13 @@ function createPmItem(preset) {
selectPresetInEditor(preset);
});
// Batch toggle
el.querySelector(".pm-batch-btn").addEventListener("click", (e) => {
e.stopPropagation();
toggleBatchPreset(preset.id);
renderPresetManager();
});
// Favorite toggle
el.querySelector(".pm-fav-btn").addEventListener("click", async (e) => {
e.stopPropagation();
@@ -977,18 +1011,14 @@ export function initPromptTab() {
});
if (created) {
promptPresets.push(created);
pmSelectedId = created.id;
showToast(t("presetSaved"), "success");
}
}
pmSelectedId = null;
renderPresetSelect();
renderPresetManager();
// Re-select
if (pmSelectedId && presetSelect) {
presetSelect.value = pmSelectedId;
}
if (presetSelect) presetSelect.value = "";
});
// Apply preset to GenerateUI
@@ -1059,6 +1089,10 @@ export function initPromptTab() {
showToast("Select a group first", "error");
return;
}
if (PROMPT_RESERVED_GROUPS.includes(groupName)) {
showToast(t("modelsGroupReserved"), "warning");
return;
}
if (!confirm(`Delete group "${groupName}"?`)) return;
delete pmGroups[groupName];
saveGroups();
@@ -1081,6 +1115,10 @@ export function initPromptTab() {
renderPresetManager();
});
document.getElementById("wfm-pm-batch-clear-btn")?.addEventListener("click", () => {
clearBatchPresets();
});
// ── Center column tab switching ──────────────────────────
document.querySelectorAll(".wfm-prompt-center-tab").forEach(btn => {
btn.addEventListener("click", () => {
+29 -1
View File
@@ -393,6 +393,11 @@ export async function initSettingsTab() {
const settings = loadLocalSettings();
const serverSettings = await loadServerSettings();
// Sync civitai_host to localStorage so other tabs can read it without an extra fetch
if (serverSettings.civitai_host) {
localStorage.setItem("wfm_civitai_host", serverSettings.civitai_host);
}
// Load current workflows dir info
let workflowsDirInfo = { current: "", default: "" };
try {
@@ -659,9 +664,19 @@ export async function initSettingsTab() {
</div>
</details>
<!-- CivitAI API Key -->
<!-- CivitAI Settings -->
<details class="wfm-settings-section">
<summary class="wfm-settings-summary">${t("civitaiApiKeySetting")}</summary>
<div class="wfm-form-group">
<label style="display:flex;align-items:center;gap:4px;">
${t("civitaiHostSetting")}
<span title="${t("civitaiHostHint")}" style="cursor:help;color:var(--wfm-text-secondary);font-size:13px;">ℹ</span>
</label>
<select class="wfm-select" id="wfm-settings-civitai-host" style="width:100%;">
<option value="civitai.com" ${(serverSettings.civitai_host || "civitai.com") === "civitai.com" ? "selected" : ""}>${t("civitaiHostCom")}</option>
<option value="civitai.red" ${serverSettings.civitai_host === "civitai.red" ? "selected" : ""}>${t("civitaiHostRed")}</option>
</select>
</div>
<div class="wfm-form-group">
<small style="color:var(--wfm-text-secondary);font-size:11px;display:block;margin-bottom:8px;">
${t("civitaiApiKeyHint")}
@@ -1091,6 +1106,19 @@ export async function initSettingsTab() {
}
});
// CivitAI host select
document.getElementById("wfm-settings-civitai-host")?.addEventListener("change", async (e) => {
const host = e.target.value;
try {
await saveServerSettings({ civitai_host: host });
serverSettings.civitai_host = host;
localStorage.setItem("wfm_civitai_host", host);
showToast(t("civitaiHostSaved"), "success");
} catch (err) {
showToast(`${t("saveError")}: ${err.message}`, "error");
}
});
// Save CivitAI API key
document.getElementById("wfm-settings-civitai-api-key-save")?.addEventListener("click", async () => {
const apiKey = document.getElementById("wfm-settings-civitai-api-key")?.value.trim() || "";
+85 -18
View File
@@ -11,6 +11,11 @@ import { t, getSummaryPrompt } from "./i18n.js";
import { highlightJSON } from "./json-highlight.js";
import { openBadgeEditModal } from "./models-tab.js";
// ============================================
// Constants
// ============================================
const WF_RESERVED_GROUPS = ["Batch"];
// ============================================
// State
// ============================================
@@ -19,10 +24,11 @@ const state = {
workflows: [],
activeBadge: "ALL",
searchText: "",
viewMode: localStorage.getItem("wfm_default_view") || "thumb", // thumb | card | table
viewMode: localStorage.getItem("wfm_default_view") === "table" ? "table" : "thumb",
selectedWf: null,
groupFilter: "", // empty = all groups
currentPage: 0,
showBatchOnly: false,
};
@@ -92,6 +98,11 @@ const groups = {
} catch {
this._data = {};
}
let needsSave = false;
for (const g of WF_RESERVED_GROUPS) {
if (!this._data[g]) { this._data[g] = []; needsSave = true; }
}
if (needsSave) this.save();
return this._data;
},
save() {
@@ -117,11 +128,14 @@ const groups = {
},
deleteGroup(name) {
if (WF_RESERVED_GROUPS.includes(name)) return false;
delete this.data[name];
this.save();
return true;
},
renameGroup(oldName, newName) {
if (WF_RESERVED_GROUPS.includes(oldName)) return false;
if (!newName || this.data[newName] || !this.data[oldName]) return false;
this.data[newName] = this.data[oldName];
delete this.data[oldName];
@@ -154,6 +168,32 @@ const groups = {
},
};
// ============================================
// Batch helpers
// ============================================
function isInBatch(filename) {
return (groups.data["Batch"] || []).includes(filename);
}
function toggleBatch(filename) {
const batch = groups.data["Batch"] || [];
const idx = batch.indexOf(filename);
if (idx >= 0) { batch.splice(idx, 1); } else { batch.push(filename); }
groups.data["Batch"] = batch;
groups.save();
renderGrid();
}
function clearBatch() {
groups.data["Batch"] = [];
groups.save();
state.showBatchOnly = false;
renderModelFilters();
renderGrid();
showToast(t("wfBatchClear"), "success");
}
// ============================================
// API
// ============================================
@@ -250,6 +290,7 @@ function renderModelFilters() {
container.innerHTML = `
<button class="wfm-filter-btn ${state.activeBadge === "ALL" ? "active" : ""}" data-filter="ALL">ALL</button>
<button class="wfm-filter-btn ${state.activeBadge === "FAVORITE" ? "active" : ""}" data-filter="FAVORITE">&#9733;</button>
<button class="wfm-filter-btn wfm-wf-batch-filter-btn${state.showBatchOnly ? " active" : ""}">B</button>
${badges.map((b) => {
const color = palette[b] || "";
const style = color ? ` style="background:${color};color:#fff;"` : "";
@@ -259,6 +300,13 @@ function renderModelFilters() {
container.querySelectorAll(".wfm-filter-btn").forEach((btn) => {
btn.addEventListener("click", () => {
if (btn.classList.contains("wfm-wf-batch-filter-btn")) {
state.showBatchOnly = !state.showBatchOnly;
state.currentPage = 0;
renderModelFilters();
renderGrid();
return;
}
state.activeBadge = btn.dataset.filter;
state.currentPage = 0;
renderModelFilters();
@@ -278,6 +326,11 @@ function filterWorkflows() {
return false;
}
// Batch filter
if (state.showBatchOnly) {
if (!(groups.data["Batch"] || []).includes(wf.filename)) return false;
}
// Group filter
if (state.groupFilter) {
const grpFiles = groups.data[state.groupFilter] || [];
@@ -333,30 +386,24 @@ function renderGrid() {
card.dataset.filename = wf.filename;
const hasThumb = !!wf.thumbnail;
const badges = wfBadgesHtml(wf);
const tags = (wf.metadata.tags || []).map((t) => `<span class="wfm-tag">#${t}</span>`).join("");
const favStar = wf.metadata.favorite ? "\u2605" : "\u2606";
const favClass = wf.metadata.favorite ? "wfm-fav-btn active" : "wfm-fav-btn";
if (state.viewMode === "thumb") {
card.innerHTML = `
<div class="wfm-card-thumb">${hasThumb ? `<img src="${wf.thumbnail}" loading="lazy" />` : `<span class="wfm-card-thumb-placeholder">${t("noImage")}</span>`}</div>
card.innerHTML = `
<div class="wfm-card-thumb">
${hasThumb ? `<img src="${wf.thumbnail}" loading="lazy" />` : `<span class="wfm-card-thumb-placeholder">${t("noImage")}</span>`}
<button class="wfm-batch-btn${isInBatch(wf.filename) ? ' active' : ''}" title="Batch">B</button>
</div>
<div class="wfm-card-body">
<div class="wfm-card-title" title="${wf.filename}">${wf.filename.replace(/\.json$/, "")}</div>
<div class="wfm-card-meta">${badges}</div>
</div>
<button class="${favClass}" title="${t("favorite")}">${favStar}</button>`;
} else {
// Card view: no thumbnail, more meta info
const io = `P:${wf.analysis.inputs?.prompts || 0} I:${wf.analysis.inputs?.images || 0} → ${wf.analysis.outputs?.images || 0}`;
card.innerHTML = `
<div class="wfm-card-body">
<div class="wfm-card-title" title="${wf.filename}">${wf.filename.replace(/\.json$/, "")}</div>
<div class="wfm-card-meta">${badges}</div>
<div class="wfm-card-io">${io}</div>
<div class="wfm-card-tags">${tags}</div>
</div>
<button class="${favClass}" title="${t("favorite")}">${favStar}</button>`;
}
card.querySelector(".wfm-batch-btn")?.addEventListener("click", (e) => {
e.stopPropagation();
toggleBatch(wf.filename);
});
card.querySelector(".wfm-fav-btn")?.addEventListener("click", (e) => {
e.stopPropagation();
@@ -390,6 +437,7 @@ function renderTableView(grid, filtered) {
<th style="width:60px;">${t("tags")}</th>
<th class="wfm-table-th-memo">${t("memo")}</th>
<th class="wfm-table-th-summary">${t("summary")}</th>
<th style="width:30px;"></th>
</tr></thead>`;
const tbody = document.createElement("tbody");
@@ -414,7 +462,13 @@ function renderTableView(grid, filtered) {
<td class="wfm-table-td-io">${io}</td>
<td>${tags}</td>
<td class="wfm-table-td-memo" title="${(wf.metadata.memo || "").replace(/"/g, "&quot;")}">${wf.metadata.memo || ""}</td>
<td class="wfm-table-td-summary" title="${(wf.metadata.summary || "").replace(/"/g, "&quot;")}">${wf.metadata.summary || ""}</td>`;
<td class="wfm-table-td-summary" title="${(wf.metadata.summary || "").replace(/"/g, "&quot;")}">${wf.metadata.summary || ""}</td>
<td class="wfm-table-td-batch"><button class="wfm-batch-btn${isInBatch(wf.filename) ? ' active' : ''}" title="Batch">B</button></td>`;
tr.querySelector(".wfm-batch-btn")?.addEventListener("click", (e) => {
e.stopPropagation();
toggleBatch(wf.filename);
});
tr.querySelector(".wfm-fav-btn")?.addEventListener("click", (e) => {
e.stopPropagation();
@@ -656,6 +710,10 @@ function renderSideGroup(wf) {
el.querySelector("#wfm-grp-rename-btn")?.addEventListener("click", () => {
const oldName = el.querySelector("#wfm-grp-manage-sel")?.value;
if (!oldName) return;
if (WF_RESERVED_GROUPS.includes(oldName)) {
showToast(t("modelsGroupReserved"), "warning");
return;
}
const newName = prompt(`Rename group "${oldName}" to:`, oldName);
if (!newName || newName === oldName) return;
if (!groups.renameGroup(oldName, newName)) {
@@ -672,6 +730,10 @@ function renderSideGroup(wf) {
el.querySelector("#wfm-grp-delete-btn")?.addEventListener("click", () => {
const name = el.querySelector("#wfm-grp-manage-sel")?.value;
if (!name) return;
if (WF_RESERVED_GROUPS.includes(name)) {
showToast(t("modelsGroupReserved"), "warning");
return;
}
if (!confirm(`Delete group "${name}"?`)) return;
groups.deleteGroup(name);
if (state.groupFilter === name) {
@@ -1271,6 +1333,11 @@ export function initWorkflowTab() {
openBadgeEditModal(() => renderGrid());
});
// Toolbar: BC (batch clear) button
document.getElementById("wfm-wf-batch-clear-btn")?.addEventListener("click", () => {
clearBatch();
});
// Initial load
loadWorkflows();
}
+53 -15
View File
@@ -50,7 +50,6 @@
<button id="wfm-list-open-comfyui-btn" class="wfm-btn wfm-btn-sm" disabled title="Select a card first">Open in ComfyUI</button>
<div class="wfm-view-btns">
<button class="wfm-view-btn active" data-view="thumb" title="Thumbnail">&#8862;</button>
<button class="wfm-view-btn" data-view="card" title="Card">&#9776;</button>
<button class="wfm-view-btn" data-view="table" title="Table">&#8801;</button>
</div>
<button id="wfm-refresh-btn" class="wfm-btn wfm-btn-sm">Refresh</button>
@@ -63,6 +62,7 @@
<button id="wfm-badge-settings-btn" class="wfm-btn wfm-btn-sm" title="View settings">&#9881;</button>
<div id="wfm-badge-settings-panel" class="wfm-badge-settings-panel" style="display:none;"></div>
</div>
<button id="wfm-wf-batch-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all batch workflows">BC</button>
</div>
</div>
<div class="wfm-workflow-area">
@@ -190,6 +190,7 @@
<!-- Row 2: Search / filter toolbar -->
<div id="wfm-models-toolbar" class="wfm-toolbar-row" style="gap:6px;flex-wrap:wrap;">
<button class="wfm-filter-btn" id="wfm-models-fav-btn" title="Favorites">&#9733;</button>
<button class="wfm-filter-btn" id="wfm-models-batch-filter-btn" title="Batch">B</button>
<input type="text" id="wfm-models-search" class="wfm-search-input" placeholder="Search models...">
<select id="wfm-models-tag-filter" class="wfm-select wfm-toolbar-select"><option value="">All Tags</option></select>
<select id="wfm-models-dir-filter" class="wfm-select wfm-toolbar-select"><option value="">All Folders</option></select>
@@ -201,7 +202,6 @@
</select>
<div class="wfm-view-btns">
<button class="wfm-view-btn active" data-models-view="thumb" title="Thumbnail">&#8862;</button>
<button class="wfm-view-btn" data-models-view="card" title="Card">&#9776;</button>
<button class="wfm-view-btn" data-models-view="table" title="Table">&#8801;</button>
</div>
<span id="wfm-models-count" class="wfm-nodes-count"></span>
@@ -210,6 +210,7 @@
<span id="wfm-models-civitai-progress" style="font-size:12px;color:var(--wfm-text-secondary);"></span>
<button id="wfm-models-badge-settings-btn" class="wfm-btn wfm-btn-sm" title="Badge settings">&#9881; Badge</button>
<button id="wfm-models-select-btn" class="wfm-btn wfm-btn-sm" title="Multi-select models">Select</button>
<button id="wfm-models-batch-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all batch entries">BC</button>
</div>
<!-- Bulk action bar (shown in select mode) -->
<div id="wfm-models-bulk-bar" class="wfm-bulk-bar" style="display:none;"></div>
@@ -341,21 +342,56 @@
<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 class="wfm-batch-pane-header" style="border-top:none;">Groups</div>
<div id="wfm-batch-lora-group-list" class="wfm-batch-group-list"></div>
</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 class="wfm-batch-pane-header" style="border-top:none;">Groups</div>
<div id="wfm-batch-prompt-group-list" class="wfm-batch-group-list"></div>
</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 class="wfm-batch-pane-header" style="border-top:none;">Groups</div>
<div id="wfm-batch-wf-group-list" class="wfm-batch-group-list"></div>
</div>
</div>
<!-- Right pane: batch queue preview -->
<!-- Right pane: batch queue preview (4 columns) -->
<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 class="wfm-batch-queue-grid">
<div class="wfm-batch-queue-col">
<div class="wfm-batch-queue-col-header">
<span>Checkpoint</span>
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="checkpoint" title="Checkpoint batch を有効にする">
</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 class="wfm-batch-queue-col">
<div class="wfm-batch-queue-col-header">
<span>Lora</span>
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="lora" title="Lora batch を有効にする">
</div>
<div id="wfm-batch-lora-count" class="wfm-batch-count"></div>
<div id="wfm-batch-lora-list" class="wfm-batch-preview-list"></div>
</div>
<div class="wfm-batch-queue-col">
<div class="wfm-batch-queue-col-header">
<span>Prompt</span>
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="prompt" title="Prompt batch を有効にする">
</div>
<div id="wfm-batch-prompt-count" class="wfm-batch-count"></div>
<div id="wfm-batch-prompt-list" class="wfm-batch-preview-list"></div>
</div>
<div class="wfm-batch-queue-col">
<div class="wfm-batch-queue-col-header">
<span>Workflow</span>
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="workflow" title="Workflow batch を有効にする">
</div>
<div id="wfm-batch-wf-count" class="wfm-batch-count"></div>
<div id="wfm-batch-wf-list" class="wfm-batch-preview-list"></div>
</div>
</div>
</div>
</div>
</div>
@@ -509,14 +545,14 @@
</div>
</div>
<!-- Checkpoint Batch Panel -->
<!-- Batch Status Panel -->
<div class="wfm-gen-panel" id="wfm-ckpt-batch-panel">
<div style="display:flex;align-items:center;gap:8px;">
<input type="checkbox" id="wfm-ckpt-batch-enabled" style="width:14px;height:14px;cursor:pointer;accent-color:var(--wfm-primary);">
<label for="wfm-ckpt-batch-enabled" style="font-weight:600;font-size:13px;cursor:pointer;">Checkpoint Batch</label>
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;">
<span style="font-weight:600;font-size:13px;">Batch</span>
<span id="wfm-batch-type-label" style="font-size:11px;color:var(--wfm-text-secondary);">—</span>
</div>
<div id="wfm-ckpt-batch-body" style="display:none;margin-top:8px;">
<div id="wfm-ckpt-batch-progress" style="display:none;">
<div id="wfm-ckpt-batch-body">
<div id="wfm-ckpt-batch-progress" style="display:none;margin-top:6px;">
<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>
@@ -659,7 +695,8 @@
<button class="wfm-pm-tab" data-pmtab="groups">Groups</button>
</div>
<div class="wfm-pm-search">
<input type="text" id="wfm-pm-search-input" class="wfm-input" placeholder="Search presets...">
<input type="text" id="wfm-pm-search-input" class="wfm-input" placeholder="Search presets..." style="flex:1;min-width:0;">
<button id="wfm-pm-batch-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all batch presets" style="flex-shrink:0;">BC</button>
</div>
<div id="wfm-pm-list" class="wfm-pm-list"></div>
</div>
@@ -922,6 +959,7 @@
<li id="wfm-help-settings-10">Wildcard Integration: link WFS wildcard dir to ComfyUI-Impact-Pack wildcards (junction/symlink); existing files migrated automatically</li>
<li id="wfm-help-settings-11">Text Size: one slider (10–28 px) adjusts font size for all prompt and chat textareas at once — Generate UI positive/negative prompts, AI Assistant chat input, Preset positive/negative, Wildcard prompt and file editor, and Metadata prompt full preview; takes effect immediately and saved with Save Settings</li>
<li id="wfm-help-settings-12">RAW JSON Colors: customize the 6 syntax highlight colors for the Raw JSON editor in Generate UI — Default Text, Name/Scheduler, Title, Width/Height, Prompt/Text, Image/File; changes apply immediately on color pick; Reset Defaults restores the original color scheme</li>
<li id="wfm-help-settings-13">CivitAI Host: choose between civitai.com (SFW only) and civitai.red (unrestricted) — determines which site opens when clicking a model link in the Models tab CivitAI panel</li>
</ul>
</div>