Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3957ec7d21 | ||
|
|
0c7ca31c99 | ||
|
|
ff9df1ad92 | ||
|
|
c0fde1c42e | ||
|
|
3886ad2b42 | ||
|
|
080d75b8c4 | ||
|
|
eada3923c7 | ||
|
|
ef0fccbd36 |
@@ -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` のバージョンバッジを更新(``)
|
||||
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 に反映されない。
|
||||
|
||||
@@ -1,5 +1,904 @@
|
||||
# DEVLOG - ComfyUI-Workflow-Studio
|
||||
|
||||
## 2026-06-08: v0.3.32 — Lora Loader (LoraManager) LoRA検出対応・ライブラリ機能拡張
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### Lora Loader (LoraManager) LoRA検出対応(`web/comfyui/node_sets_menu.js`, `static/js/metadata-tab.js`)
|
||||
- `_extractLoRAs` / `extractLoRAs` の `add` 関数を `parseFloat` ベースに変更。LoraManager ノードは `strength` / `clipStrength` を文字列 (`"0.20"`) で保存するため `typeof === "number"` では `1.0` にフォールバックしていたバグを修正
|
||||
- APIフォーマット(`class_type` ベース)の `else` 節に `Lora Loader (LoraManager)` を追加。`inputs.loras.__value__` からLoRAリストを取得(`Array.isArray(inputs.loras)` をフォールバックとして併用)
|
||||
- Iタブ(ライブラリ)・Metadataタブの両方に同様の修正を適用
|
||||
|
||||
#### `placeLoraMgrNode` textウィジェット同期(`web/comfyui/node_sets_menu.js`)
|
||||
- LoraManagerノード配置時に `loras` ウィジェット(配列)だけでなく `text` ウィジェット(LoRA構文)も明示的に更新するよう修正
|
||||
- strength = clipStrength の場合 `<lora:name:s>`、異なる場合 `<lora:name:s:c>` の形式で構文を生成
|
||||
- `l.strength` フォールバックを追加し、GroupsのloraList形式(`strength` キー直接)にも対応
|
||||
|
||||
#### Mタブ Groupsの LoRAグループ → LoraManagerドロップ対応(`web/comfyui/node_sets_menu.js`)
|
||||
- `renderModelGroups` でLoRAタイプのグループリスト末尾に「All N LoRAs → Lora Loader (LoraManager)」アイテムを追加
|
||||
- ドラッグで `application/x-wfm-lora-multi` データ送出 → キャンバスに Lora Loader (LoraManager) ノードを全LoRAセット済みで配置
|
||||
- ダブルクリックでも即時配置(`placeLoraMgrNode`)
|
||||
- モデルファイル名から stem(拡張子・パス除去)に変換して LoraManager 名前形式に合わせる
|
||||
|
||||
#### Pタブ Groupsサブタブ追加(`web/comfyui/node_sets_menu.js`)
|
||||
- `state` に `promptSubTab2` と `promptGroups` を追加
|
||||
- `loadPromptData` で `localStorage["wfm_prompt_preset_groups"]` からグループを読み込み、存在しないIDをクリーンアップ
|
||||
- Pタブのrow2に「📁 Groups」サブタブを追加(Wタブ・Nタブと同様の2段構成)
|
||||
- `renderPromptGroups` 関数を実装:グループ名セクション展開・検索フィルター対応・`createDraggablePromptItem` でドラッグ動作を継承
|
||||
- Batchで作成したPromptグループが同じlocalStorageを参照するためそのままライブラリから利用可能
|
||||
|
||||
#### ヘルプ更新(`static/js/i18n.js`)
|
||||
- `helpSidepanel11`(EN/JA/ZH):PタブGroups追加・MタブLoRAグループ→LoraManagerドロップを追記
|
||||
- `helpSidepanel13`(EN/JA/ZH):Lora Loader (LoraManager) ノードタイプ対応を追記
|
||||
- `helpSidepanel15`(EN/JA/ZH):LoRA検出ノードタイプ一覧・APIフォーマット対応・LoRA構文自動入力を追記
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-08: v0.3.31 — LoRAペイン Single/Stack タブ分割・GenUI Model LoRA対応強化
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### LoRAペイン Single/Stack タブ分割(`static/js/comfyui-editor.js`, `static/css/main.css`)
|
||||
- `renderLoraPane` を全面書き換え。Single / Stack の2タブ構成に変更
|
||||
- **Single タブ**: フィルター・モデルドロップダウン・強度(M/C)・ターゲットノード選択・Apply・P・LORA SYNTAX表示・TRIGGER WORDS表示
|
||||
- モデル選択・強度変更時にLORA SYNTAX が自動更新
|
||||
- Apply: ワークフローノードへの適用 + LORA SYNTAX/TRIGGER WORDS を Positive プロンプトへ差分更新
|
||||
- P: Positive プロンプトをワークフローに反映
|
||||
- **Stack タブ**: ターゲットノード選択・Apply・P・Toggle-all・グローバル強度調整(+/−)・LORA SYNTAX・TRIGGER WORDS・モデルリスト
|
||||
- 検索フィルターとモデルドロップダウンを削除(Stack専用UIに整理)
|
||||
- `_refreshLoraSingleDynamic(metadata, civitaiCache)` 関数を追加(Single タブの動的更新)
|
||||
- `comfyEditor.switchLoraSingleTab()` メソッドを追加(外部からSingleタブへ切り替え)
|
||||
- `comfyEditor.disableAllStack()` メソッドを追加(外部からStack全無効化)
|
||||
|
||||
#### GenUI Model LoRA対応強化(`static/js/models-tab.js`)
|
||||
- `Lora Loader (LoraManager)` ノード対応: `lora_name` 検索ではなく `currentAnalysis.lora_nodes` を参照し `is_lora_manager` で書き込み形式を分岐
|
||||
- LoRA適用時: Singleタブへ切り替え・Stack全無効化・`wfm-lora-single-syntax`/`wfm-lora-single-triggers` を更新
|
||||
- Positive promptへの直接書き込みを廃止(Apply/Pボタンで明示的に反映する設計に統一)
|
||||
|
||||
#### ヘルプ更新(`static/js/i18n.js`)
|
||||
- `helpGen5`: LoRA に「(Single/Stack タブ)」の説明を追加(EN/JA/ZH)
|
||||
- `helpModels8`: GenUI Model LoRA 動作の詳細を追記(EN/JA/ZH)
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-08: v0.3.30 — LoRAスタック トリガーワードバグ修正・ヘルプ更新
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### LoRAスタック TRIGGER WORDS 表示バグ修正(`static/js/comfyui-editor.js`)
|
||||
- **問題**: スタックで1つのモデルを無効にしてもTRIGGER WORDSに無効モデルのトリガーワードが残っていた
|
||||
- **原因1**: 初期表示の `triggerHtml` が `allTriggerWords`(全モデル分)を使っていた → `activeTriggerWords` に修正
|
||||
- **原因2**: チェックボックス切り替え・toggle-all・強度調整時に呼ばれる `_refreshLoraPaneDynamic` がLORA SYNTAXのみ更新してTRIGGER WORDSを更新していなかった
|
||||
- **修正**: `_refreshLoraPaneDynamic(stackModels, metadata, civitaiCache)` でTRIGGER WORDSも再計算・再描画するよう拡張(アクティブモデルのみ表示)
|
||||
|
||||
#### ヘルプ トラブルシューティング追加(`templates/index.html`, `static/js/i18n.js`, `static/js/app.js`)
|
||||
- LoRAスタック実行時に「No such file or directory」エラーが出る場合のトラブルシューティングを追記
|
||||
- 原因: comfyui-lora-managerが該当LoRAを認識していない(既知の問題)
|
||||
- 対処: 別のLoRAで試す、またはLora Manager自体のUIでファイルが表示されるか確認
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-08: v0.3.29 — LoRAセクション統合・ヘルプタブサイドバー・UI細部改善
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### LoRAセクション統合(`static/js/comfyui-editor.js`, `static/css/main.css`)
|
||||
- 単体LoRAセクションとStackセクションを1つの統合レイアウトに統合(重複を削除)
|
||||
- 表示順: Filter → Model select → ID行(ID select / Apply / P) → Strength行(Stack label / ☑ / M / C / Str M adjuster / C adjuster) → Lora syntax → Trigger words → Stack model一覧
|
||||
- **Apply ボタン統合**: 単体・スタック共通の1ボタンに
|
||||
- スタックモデルあり → 全アクティブモデルをノードに適用 + プロンプト同期
|
||||
- スタックモデルなし → 選択中の単体LoRAをM/C強度でノードに適用 + プロンプト同期
|
||||
- **単体モードのプロンプト同期対応**: スタックなし時も `<lora:stem:M:C>` syntax とCivitAIトリガーワードをPositiveプロンプトへ追記・差分更新
|
||||
- **Ctrl+Apply → 通常Apply に変更**: 以前のCtrl限定操作を通常クリックに変更(デフォルト動作)
|
||||
- **P ボタン追加**: Apply右隣に配置。InputタブのPositiveプロンプト内容をワークフローへ即時反映(プロンプトタブに切り替える手間を省略)
|
||||
- **IDドロップダウン幅調整**: `flex:1` で利用可能な幅いっぱいに広げ、max-width制限を撤廃
|
||||
- **"Stack"ラベルの位置変更**: ID行から削除し、Strength行左端(チェックボックス横)に移動
|
||||
- **Stack toggle-all チェックボックスの移動**: ヘッダー行からStrength行左端に移動
|
||||
- 個別モデル行のチェックボックス列と視覚的に揃い、全体ON/OFFの役割が明確に
|
||||
- **M/C入力幅修正**: 54px → 60px に拡大(スピナーボタン分の余裕を確保し数値が切れる問題を修正)
|
||||
- **Str M / C ラベルの位置変更**: 別ヘッダー行から All 調整行(Strength行)に統合
|
||||
- **All調整行をグリッドレイアウトに変更**: 個別モデル行と同じ `grid-template-columns` で右揃えに
|
||||
|
||||
#### Modelsタブ — モデル選択時のデフォルトタブ変更(`static/js/models-tab.js`)
|
||||
- サイドパネルのデフォルト表示タブを「Info」から「CivitAI」に変更
|
||||
- モデル選択のたびにCivitAI情報が即座に表示される
|
||||
|
||||
#### ヘルプタブ — 左サイドバー化(`templates/index.html`, `static/js/app.js`, `static/css/main.css`)
|
||||
- 1カラムスクロールから「左サイドバー(170px) + 右コンテンツペイン」の2カラムレイアウトに変更
|
||||
- サイドバーに14項目のナビゲーションボタンを配置、選択中項目をハイライト(左ボーダー + プライマリカラー)
|
||||
- Supportを最下部に固定表示(`border-top` セパレーター付き)
|
||||
- 各項目クリックで右ペインのコンテンツを切り替え(`.wfm-help-page.active` の付け替え)
|
||||
- `initHelpTab()` を `app.js` の `DOMContentLoaded` に追加
|
||||
|
||||
#### ヘルプコンテンツ更新(`templates/index.html`)
|
||||
- **GenerateUI Tab (gen-2)**: Reset Workflowボタンの説明を追加
|
||||
- **GenerateUI Tab (gen-4)**: InputタブのPrompt/Imageタブ化・テキストボックス高さ2倍の説明に更新
|
||||
- **GenerateUI Tab (gen-5)**: LoRA Stack ApplyによるLoRA Syntax + Trigger Words同期の説明を追加
|
||||
- **Feeder subtab (feeder-4)**: (root)フォルダ自動選択の説明を追加
|
||||
- **Feeder subtab (feeder-6)**: PREVIEWペインが右端固定・RUN中に現在画像表示の説明に更新
|
||||
- **Models Tab (models-4)**: CivitAIタブがデフォルト表示になった旨を追記
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-08: 生成UIタブ 複数改善 — LoRA Stackトリガーワード連携・Reset Workflowボタン・Inputタブタブ化
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### LoRA Stack Ctrl+Apply — トリガーワード追加 + 再適用時の差分更新(`static/js/comfyui-editor.js`)
|
||||
- Ctrl+Apply 時に LORA SYNTAX に続いてアクティブモデルのトリガーワードをプロンプトへ追加
|
||||
- 追加形式:`既存プロンプト, <lora:...>, triggerA, triggerB`
|
||||
- `activeTriggerWords`(アクティブのみ)と `allTriggerWords`(UI表示用・全モデル)を分離
|
||||
- 非アクティブモデルの lora syntax は除外済みだったが、トリガーワードも同様に除外
|
||||
- 再 Ctrl+Apply 時はプロンプトを差分更新(全スタック分を除去 → アクティブ分を再追加)
|
||||
- `<lora:stem:...>` トークンを stem 単位で正規表現除去
|
||||
- 全スタックモデルのトリガーワードをカンマ分割で除去してから再追加
|
||||
|
||||
#### Reset Workflow ボタン(`templates/index.html`, `static/js/generate-tab.js`)
|
||||
- 上部ツールバーの「Refresh Models」右隣に「Reset Workflow」ボタンを追加
|
||||
- 現在読み込まれているファイル(`.json`)を `/api/wfm/workflows/raw` から再取得して再ロード
|
||||
- `loadWorkflowIntoEditor` でファイル名を `data-filename` 属性に保存し Reset 時に参照
|
||||
- ファイルベースでない場合(Raw JSON貼り付け等)は警告トーストを表示
|
||||
|
||||
#### Inputタブ — Prompt/Image タブ化 + テキストボックス高さ2倍
|
||||
**タブ化**(`templates/index.html`, `static/js/generate-tab.js`, `static/css/main.css`)
|
||||
- Prompt と Image を上下スタックから「Prompt | Image」の内部タブ構成に変更
|
||||
- `.wfm-input-inner-tabnav` / `.wfm-input-inner-tab` / `.wfm-input-inner-panel` を新規追加
|
||||
- アクティブタブにはアンダーライン強調スタイルを適用
|
||||
|
||||
**テキストボックス高さ2倍**(`static/js/comfyui-editor.js`)
|
||||
- Positive Prompt: `rows="4"` → `rows="8"`
|
||||
- Negative Prompt: `rows="3"` → `rows="6"`
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-08: Feederタブ UI改善 — (root)自動選択・PREVIEWペイン右移動・RUN中プレビュー反映
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### (root)フォルダの自動選択(`static/js/feeder-tab.js`)
|
||||
- `initFeederTab()` 末尾に `_selectDir("")` を追加
|
||||
- タブを開いた初期状態で (root) がハイライトされ、画像一覧が即座に表示される
|
||||
|
||||
#### PREVIEWペインをレイアウト最右に移動(`templates/index.html`)
|
||||
- `wfm-feeder-preview-pane` を `wfm-feeder-library-body`(内側 flex row)から
|
||||
`wfm-feeder-layout`(外側 flex row)の直接子に移動
|
||||
- IMAGES グリッドが横幅を最大限確保できるようになった
|
||||
- レイアウト構造:`Settings (220px) | Library (flex:1) | Preview (160px)`
|
||||
|
||||
#### RUN中のプレビュー自動更新(`static/js/feeder-tab.js`)
|
||||
- `_startRun()` 内の `_syncHandler` で `thumbnail_path` 受信時に `_showPreview()` を呼び出し
|
||||
- ノード実行完了のたびに処理中の画像サムネイル・ファイル名・解像度がPREVIEWペインに反映される
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-07: v0.3.28 — Batchタブ Sampler/Scheduler対応 + Modelsサムネイルバグ修正
|
||||
|
||||
### 概要
|
||||
|
||||
GenerateUI の Batch タブにサンプラー・スケジューラーのバッチ処理を追加。
|
||||
また Models タブでサムネイル変更後に画像が更新されなかった問題を修正した。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### Modelsタブ サムネイル変更バグ修正
|
||||
|
||||
**原因1: ブラウザキャッシュ**(`py/routes/models_routes.py`)
|
||||
- `handle_get_preview` の `Cache-Control` を `public, max-age=3600` → `no-cache` に変更
|
||||
- モーダルを閉じて再度開いた際、ブラウザが1時間キャッシュした古い画像を返し続けていた
|
||||
|
||||
**原因2: 破損ファイルの検出なし**(`py/services/models_service.py`)
|
||||
- `find_preview_image` でファイルサイズが 100バイト未満のファイルをスキップするよう変更
|
||||
- 0バイトや極小の破損プレビューファイルが返されてカードが黒く表示される問題を解消
|
||||
|
||||
**原因3: disabledモデルの非対応**(`py/routes/models_routes.py`)
|
||||
- `handle_change_preview` でモデルファイルを検索する際、`.disabled` 拡張子付きファイルも候補に追加
|
||||
- 無効化済みモデルのサムネイル変更が「Model file not found」エラーになっていた
|
||||
|
||||
#### GenerateUI Batchタブ Sampler/Scheduler対応
|
||||
|
||||
**左ペインのタブ化**(`templates/index.html`, `static/js/generate-tab.js`, `static/css/main.css`)
|
||||
- 左ペインを Checkpoints / Sampler / Scheduler の3タブ構成に変更
|
||||
- Sampler・Scheduler タブには KSampler ノードから取得したリストをチェックボックスで表示
|
||||
- 各リストは Checkpoint と同様の `(root)` グループ行(全選択チェックボックス + 折りたたみ)で構成
|
||||
- All/None ツールバーボタンも各タブに配置
|
||||
|
||||
**BATCH QUEUE 拡張**(`templates/index.html`)
|
||||
- Sampler 列・Scheduler 列を追加し合計6列(Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler)
|
||||
- `.wfm-batch-right` の最小幅を 320px → 380px に拡張
|
||||
|
||||
**バッチ処理ロジック追加**(`static/js/generate-tab.js`)
|
||||
- `_batchGroupState` に `_samplerSelected`・`_schedulerSelected`(Set)を追加
|
||||
- `_buildSimpleGroupList()` 共通関数を新規追加(Sampler・Scheduler リストの (root) グループ描画)
|
||||
- `_renderBatchPreview()` に Sampler・Scheduler 列を追加
|
||||
- `_runBatchGenerate()` に `case "sampler"` / `case "scheduler"` を追加
|
||||
- ワークフロー内の全 `sampler_nodes` の `sampler_name` / `scheduler` を差し替えて順次生成
|
||||
- モデルリフレッシュ時に Sampler・Scheduler リストも再描画
|
||||
|
||||
#### ヘルプ更新(3言語)
|
||||
|
||||
- `helpGen11`〜`helpGen14` を Sampler/Scheduler 対応後の内容に更新(英/日/中)
|
||||
- `helpGen15` を新規追加(Sampler/Scheduler バッチの操作説明)
|
||||
- `helpModels6` を更新(サムネイル変更の詳細:即時反映・破損ファイル自動スキップ)
|
||||
- `app.js` に `wfm-help-gen-15` のマッピングを追加
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-07: v0.3.27 — model-and-prompt-from-metadata カスタムノード対応 + README修正
|
||||
|
||||
### 概要
|
||||
|
||||
`model-and-prompt-from-metadata` カスタムノードパックの全ノードをワークフロー解析に対応。
|
||||
また README の LoraManager リポジトリリンクの誤記を修正した。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### ワークフロー解析対応(`comfyui-workflow.js`)
|
||||
|
||||
| ノード表示名 | クラス名 | 検出区分 |
|
||||
|---|---|---|
|
||||
| CLIP Text Encode edit+ | `CLIPTextEncodeEditPlus` | prompt_nodes |
|
||||
| Model from Metadata | `ImageMetadataCheckpointLoader` | 既存 `CheckpointLoader` 判定で検出済み |
|
||||
| Model-Prompt from Metadata | `ImageMetadataPromptLoader` | checkpoint_nodes + prompt_nodes(両方) |
|
||||
| LoRA from Metadata | `ImageMetadataLoRALoader` | lora_nodes(3スロット) |
|
||||
|
||||
**`CLIPTextEncodeEditPlus`**
|
||||
- `text1` は `forceInput`(常にリンク接続)のため直接読み取り不可
|
||||
- ローカル上書きテキスト `text_edit` を編集ターゲット(`textKey: "text_edit"`)として prompt_nodes に登録
|
||||
|
||||
**`ImageMetadataPromptLoader`**
|
||||
- 単一ノードが checkpoint + positive/negative プロンプトを兼ねる構造
|
||||
- `checkpoint_nodes` に `ckpt_name` で登録
|
||||
- `positive_text` を role `"positive"`、`negative_text` を role `"negative"` として prompt_nodes に登録
|
||||
- ロールはハードコード(sampler → CONDITIONING のスロット番号で両方参照される可能性があるため `getRole()` に依存しない)
|
||||
|
||||
**`ImageMetadataLoRALoader`**
|
||||
- `lora_1`〜`lora_3` を順にチェックし、`"None"` 以外のスロットを lora_nodes に登録
|
||||
- 各スロットの `strength_model_N` / `strength_clip_N` も合わせて取得
|
||||
|
||||
**`_getWidgetMapping` 静的フォールバック追加**
|
||||
- `object_info` 取得失敗時の UI→API 変換用マッピングに上記4ノードを追加
|
||||
|
||||
#### README 修正(`README.md`)
|
||||
|
||||
- LoraManager リポジトリ URL の誤記を修正
|
||||
- 誤: `https://github.com/willchil/ComfyUI-Lora-Manager`
|
||||
- 正: `https://github.com/willmiao/ComfyUI-Lora-Manager`
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-07: v0.3.26 — Stack LORA SYNTAX 表示修正 + 全体強度調整 UI
|
||||
|
||||
### 概要
|
||||
|
||||
Stack ペインの LORA SYNTAX が空表示になるバグを修正し、全モデルの強度を一括増減できる調整ボックスを追加した。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### LORA SYNTAX 空表示バグ修正(`comfyui-editor.js`)
|
||||
|
||||
- **原因**: `<lora:name:str>` 構文を `el.innerHTML` テンプレートリテラルに埋め込んでいたため、
|
||||
ブラウザが `<lora:...>` を未知の HTML タグとして解析し、本文が消えていた。
|
||||
`, ` 区切り文字のみが残って表示される症状だった。
|
||||
- **修正**: `el.innerHTML` 代入直後に `getElementById("wfm-lora-stack-syntax").textContent` で
|
||||
テキストとして上書きするよう変更。`_refreshLoraPaneDynamic` は既に `textContent` を使用しており問題なし。
|
||||
|
||||
#### 全体強度調整ボックス追加(`comfyui-editor.js`, `main.css`)
|
||||
|
||||
- Stack モデル一覧ヘッダーの直下に `All` 調整行を追加
|
||||
- `M`・`C` それぞれに `[−][step][+]` コントロールを配置
|
||||
- `+` / `−` ボタン: step 入力欄の値(デフォルト 0.05)を全モデルの強度に加減算
|
||||
- step 入力欄は直接編集可能(min: 0.01、max: 2.0)
|
||||
- 有効・無効状態に関わらず全モデルの強度値を更新(無効モデルの保持値も変更)
|
||||
- 調整後は各行の入力欄と LORA SYNTAX 表示を自動更新
|
||||
- `.wfm-lora-stack-global-adj` / `.wfm-lora-stack-global-adj-group` / `.wfm-lora-stack-adj-step` / `.wfm-btn-xs` CSS を追加
|
||||
|
||||
#### 強度入力欄の表示切れ修正(`main.css`, `comfyui-editor.js`)
|
||||
|
||||
- **原因**: `.wfm-input` の `padding: 8px 12px` が大きすぎ、56px 幅にスピナーと合わせて
|
||||
数値が収まらず右端が切れていた。
|
||||
- CSS グリッド列幅を `56px → 64px` に拡大(ヘッダー・入力欄とも)
|
||||
- `.wfm-lora-stack-strengths input[type="number"]` に `padding: 4px 4px; text-align: center` を適用
|
||||
- WebKit / Firefox スピナーボタンを非表示化
|
||||
(グローバル調整の `+/−` ボタンで代替できるため、個別スピナーは不要と判断)
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-07: v0.3.25 — Lora Loader (LoraManager) 対応 + Stack 有効無効切り替え
|
||||
|
||||
### 概要
|
||||
|
||||
生成UI の Lora ペインを `Lora Loader (LoraManager)` ノードに対応。
|
||||
ワークフロー解析・単体適用・Stack 適用・バッチ生成の全経路で LoraManager 専用フォーマット
|
||||
(`inputs.loras.__value__` 配列 + `inputs.text` 構文)への書き込みに対応した。
|
||||
また Stack の各モデルと Stack 全体の有効 / 無効を切り替えるチェックボックス UI を追加。
|
||||
Model サブタブを開くたびに LoRA ペインを再描画することで、
|
||||
Models タブでの Stack グループ更新が即座に反映されるようにした。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### 生成UI Model タブ — 左右ペイン等幅化(`main.css`)
|
||||
|
||||
- `wfm-gen-params-col--narrow` を `flex: none; width: 220px;` から `flex: 1;` に変更
|
||||
- 左ペイン(Checkpoint / VAE 等)と中央ペイン(LoRA)が均等幅になった
|
||||
|
||||
#### `Lora Loader (LoraManager)` ノード対応
|
||||
|
||||
**ワークフロー解析 (`comfyui-workflow.js`)**
|
||||
- `analyzeWorkflow()` に `Lora Loader (LoraManager)` 検出ブロックを追加
|
||||
- `lora_nodes` に `{ id, type, title, is_lora_manager: true }` として登録
|
||||
|
||||
**ヘルパー関数追加 (`comfyui-editor.js`)**
|
||||
- `_buildLoraManagerSyntax(stackModels)` — `<lora:name:strM:strC>` 形式(スペース区切り)
|
||||
- `_applyLoraToNode(nodeId, loraPath, strModel, strClip, isLoraManager)` — ノード種別に応じた書き込み
|
||||
- LoraManager: `inputs.loras.__value__` + `inputs.text` を更新
|
||||
- 標準 LoraLoader: `inputs.lora_name` / `strength_model` / `strength_clip` を更新
|
||||
|
||||
**単体 Apply (`comfyui-editor.js`)**
|
||||
- Apply ボタンが `is_lora_manager` フラグを確認し、LoraManager 形式で書き込み
|
||||
|
||||
**Stack Apply (`comfyui-editor.js`)**
|
||||
- LoraManager ターゲット: Stack の全モデルを `__value__` 配列に一括適用
|
||||
- 無効モデルは `active: false` で配列に保持(データを削除しない)
|
||||
- 標準 LoraLoader ターゲット: 従来通り先頭モデルのみ適用
|
||||
|
||||
**バッチ生成 (`generate-tab.js`)**
|
||||
- "lora" バッチケースで `is_lora_manager` を確認
|
||||
- LoraManager ノードには `inputs.loras.__value__` + `inputs.text` を書き込み
|
||||
- 標準 LoraLoader ノードは従来通り `inputs.lora_name` を書き込み
|
||||
|
||||
#### Stack 有効 / 無効切り替え UI (`comfyui-editor.js`, `main.css`)
|
||||
|
||||
- モジュールレベルに `_stackActive` 状態(`{ modelPath: boolean }`)を追加
|
||||
- `_syncStackToggleAll(stackModels)` — Toggle All チェックボックスの checked / indeterminate 状態を同期
|
||||
- `_buildLoraSyntax` / `_buildLoraManagerSyntax` — 無効モデルをフィルタリングして構文を生成
|
||||
- **Toggle All チェックボックス** — Stack ヘッダー左端に追加(全ON / 全OFF / 中間状態に対応)
|
||||
- **モデルごとのチェックボックス** — 各 Stack モデル行の左端に追加
|
||||
- 無効時: モデル名に取り消し線 + 透過(opacity 0.4)、入力欄も透過 + `disabled`
|
||||
- Stack Apply 時: 無効モデルを `active: false` で `__value__` に保持(LoraManager がスキップ)
|
||||
- CSS グリッド更新:
|
||||
- `.wfm-lora-stack-models-header`: `1fr 56px 56px` → `16px 1fr 56px 56px`
|
||||
- `.wfm-lora-stack-model-row`: `1fr auto` → `16px 1fr auto`
|
||||
- `.wfm-lora-stack-model-row--off` スタイルを追加
|
||||
|
||||
#### Stack の自動適用 (`comfyui-editor.js`, `generate-tab.js`)
|
||||
|
||||
- `stackTargetOpts` を新設: Stack ターゲットのドロップダウンが LoraManager ノードを優先的に selected
|
||||
- `renderLoraPane` 末尾で自動適用: LoraManager がターゲットかつ Stack にモデルがある場合、
|
||||
ワークフロー読み込み時に自動で `inputs.loras` / `inputs.text` を更新
|
||||
- Model サブタブをクリックするたびに `renderLoraPane` を再実行
|
||||
→ Models タブで Stack グループを更新した後、すぐに GenerateUI に反映
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-06: v0.3.24 — Lora Stack 登録機能 + 生成UI Model タブ 3ペイン化
|
||||
|
||||
### 概要
|
||||
|
||||
Models タブに Lora 専用の Stack グループ登録機能を追加。
|
||||
生成UI の Model タブを 3ペイン(モデル選択 / Lora 専用 / RAW JSON)に分割し、
|
||||
Lora ペインに単体適用セクションと Stack セクション(構文自動生成・トリガーワード表示・強度設定)を実装。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### Models タブ — Batch B ボタンの Lora/Checkpoint 限定表示(`models-tab.js`)
|
||||
|
||||
- サムネイルビュー・テーブルビューともに、`showBatchBtn` フラグを導入し
|
||||
Checkpoint・Lora 以外のモデルタイプでは B ボタン/B 列を非表示に変更
|
||||
- イベントリスナーを `?.addEventListener` でヌルセーフ化
|
||||
|
||||
#### Models タブ — Stack グループ登録機能(`models-tab.js`, `index.html`, `main.css`)
|
||||
|
||||
- `RESERVED_GROUPS` に `"Stack"` を追加(削除不可)
|
||||
- `STACK_MODEL_TYPES = ["lora"]` 定数を追加
|
||||
- Lora タイプ読み込み時に `Stack` グループを自動初期化(2箇所)
|
||||
- `isInStack` / `toggleStack` / `clearStackGroup` 関数を追加
|
||||
- **サムネイルビュー**: Lora のみ左下に `S` オーバーレイボタン追加(active 時は緑色 `#60d0a0`)
|
||||
- **テーブルビュー**: B 列の右に S 列を追加(ヘッダー含む)
|
||||
- **SC ボタン**: ツールバーの BC ボタン右隣に Stack Clear ボタンを追加
|
||||
- セレクトモード時の click 除外対象に `.wfm-stack-btn` を追加
|
||||
|
||||
#### 生成UI Model タブ — 3ペイン化(`index.html`, `main.css`, `comfyui-editor.js`)
|
||||
|
||||
- Model タブの `wfm-gen-tab-cols` を 3列構成に変更
|
||||
- 左ペイン: `wfm-gen-params-col--narrow`(`width: 220px` 固定)— Checkpoint / VAE 等
|
||||
- 中央ペイン: `wfm-gen-lora-col`(`flex: 1`)— Lora 専用
|
||||
- 右ペイン: RAW JSON(変更なし)
|
||||
- `renderModelTab` から LoRA セクションを削除
|
||||
- `renderAll` に `renderLoraPane` 呼び出しを追加
|
||||
|
||||
#### 生成UI Lora ペイン(`comfyui-editor.js`, `main.css`)
|
||||
|
||||
**単体セクション(上部)**
|
||||
- フィルター入力 / モデルセレクト / ノード ID + Apply ボタン / Strength M・C
|
||||
|
||||
**Stack セクション(下部)**
|
||||
- Stack ラベル + ノード ID セレクト + Apply ボタン
|
||||
- 通常クリック: 選択ノードに Stack 先頭 Lora を適用
|
||||
- **Ctrl+クリック**: Input タブ Positive プロンプト末尾に Lora 構文をカンマ区切りで追加し、ワークフローにも反映
|
||||
- **Lora 構文表示**: `<lora:stem:strength>` 形式を自動生成(Strength 変更でリアルタイム更新)
|
||||
- **トリガーワード表示**: Stack 登録モデルの CivitAI `trainedWords` を一括表示
|
||||
- **モデルリスト**: Stack 登録 Lora を行単位で表示、各行に Strength M / C 入力
|
||||
- モジュールレベルの `_stackStrengths`(強度状態)、`_loraBasename`、`_buildLoraSyntax`、`_refreshLoraPaneDynamic` を追加
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-05: v0.3.23 — バグ修正2件
|
||||
|
||||
### バグ修正
|
||||
|
||||
**ワークフローバッチ 404 エラー修正(`generate-tab.js`)**
|
||||
- `_runBatchGenerate()` の workflow ケースで、ワークフローファイル取得 URL が
|
||||
`/api/wfm/workflows/{filename}`(存在しないルート)になっていた
|
||||
- 正しいエンドポイント `/api/wfm/workflows/raw?filename={filename}` に修正
|
||||
|
||||
**ワークフローリネーム二重送信バグ修正(`workflow-tab.js`)**
|
||||
- モーダルを開くたびに `titleInput.addEventListener("blur", commitRename)` が累積していた
|
||||
- 2回目以降のリネーム時に blur が複数発火し、同一ファイルへのリネームリクエストが
|
||||
2本送られて 1本目成功後に 2本目が 409 または 404 になっていた
|
||||
- `titleInput._commitRename` で前回のリスナー参照を保持し、
|
||||
再オープン時に `removeEventListener` で除去してから登録するよう修正
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-05: v0.3.22 — カードビュー廃止 + Batch タイプ切り替え UI + 4タイプバッチ生成
|
||||
|
||||
### 概要
|
||||
|
||||
WorkflowタブとModelsタブのカードビューを廃止(サムネイル/テーブルの2択に統一)。
|
||||
生成UIタブのBatch機能を4タイプ(Checkpoint/Lora/Prompt/Workflow)のいずれかを有効化する
|
||||
ラジオ選択型に拡張し、バッチ実行ループも全タイプ対応。
|
||||
|
||||
**カードビュー廃止(Workflow・Models タブ)**
|
||||
- ビュー切り替えボタンから Card(☰)を削除(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キー・フィールド拡充)
|
||||
|
||||
### 概要
|
||||
|
||||
@@ -5,7 +5,7 @@ A comprehensive workflow management and generation UI plugin for [ComfyUI](https
|
||||
Browse, organize, and execute workflows directly from a dedicated studio interface — without switching between windows or manually editing JSON.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -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
|
||||
- **Side panel tabs** — opens to CivitAI tab by default when a model is selected; Info (file path display with click-to-copy, tags, memo), Groups management, CivitAI integration
|
||||
- **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)
|
||||
@@ -169,12 +172,12 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
|
||||
- **N — Nodes tab** — browse favorite nodes (All / ★ Favorites / Groups / Sets / 📂 Category / 🧩 Package sub-tabs), ★ star shown for favorites in All view
|
||||
- **Category sub-tab** — dropdown to filter nodes by top-level category
|
||||
- **Package sub-tab** — dropdown to filter nodes by custom node package name
|
||||
- **M — Models tab** — browse installed models (All / ★ Favorites / Groups / By Type sub-tabs)
|
||||
- **P — Prompts tab** — browse prompt presets with All / Favorites / Categories sub-tabs
|
||||
- **I — Information tab** — drop a ComfyUI-generated PNG/WebP or workflow JSON in the side panel to view its metadata; supports `UnetLoaderGGUF` and `QuadrupleCLIPLoader` node types; preview area fixed at 110px
|
||||
- **M — Models tab** — browse installed models (All / ★ Favorites / Groups / By Type sub-tabs); LoRA groups show an **All N LoRAs** item — drag to canvas to place a `Lora Loader (LoraManager)` node with all LoRAs pre-loaded
|
||||
- **P — Prompts tab** — browse prompt presets with All / ★ Favorites / Categories sub-tabs; **Groups sub-tab** (row 2) — view presets by group (shared with the Batch tab's `wfm_prompt_preset_groups`)
|
||||
- **I — Information tab** — drop a ComfyUI-generated PNG/WebP or workflow JSON in the side panel to view its metadata; detects LoRAs from `LoraLoader`, `LoraLoaderModelOnly`, and `Lora Loader (LoraManager)` nodes (API format supported); supports `UnetLoaderGGUF` and `QuadrupleCLIPLoader` node types; preview area fixed at 110px
|
||||
- **A — AI TOOL tab** — 3-pane layout (Translation | TOOLS | Settings) always visible; Translation and TOOLS (VLM) powered by Ollama or LM Studio; settings (backend, URL, model) shared with the SPA AI TOOL tab via `localStorage`
|
||||
- **model sub-tab** — Checkpoint, VAE, Diffusion Model, and Text Encoder; drag items to canvas to place the corresponding loader node (Checkpoint → `CheckpointLoaderSimple`, VAE → `VAELoader`, Diffusion Model → `UNETLoader`, Text Encoder → `CLIPLoader`); double-click also places at canvas center
|
||||
- **lora sub-tab** — LoRA names with `strength_model / strength_clip` values; drag individual LoRA to place `LoraLoader`; **Multiple LORA** section (appears for 1+ LoRAs) drags all LoRAs into a single `Lora Loader (LoraManager)` node
|
||||
- **lora sub-tab** — detects LoRAs from `LoraLoader`, `LoraLoaderModelOnly`, and `Lora Loader (LoraManager)` nodes (API format `inputs.loras.__value__` supported); shows `strength_model / strength_clip` values; drag individual LoRA to place `LoraLoader`; **Multiple LORA** section (appears for 1+ LoRAs) drags all LoRAs into a single `Lora Loader (LoraManager)` node with LoRA syntax pre-filled
|
||||
- **Prompts sub-tab** — POS / NEG badge list; drag a prompt to place `CLIPTextEncode` with text pre-filled; click any entry to view full text + Copy button
|
||||
- **Drag & drop workflows** — drag a workflow onto the canvas to load it
|
||||
- **Drag & drop nodes** — drag nodes/node sets onto the canvas to place them
|
||||
@@ -185,9 +188,10 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
|
||||
- **⚙ Theme settings** — customize panel background, sub-header background, text, border, and secondary text colors; saved to localStorage and applied on every open
|
||||
|
||||
### Help & Support Tab (v0.1.3)
|
||||
- **Sidebar navigation** — 2-column layout: left sidebar (14 topics) + right content pane; click any topic to switch the displayed content
|
||||
- **Support** — fixed at the bottom of the sidebar; shows GitHub and Ko-fi links in the right pane
|
||||
- **Feature list** — overview of all features organized by tab
|
||||
- **Tips** — quick tips for drag & drop import, favorites, and default workflow
|
||||
- **Support links** — GitHub repository and Ko-fi donation page
|
||||
- **Keyboard Shortcuts** and **Troubleshooting** sections included
|
||||
|
||||
---
|
||||
|
||||
@@ -276,6 +280,62 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.3.32
|
||||
- **Lora Loader (LoraManager) LoRA detection** — I tab and Metadata tab now correctly detect LoRAs from `Lora Loader (LoraManager)` nodes in API format (`inputs.loras.__value__`); `strength`/`clipStrength` stored as strings (e.g. `"0.20"`) are now parsed correctly
|
||||
- **LoraManager node placement — LoRA syntax** — placing a `Lora Loader (LoraManager)` node via drag now also updates the `text` widget with `<lora:name:strength>` syntax (previously only the `loras` array widget was set)
|
||||
- **M tab Groups — LoRA → LoraManager drop** — LoRA groups in the Library M tab show an **All N LoRAs** item; drag to canvas places a `Lora Loader (LoraManager)` node with all group LoRAs; double-click also places at canvas center
|
||||
- **P tab — Groups sub-tab** — new Groups sub-tab (row 2) in the Library P tab; groups are read from `localStorage["wfm_prompt_preset_groups"]` (shared with Batch); expanding a group shows draggable preset items
|
||||
|
||||
### v0.3.31
|
||||
- **LoRA pane — Single/Stack tabs** — LoRA pane split into two tabs: Single (filter, model dropdown, M/C strength, target node, Apply, P, LORA SYNTAX, TRIGGER WORDS) and Stack (target node, Apply, P, Toggle-all, global strength adjuster, LORA SYNTAX, TRIGGER WORDS, model list); each tab has independent strength settings
|
||||
- **GenUI Model — LoRA improvements** — now correctly handles `Lora Loader (LoraManager)` nodes (previously failed to find the node); on apply: switches to Single tab, disables all Stack models, and updates LORA SYNTAX / TRIGGER WORDS in the Single tab panel
|
||||
|
||||
### v0.3.30
|
||||
- **LoRA Stack trigger words fix** — inactive stack models no longer show their trigger words in the Trigger words display; both initial render and per-model toggle/toggle-all now filter to active models only
|
||||
- **Help troubleshooting** — added entry for "No such file or directory" error when running LoRA Stack (comfyui-lora-manager compatibility issue)
|
||||
|
||||
### v0.3.29
|
||||
- **LoRA section unified** — single LoRA and Stack sections merged into one pane; Apply button handles both cases (stack models present → apply all active + prompt sync; no stack → apply selected single LoRA + prompt sync); Ctrl+Apply removed, now plain Apply by default
|
||||
- **LoRA prompt sync** — Apply inserts `<lora:stem:M:C>` syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by diff (removes stale tokens, re-adds active ones); works for both single LoRA and Stack
|
||||
- **P button** — placed to the right of Apply; immediately writes the current Positive prompt textarea to the target workflow node without switching tabs
|
||||
- **LoRA UI layout fixes** — "Stack" label moved from ID row to Strength row left of the toggle-all checkbox; ID dropdown expanded to `flex:1` (no max-width cap); M/C input width 54 px → 60 px to prevent value truncation
|
||||
- **Models tab — CivitAI default** — side panel opens to the CivitAI tab by default when a model is selected
|
||||
- **Help tab — sidebar navigation** — redesigned as 2-column layout: left sidebar (14 topics + Support fixed at bottom) + right content pane; content switches on click
|
||||
- **Input tab — Prompt/Image tabs + taller textboxes** — Prompt and Image split into inner tabs; Positive prompt rows 4 → 8, Negative prompt rows 3 → 6
|
||||
- **Reset Workflow button** — added to the GenerateUI toolbar; re-reads the loaded workflow file from disk and reloads the editor
|
||||
- **LoRA Stack trigger words** — CivitAI trigger words for active stack models appended to Positive prompt on Apply; diff-updated on re-apply
|
||||
- **Feeder subtab UI** — (root) folder selected automatically on tab open; PREVIEW pane moved to the far right of the layout; preview auto-updates to the current processing image during a RUN
|
||||
- **Batch tab — Sampler / Scheduler** — left pane gains Sampler and Scheduler tabs (lists fetched from ComfyUI); Batch Queue gains two new columns; batch runs each value through KSampler sequentially
|
||||
- **Lora Loader (LoraManager) support** — workflow analysis, single Apply, Stack Apply, and Batch all write `inputs.loras.__value__` array + `inputs.text` syntax for LoraManager nodes
|
||||
- **Stack enable/disable** — per-model checkbox and Toggle All checkbox; disabled models excluded from syntax/prompt; LoraManager apply preserves them as `active: false`
|
||||
- **Global strength adjuster** — `[−][step][+]` controls for Model and CLIP strength applied to all stack models at once
|
||||
- **model-and-prompt-from-metadata node support** — `CLIPTextEncodeEditPlus`, `ImageMetadataCheckpointLoader`, `ImageMetadataPromptLoader`, `ImageMetadataLoRALoader` added to workflow analysis
|
||||
- **Models thumbnail bug fixes** — preview endpoint now sends `Cache-Control: no-cache`; files under 100 bytes skipped; `.disabled` model files included in preview change lookup
|
||||
|
||||
### v0.3.23
|
||||
- **Bug fix: workflow batch 404** — `_runBatchGenerate()` workflow case was fetching `/api/wfm/workflows/{filename}` (non-existent route); corrected to `/api/wfm/workflows/raw?filename={filename}`
|
||||
- **Bug fix: rename double-submit** — `addEventListener("blur", commitRename)` was accumulating on the persistent `#wfm-modal-title-input` element each time the modal opened; subsequent renames fired the handler twice, sending two rename requests back-to-back (first succeeds, second returns 409 or 404); fixed by storing the listener reference on `titleInput._commitRename` and calling `removeEventListener` before re-registering
|
||||
|
||||
### 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
|
||||
@@ -557,6 +617,6 @@ MIT License
|
||||
|
||||
- [ComfyUI](https://github.com/comfyanonymous/ComfyUI) by comfyanonymous
|
||||
- [ComfyUI-Custom-Scripts](https://github.com/pythongosssss/ComfyUI-Custom-Scripts) by pythongosssss — Canvas snapshot and PNG workflow embedding implementation reference
|
||||
- [ComfyUI-Lora-Manager](https://github.com/willchil/ComfyUI-Lora-Manager) — Plugin architecture and UI pattern reference
|
||||
- [ComfyUI-Lora-Manager](https://github.com/willmiao/ComfyUI-Lora-Manager) — Plugin architecture and UI pattern reference
|
||||
- [Ollama](https://ollama.com/) for local LLM inference
|
||||
- [Eagle](https://eagle.cool/) for image management
|
||||
|
||||
@@ -344,7 +344,7 @@ async def handle_get_preview(request: web.Request) -> web.Response:
|
||||
return web.FileResponse(
|
||||
preview_path,
|
||||
headers={"Content-Type": content_type or "image/png",
|
||||
"Cache-Control": "public, max-age=3600"},
|
||||
"Cache-Control": "no-cache"},
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error("Error serving model preview: %s", e)
|
||||
@@ -383,7 +383,7 @@ async def handle_change_preview(request: web.Request) -> web.Response:
|
||||
if image_data is None:
|
||||
return web.json_response({"error": "file required"}, status=400)
|
||||
|
||||
# Resolve model file path
|
||||
# Resolve model file path (also check .disabled variants)
|
||||
from ..services.models_service import _get_model_dirs
|
||||
dirs = _get_model_dirs(model_type)
|
||||
model_path = None
|
||||
@@ -392,6 +392,11 @@ async def handle_change_preview(request: web.Request) -> web.Response:
|
||||
if candidate.is_file():
|
||||
model_path = candidate
|
||||
break
|
||||
# disabled モデルも対象にする
|
||||
disabled_candidate = d / (model_name + ".disabled")
|
||||
if disabled_candidate.is_file():
|
||||
model_path = disabled_candidate
|
||||
break
|
||||
|
||||
if not model_path:
|
||||
return web.json_response({"error": "Model file not found"}, status=404)
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -219,7 +219,7 @@ class ModelsService:
|
||||
|
||||
for ext in _PREVIEW_EXTENSIONS:
|
||||
preview = parent / (stem + ext)
|
||||
if preview.is_file():
|
||||
if preview.is_file() and preview.stat().st_size >= 100:
|
||||
logger.debug("Preview found: %s", preview)
|
||||
return preview
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-workflow-studio"
|
||||
description = "A comprehensive workflow management and generation UI plugin for ComfyUI. Browse, organize, and execute workflows from a dedicated studio interface."
|
||||
version = "0.3.19"
|
||||
version = "0.3.32"
|
||||
license = "MIT"
|
||||
requires-python = ">= 3.10"
|
||||
dependencies = ["jinja2"]
|
||||
|
||||
+545
-75
@@ -290,6 +290,7 @@ body {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wfm-card-thumb img {
|
||||
@@ -580,6 +581,301 @@ body {
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
/* Narrow variant for Model tab left pane */
|
||||
.wfm-gen-params-col--narrow {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Center pane: LoRA-only (Model tab) */
|
||||
.wfm-gen-lora-col {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
border-right: 1px solid var(--wfm-border);
|
||||
}
|
||||
|
||||
.wfm-gen-lora-col-header {
|
||||
padding: 8px 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--wfm-text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wfm-lora-refresh-btn {
|
||||
margin-left: auto;
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
padding: 2px 5px;
|
||||
opacity: 0.7;
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.wfm-lora-refresh-btn:hover { opacity: 1; }
|
||||
|
||||
.wfm-gen-lora-col-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* ── LoRA pane tabs ─────────────────────────────────────── */
|
||||
.wfm-lora-tab-header {
|
||||
display: flex;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
gap: 0;
|
||||
padding: 0 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wfm-lora-tab-btn {
|
||||
padding: 6px 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--wfm-text-secondary);
|
||||
background: none;
|
||||
border: none;
|
||||
border-bottom: 2px solid transparent;
|
||||
cursor: pointer;
|
||||
margin-bottom: -1px;
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
transition: color 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
.wfm-lora-tab-btn:hover { color: var(--wfm-text); }
|
||||
|
||||
.wfm-lora-tab-btn.active {
|
||||
color: var(--wfm-accent);
|
||||
border-bottom-color: var(--wfm-accent);
|
||||
}
|
||||
|
||||
.wfm-lora-tab-content {
|
||||
padding: 10px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
/* ── LoRA pane sections ──────────────────────────────────── */
|
||||
.wfm-lora-unified {
|
||||
padding: 10px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.wfm-lora-strength-combined {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
flex-wrap: wrap;
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.wfm-lora-strength-single {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-size: 12px;
|
||||
color: var(--wfm-text-secondary);
|
||||
padding-right: 10px;
|
||||
margin-right: 10px;
|
||||
border-right: 1px solid var(--wfm-border);
|
||||
}
|
||||
|
||||
.wfm-lora-strength-single input {
|
||||
width: 60px !important;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-header {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wfm-lora-p-btn {
|
||||
background: rgba(74, 158, 255, 0.12) !important;
|
||||
border-color: rgba(74, 158, 255, 0.35) !important;
|
||||
color: var(--wfm-primary) !important;
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-label {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--wfm-text-secondary);
|
||||
white-space: nowrap;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-info-block {
|
||||
background: var(--wfm-bg-secondary);
|
||||
border: 1px solid var(--wfm-border);
|
||||
border-radius: var(--wfm-radius-sm);
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-info-label {
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: var(--wfm-text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-syntax {
|
||||
font-size: 11px;
|
||||
font-family: monospace;
|
||||
color: var(--wfm-text);
|
||||
word-break: break-all;
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-triggers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.wfm-lora-trigger-word {
|
||||
font-size: 11px;
|
||||
background: rgba(74, 158, 255, 0.12);
|
||||
color: var(--wfm-primary);
|
||||
border: 1px solid rgba(74, 158, 255, 0.25);
|
||||
border-radius: 3px;
|
||||
padding: 1px 6px;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-models {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-models-header {
|
||||
display: grid;
|
||||
grid-template-columns: 16px 1fr 64px 64px;
|
||||
gap: 4px;
|
||||
padding: 0 0 4px;
|
||||
font-size: 11px;
|
||||
color: var(--wfm-text-secondary);
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
margin-bottom: 4px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-models-header span:nth-child(2) {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-model-row {
|
||||
display: grid;
|
||||
grid-template-columns: 16px 1fr auto;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
padding: 4px 0;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
}
|
||||
|
||||
.wfm-lora-stack-model-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-model-row--off .wfm-lora-stack-model-name {
|
||||
opacity: 0.4;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-model-row--off .wfm-lora-stack-strengths input {
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-model-name {
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-strengths {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-strengths input[type="number"] {
|
||||
padding: 4px 4px !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-strengths input[type="number"]::-webkit-outer-spin-button,
|
||||
.wfm-lora-stack-strengths input[type="number"]::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-strengths input[type="number"] {
|
||||
-moz-appearance: textfield;
|
||||
appearance: textfield;
|
||||
}
|
||||
|
||||
/* Global strength adjustment row */
|
||||
.wfm-lora-stack-global-adj {
|
||||
display: grid;
|
||||
grid-template-columns: 16px 1fr auto;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-global-adj-label {
|
||||
font-size: 11px;
|
||||
color: var(--wfm-text-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-global-adj-groups {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-global-adj-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-global-adj-group > span {
|
||||
font-size: 11px;
|
||||
color: var(--wfm-text-secondary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wfm-lora-stack-adj-step {
|
||||
width: 50px !important;
|
||||
padding: 2px 4px !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wfm-btn-xs {
|
||||
padding: 1px 6px;
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
min-width: 22px;
|
||||
}
|
||||
|
||||
/* Stacked sections inside params col (Input: Prompt on top, Image below) */
|
||||
.wfm-gen-params-section {
|
||||
flex: 1;
|
||||
@@ -592,6 +888,44 @@ body {
|
||||
border-top: 1px solid var(--wfm-border);
|
||||
}
|
||||
|
||||
/* Input tab inner tabs (Prompt / Image) */
|
||||
.wfm-input-inner-tabnav {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
padding: 6px 14px 0;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wfm-input-inner-tab {
|
||||
padding: 4px 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
background: none;
|
||||
border: none;
|
||||
border-bottom: 2px solid transparent;
|
||||
color: var(--wfm-text-secondary);
|
||||
cursor: pointer;
|
||||
margin-bottom: -1px;
|
||||
transition: color 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
.wfm-input-inner-tab:hover {
|
||||
color: var(--wfm-text);
|
||||
}
|
||||
|
||||
.wfm-input-inner-tab.active {
|
||||
color: var(--wfm-primary);
|
||||
border-bottom-color: var(--wfm-primary);
|
||||
}
|
||||
|
||||
.wfm-input-inner-panel {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 10px 14px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* Right sub-column: Raw JSON */
|
||||
.wfm-gen-rawjson-col {
|
||||
width: 540px;
|
||||
@@ -1045,58 +1379,77 @@ 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;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
Stack Button (Lora multi-apply)
|
||||
============================================ */
|
||||
|
||||
.wfm-stack-btn {
|
||||
position: absolute;
|
||||
bottom: 6px;
|
||||
left: 6px;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--wfm-text-secondary);
|
||||
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-stack-btn:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.wfm-stack-btn.active {
|
||||
color: #60d0a0;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.wfm-table-row .wfm-stack-btn,
|
||||
.wfm-models-table-row .wfm-stack-btn {
|
||||
position: static;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
|
||||
.wfm-tag {
|
||||
font-size: 10px;
|
||||
color: var(--wfm-primary);
|
||||
@@ -1798,6 +2151,9 @@ body {
|
||||
.wfm-pm-search {
|
||||
padding: 8px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
.wfm-pm-list {
|
||||
flex: 1;
|
||||
@@ -1866,6 +2222,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;
|
||||
@@ -2624,25 +2984,76 @@ body {
|
||||
Help & Support Tab
|
||||
============================================ */
|
||||
|
||||
.wfm-help-container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 24px 20px;
|
||||
overflow-y: auto;
|
||||
/* Help Tab — sidebar layout */
|
||||
.wfm-help-layout {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wfm-help-section {
|
||||
margin-bottom: 32px;
|
||||
.wfm-help-sidebar {
|
||||
width: 170px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: 1px solid var(--wfm-border);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wfm-help-section-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
.wfm-help-nav {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.wfm-help-nav-item {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 7px 14px;
|
||||
font-size: 12px;
|
||||
background: none;
|
||||
border: none;
|
||||
border-left: 2px solid transparent;
|
||||
color: var(--wfm-text-secondary);
|
||||
cursor: pointer;
|
||||
transition: color 0.15s, background 0.15s;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.wfm-help-nav-item:hover {
|
||||
color: var(--wfm-text);
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 2px solid var(--wfm-primary);
|
||||
background: var(--wfm-hover);
|
||||
}
|
||||
|
||||
.wfm-help-nav-item.active {
|
||||
color: var(--wfm-primary);
|
||||
background: var(--wfm-hover);
|
||||
border-left-color: var(--wfm-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.wfm-help-sidebar-support {
|
||||
border-top: 1px solid var(--wfm-border);
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.wfm-help-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 20px 24px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.wfm-help-page {
|
||||
display: none;
|
||||
max-width: 760px;
|
||||
}
|
||||
|
||||
.wfm-help-page.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wfm-help-card {
|
||||
@@ -3634,14 +4045,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 +4225,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 +4237,16 @@ body {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.wfm-table-td-batch {
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
.wfm-table-td-stack {
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
/* Disabled badge in card title */
|
||||
.wfm-badge-disabled {
|
||||
background: rgba(255, 107, 107, 0.2);
|
||||
@@ -3877,7 +4284,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 +4333,36 @@ 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.5; min-width: 380px; flex-shrink: 0; }
|
||||
.wfm-batch-left-tab-nav {
|
||||
display: flex;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wfm-batch-left-tab {
|
||||
flex: 1;
|
||||
padding: 5px 4px;
|
||||
font-size: 10px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--wfm-text-secondary);
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
margin-bottom: -1px;
|
||||
transition: color 0.15s;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.wfm-batch-left-tab:hover { color: var(--wfm-text-primary); background: var(--wfm-surface); }
|
||||
.wfm-batch-left-tab.active { color: var(--wfm-primary); border-bottom-color: var(--wfm-primary); }
|
||||
.wfm-batch-left-content {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wfm-batch-left-content.active { display: flex; }
|
||||
.wfm-batch-pane-header {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
@@ -4002,9 +4437,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;
|
||||
|
||||
+19
-1
@@ -326,7 +326,9 @@ 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-gen-15": "helpGen15",
|
||||
"wfm-help-feeder-title": "helpFeederTitle",
|
||||
"wfm-help-feeder-desc": "helpFeederDesc",
|
||||
"wfm-help-feeder-1": "helpFeeder1", "wfm-help-feeder-2": "helpFeeder2",
|
||||
@@ -344,6 +346,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",
|
||||
@@ -379,6 +383,7 @@ function applyI18nToHtml() {
|
||||
"wfm-help-trouble-title": "helpTroubleTitle",
|
||||
"wfm-help-trouble-1": "helpTrouble1", "wfm-help-trouble-2": "helpTrouble2",
|
||||
"wfm-help-trouble-3": "helpTrouble3", "wfm-help-trouble-4": "helpTrouble4",
|
||||
"wfm-help-trouble-5": "helpTrouble5",
|
||||
"wfm-help-support-title": "helpSupportTitle",
|
||||
"wfm-help-support-desc": "helpSupportDesc",
|
||||
"wfm-help-github-desc": "helpGithubDesc",
|
||||
@@ -447,10 +452,23 @@ try {
|
||||
applyJsonColors(_s.jsonColors);
|
||||
} catch {}
|
||||
|
||||
function initHelpTab() {
|
||||
document.querySelectorAll(".wfm-help-nav-item").forEach((btn) => {
|
||||
btn.addEventListener("click", () => {
|
||||
const page = btn.dataset.helpPage;
|
||||
document.querySelectorAll(".wfm-help-nav-item").forEach((b) => b.classList.remove("active"));
|
||||
btn.classList.add("active");
|
||||
document.querySelectorAll(".wfm-help-page").forEach((p) => p.classList.remove("active"));
|
||||
document.getElementById(`wfm-help-page-${page}`)?.classList.add("active");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
applyI18nToHtml();
|
||||
initTabs();
|
||||
initModal();
|
||||
initHelpTab();
|
||||
initSettingsTab(); // Settings first (applies saved URL)
|
||||
initWorkflowTab();
|
||||
initNodesTab();
|
||||
|
||||
+515
-17
@@ -5,6 +5,105 @@
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { syncJsonHighlight } from "./json-highlight.js";
|
||||
|
||||
// ── LoRA pane stack state ─────────────────────────────────
|
||||
// { modelFullPath: { m: number, c: number } }
|
||||
let _stackStrengths = {};
|
||||
// { modelFullPath: boolean } — true = active (default)
|
||||
let _stackActive = {};
|
||||
|
||||
function _loraBasename(fullPath) {
|
||||
const name = (fullPath || "").replace(/\\/g, "/").split("/").pop() || fullPath;
|
||||
return name.replace(/\.[^.]+$/, "");
|
||||
}
|
||||
|
||||
function _buildLoraSyntax(stackModels) {
|
||||
return stackModels
|
||||
.filter((m) => _stackActive[m] !== false)
|
||||
.map((m) => {
|
||||
const stem = _loraBasename(m);
|
||||
const str = (_stackStrengths[m]?.m ?? 1.0).toFixed(2).replace(/\.?0+$/, "") || "1";
|
||||
return `<lora:${stem}:${str}>`;
|
||||
})
|
||||
.join(", ");
|
||||
}
|
||||
|
||||
function _buildLoraManagerSyntax(stackModels) {
|
||||
return stackModels
|
||||
.filter((m) => _stackActive[m] !== false)
|
||||
.map((m) => {
|
||||
const stem = _loraBasename(m);
|
||||
const strM = (_stackStrengths[m]?.m ?? 1.0).toFixed(2).replace(/\.?0+$/, "") || "1";
|
||||
const strC = (_stackStrengths[m]?.c ?? 1.0).toFixed(2).replace(/\.?0+$/, "") || "1";
|
||||
return `<lora:${stem}:${strM}:${strC}>`;
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
|
||||
function _applyLoraToNode(nodeId, loraPath, strModel, strClip, isLoraManager) {
|
||||
if (isLoraManager) {
|
||||
const stem = _loraBasename(loraPath);
|
||||
comfyUI.currentWorkflow[nodeId].inputs.loras = {
|
||||
__value__: [{ name: stem, strength: strModel, active: true, expanded: false, clipStrength: strClip, locked: false }],
|
||||
};
|
||||
comfyUI.currentWorkflow[nodeId].inputs.text = `<lora:${stem}:${strModel}:${strClip}>`;
|
||||
} else {
|
||||
comfyUI.currentWorkflow[nodeId].inputs.lora_name = loraPath;
|
||||
comfyUI.currentWorkflow[nodeId].inputs.strength_model = strModel;
|
||||
comfyUI.currentWorkflow[nodeId].inputs.strength_clip = strClip;
|
||||
}
|
||||
}
|
||||
|
||||
function _refreshLoraPaneDynamic(stackModels, metadata, civitaiCache) {
|
||||
const syntaxEl = document.getElementById("wfm-lora-stack-syntax");
|
||||
if (syntaxEl) syntaxEl.textContent = _buildLoraSyntax(stackModels) || "—";
|
||||
|
||||
const triggersEl = document.getElementById("wfm-lora-stack-triggers");
|
||||
if (triggersEl && metadata && civitaiCache) {
|
||||
const activeWords = [];
|
||||
stackModels.forEach((m) => {
|
||||
if (_stackActive[m] === false) return;
|
||||
const sha = (metadata[m] || {}).sha256;
|
||||
const civInfo = sha && civitaiCache[sha];
|
||||
if (civInfo?.trainedWords?.length) activeWords.push(...civInfo.trainedWords);
|
||||
});
|
||||
triggersEl.innerHTML = activeWords.length
|
||||
? activeWords.map((w) => `<span class="wfm-lora-trigger-word">${w}</span>`).join(" ")
|
||||
: `<span style="color:var(--wfm-text-secondary);font-size:12px;">—</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
function _refreshLoraSingleDynamic(metadata, civitaiCache) {
|
||||
const modelName = document.getElementById("wfm-lora-select")?.value;
|
||||
const syntaxEl = document.getElementById("wfm-lora-single-syntax");
|
||||
const triggersEl = document.getElementById("wfm-lora-single-triggers");
|
||||
if (!modelName) {
|
||||
if (syntaxEl) syntaxEl.textContent = "—";
|
||||
if (triggersEl) triggersEl.innerHTML = `<span style="color:var(--wfm-text-secondary);font-size:12px;">—</span>`;
|
||||
return;
|
||||
}
|
||||
const stem = _loraBasename(modelName);
|
||||
const strM = parseFloat(document.getElementById("wfm-lora-str-model")?.value) || 1.0;
|
||||
const strC = parseFloat(document.getElementById("wfm-lora-str-clip")?.value) || 1.0;
|
||||
if (syntaxEl) syntaxEl.textContent = `<lora:${stem}:${strM}:${strC}>`;
|
||||
if (triggersEl) {
|
||||
const sha = (metadata[modelName] || {}).sha256;
|
||||
const civInfo = sha && civitaiCache[sha];
|
||||
const words = civInfo?.trainedWords || [];
|
||||
triggersEl.innerHTML = words.length
|
||||
? words.map(w => `<span class="wfm-lora-trigger-word">${w}</span>`).join(" ")
|
||||
: `<span style="color:var(--wfm-text-secondary);font-size:12px;">—</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
function _syncStackToggleAll(stackModels) {
|
||||
const cb = document.getElementById("wfm-lora-stack-toggle-all");
|
||||
if (!cb) return;
|
||||
const allOn = stackModels.every((m) => _stackActive[m] !== false);
|
||||
const allOff = stackModels.every((m) => _stackActive[m] === false);
|
||||
cb.checked = allOn;
|
||||
cb.indeterminate = !allOn && !allOff;
|
||||
}
|
||||
|
||||
/** Sync comfyUI.currentWorkflow to Raw JSON textarea + highlight */
|
||||
function _syncRawJson() {
|
||||
const rawTextarea = document.getElementById("wfm-gen-raw-json");
|
||||
@@ -60,6 +159,7 @@ export const comfyEditor = {
|
||||
this.renderPromptTab(analysis, "wfm-gen-prompt-fields");
|
||||
this.renderImageTab(analysis, "wfm-gen-image-fields");
|
||||
this.renderModelTab(analysis, "wfm-gen-model-fields");
|
||||
this.renderLoraPane(analysis, "wfm-gen-lora-fields"); // async, fires independently
|
||||
this.renderSettingsTab(analysis, "wfm-gen-settings-fields");
|
||||
_syncRawJson();
|
||||
},
|
||||
@@ -82,7 +182,7 @@ export const comfyEditor = {
|
||||
</select>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-prompt-pos-apply">Apply</button>
|
||||
</div>
|
||||
<textarea class="wfm-textarea" id="wfm-prompt-pos-text" rows="4">${positiveNodes[0]?.text || ""}</textarea>
|
||||
<textarea class="wfm-textarea" id="wfm-prompt-pos-text" rows="8">${positiveNodes[0]?.text || ""}</textarea>
|
||||
</div>
|
||||
<div class="wfm-form-group">
|
||||
<label>Negative Prompt</label>
|
||||
@@ -93,7 +193,7 @@ export const comfyEditor = {
|
||||
</select>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-prompt-neg-apply">Apply</button>
|
||||
</div>
|
||||
<textarea class="wfm-textarea" id="wfm-prompt-neg-text" rows="3">${negativeNodes[0]?.text || ""}</textarea>
|
||||
<textarea class="wfm-textarea" id="wfm-prompt-neg-text" rows="6">${negativeNodes[0]?.text || ""}</textarea>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -127,7 +227,6 @@ export const comfyEditor = {
|
||||
const sections = [
|
||||
{ label: "Checkpoint", key: "checkpoints", nodes: analysis.checkpoint_nodes, inputKey: "ckpt_name" },
|
||||
{ label: "VAE", key: "vaes", nodes: analysis.vae_nodes, inputKey: "vae_name" },
|
||||
{ label: "LoRA", key: "loras", nodes: analysis.lora_nodes, inputKey: "lora_name" },
|
||||
{ label: "Diffusion Model", key: "diffusionModels", nodes: analysis.diffusion_model_nodes, inputKey: "unet_name" },
|
||||
{ label: "Text Encoder", key: "textEncoders", nodes: analysis.text_encoder_nodes, inputKey: "clip_name1" },
|
||||
{ label: "ControlNet", key: "controlNets", nodes: analysis.controlnet_nodes, inputKey: "control_net_name" },
|
||||
@@ -152,13 +251,6 @@ export const comfyEditor = {
|
||||
<select class="wfm-select" id="wfm-model-${s.key}-target" style="flex:1;">${targetOpts}</select>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-model-apply" data-key="${s.key}" data-input="${s.inputKey}">Apply</button>
|
||||
</div>
|
||||
${s.key === "loras" ? `
|
||||
<div style="display:flex;gap:8px;margin-top:6px;align-items:center;">
|
||||
<label style="font-size:12px;">Strength M:</label>
|
||||
<input type="number" class="wfm-input" id="wfm-lora-str-model" value="1.0" step="0.1" min="0" max="2" style="width:70px;">
|
||||
<label style="font-size:12px;">C:</label>
|
||||
<input type="number" class="wfm-input" id="wfm-lora-str-clip" value="1.0" step="0.1" min="0" max="2" style="width:70px;">
|
||||
</div>` : ""}
|
||||
</div>
|
||||
`;
|
||||
})
|
||||
@@ -192,19 +284,394 @@ export const comfyEditor = {
|
||||
const nodeId = targetSelect.value;
|
||||
if (nodeId && comfyUI.currentWorkflow?.[nodeId]) {
|
||||
comfyUI.currentWorkflow[nodeId].inputs[inputKey] = value;
|
||||
// Apply LoRA strengths
|
||||
if (key === "loras") {
|
||||
const strModel = parseFloat(document.getElementById("wfm-lora-str-model")?.value) || 1.0;
|
||||
const strClip = parseFloat(document.getElementById("wfm-lora-str-clip")?.value) || 1.0;
|
||||
comfyUI.currentWorkflow[nodeId].inputs.strength_model = strModel;
|
||||
comfyUI.currentWorkflow[nodeId].inputs.strength_clip = strClip;
|
||||
}
|
||||
_syncRawJson();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
async renderLoraPane(analysis, containerId) {
|
||||
const el = document.getElementById(containerId);
|
||||
if (!el) return;
|
||||
|
||||
const loraNodes = analysis.lora_nodes || [];
|
||||
const loras = this.models.loras || [];
|
||||
const defaultStackTarget = (loraNodes.find((n) => n.is_lora_manager) || loraNodes[0])?.id;
|
||||
const nodeOpts = loraNodes
|
||||
.map((n) => `<option value="${n.id}">ID:${n.id} (${n.title})</option>`)
|
||||
.join("");
|
||||
const stackTargetOpts = loraNodes
|
||||
.map((n) => `<option value="${n.id}" ${String(n.id) === String(defaultStackTarget) ? "selected" : ""}>ID:${n.id} (${n.title})</option>`)
|
||||
.join("");
|
||||
const currentVal = loraNodes[0]?.lora_name || "";
|
||||
|
||||
// Fetch Stack group, metadata, CivitAI cache in parallel
|
||||
let stackModels = [];
|
||||
let metadata = {};
|
||||
let civitaiCache = {};
|
||||
try {
|
||||
const [grpRes, metaRes, civRes] = await Promise.all([
|
||||
fetch("/api/wfm/models/groups?type=lora"),
|
||||
fetch("/api/wfm/models/metadata"),
|
||||
fetch("/api/wfm/models/civitai/cache"),
|
||||
]);
|
||||
const groups = grpRes.ok ? await grpRes.json() : {};
|
||||
stackModels = groups["Stack"] || [];
|
||||
metadata = metaRes.ok ? await metaRes.json() : {};
|
||||
civitaiCache = civRes.ok ? await civRes.json() : {};
|
||||
} catch { /* ignore */ }
|
||||
|
||||
stackModels.forEach((m) => {
|
||||
if (!_stackStrengths[m]) _stackStrengths[m] = { m: 1.0, c: 1.0 };
|
||||
if (_stackActive[m] === undefined) _stackActive[m] = true;
|
||||
});
|
||||
|
||||
// Build Stack trigger words
|
||||
const activeTriggerWords = [];
|
||||
const allStackTriggers = [];
|
||||
stackModels.forEach((m) => {
|
||||
const sha = (metadata[m] || {}).sha256;
|
||||
const civInfo = sha && civitaiCache[sha];
|
||||
if (civInfo?.trainedWords?.length) {
|
||||
allStackTriggers.push(...civInfo.trainedWords);
|
||||
if (_stackActive[m] !== false) activeTriggerWords.push(...civInfo.trainedWords);
|
||||
}
|
||||
});
|
||||
const stackTriggerHtml = activeTriggerWords.length
|
||||
? activeTriggerWords.map((w) => `<span class="wfm-lora-trigger-word">${w}</span>`).join(" ")
|
||||
: `<span style="color:var(--wfm-text-secondary);font-size:12px;">—</span>`;
|
||||
const stackLoraSyntax = _buildLoraSyntax(stackModels);
|
||||
const allActive = stackModels.every((m) => _stackActive[m] !== false);
|
||||
const anyActive = stackModels.some((m) => _stackActive[m] !== false);
|
||||
|
||||
const stackModelRows = stackModels.map((m) => {
|
||||
const stem = _loraBasename(m);
|
||||
const str = _stackStrengths[m] || { m: 1.0, c: 1.0 };
|
||||
const active = _stackActive[m] !== false;
|
||||
return `
|
||||
<div class="wfm-lora-stack-model-row${active ? "" : " wfm-lora-stack-model-row--off"}" data-model="${m.replace(/"/g, """)}">
|
||||
<input type="checkbox" class="wfm-lora-stack-active-cb" ${active ? "checked" : ""} title="Enable/Disable">
|
||||
<span class="wfm-lora-stack-model-name" title="${m}">${stem}</span>
|
||||
<div class="wfm-lora-stack-strengths">
|
||||
<input type="number" class="wfm-input wfm-lora-stack-str-m" value="${str.m}" step="0.05" min="0" max="2" style="width:64px;" ${active ? "" : "disabled"}>
|
||||
<input type="number" class="wfm-input wfm-lora-stack-str-c" value="${str.c}" step="0.05" min="0" max="2" style="width:64px;" ${active ? "" : "disabled"}>
|
||||
</div>
|
||||
</div>`;
|
||||
}).join("");
|
||||
|
||||
el.innerHTML = `
|
||||
<div class="wfm-lora-tab-header">
|
||||
<button class="wfm-lora-tab-btn active" data-tab="single">Single</button>
|
||||
<button class="wfm-lora-tab-btn" data-tab="stack">Stack</button>
|
||||
</div>
|
||||
|
||||
<!-- Single tab -->
|
||||
<div class="wfm-lora-tab-content" id="wfm-lora-panel-single">
|
||||
<input type="text" class="wfm-input" id="wfm-lora-filter" placeholder="Filter...">
|
||||
<select class="wfm-select" id="wfm-lora-select">
|
||||
${loras.map((m) => `<option value="${m}" ${m === currentVal ? "selected" : ""}>${m}</option>`).join("")}
|
||||
</select>
|
||||
<div class="wfm-lora-strength-single">
|
||||
<span>M</span>
|
||||
<input type="number" class="wfm-input" id="wfm-lora-str-model" value="1.0" step="0.05" min="0" max="2">
|
||||
<span>C</span>
|
||||
<input type="number" class="wfm-input" id="wfm-lora-str-clip" value="1.0" step="0.05" min="0" max="2">
|
||||
</div>
|
||||
<div class="wfm-lora-stack-header">
|
||||
<select class="wfm-select" id="wfm-lora-single-target" style="flex:1;min-width:0;">${nodeOpts}</select>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-lora-single-apply" title="Apply LoRA to node and sync to Positive prompt">Apply</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-lora-p-btn" id="wfm-lora-single-pos-apply" title="Apply Positive prompt to workflow">P</button>
|
||||
</div>
|
||||
<div class="wfm-lora-stack-info-block">
|
||||
<div class="wfm-lora-stack-info-label">Lora syntax</div>
|
||||
<div id="wfm-lora-single-syntax" class="wfm-lora-stack-syntax">—</div>
|
||||
</div>
|
||||
<div class="wfm-lora-stack-info-block">
|
||||
<div class="wfm-lora-stack-info-label">Trigger words</div>
|
||||
<div id="wfm-lora-single-triggers" class="wfm-lora-stack-triggers"><span style="color:var(--wfm-text-secondary);font-size:12px;">—</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stack tab -->
|
||||
<div class="wfm-lora-tab-content" id="wfm-lora-panel-stack" style="display:none;">
|
||||
<div class="wfm-lora-stack-header">
|
||||
<select class="wfm-select" id="wfm-lora-stack-target" style="flex:1;min-width:0;">${stackTargetOpts}</select>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-lora-stack-apply" title="Apply Stack to node and sync to Positive prompt">Apply</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-lora-p-btn" id="wfm-lora-pos-apply" title="Apply Positive prompt to workflow">P</button>
|
||||
</div>
|
||||
<div class="wfm-lora-strength-combined">
|
||||
<span class="wfm-lora-stack-label" style="margin-right:4px;flex-shrink:0;">Stack</span>
|
||||
<input type="checkbox" id="wfm-lora-stack-toggle-all" ${allActive ? "checked" : ""} title="Toggle all stack models" style="flex-shrink:0;margin-right:8px;">
|
||||
${stackModels.length > 0 ? `
|
||||
<div class="wfm-lora-stack-global-adj-groups">
|
||||
<div class="wfm-lora-stack-global-adj-group">
|
||||
<span>Str M</span>
|
||||
<button class="wfm-btn wfm-btn-xs" id="wfm-stack-adj-m-dec">−</button>
|
||||
<input type="number" id="wfm-stack-adj-step-m" class="wfm-input wfm-lora-stack-adj-step" value="0.05" step="0.05" min="0.01" max="2.0">
|
||||
<button class="wfm-btn wfm-btn-xs" id="wfm-stack-adj-m-inc">+</button>
|
||||
</div>
|
||||
<div class="wfm-lora-stack-global-adj-group">
|
||||
<span>C</span>
|
||||
<button class="wfm-btn wfm-btn-xs" id="wfm-stack-adj-c-dec">−</button>
|
||||
<input type="number" id="wfm-stack-adj-step-c" class="wfm-input wfm-lora-stack-adj-step" value="0.05" step="0.05" min="0.01" max="2.0">
|
||||
<button class="wfm-btn wfm-btn-xs" id="wfm-stack-adj-c-inc">+</button>
|
||||
</div>
|
||||
</div>
|
||||
` : ""}
|
||||
</div>
|
||||
<div class="wfm-lora-stack-info-block">
|
||||
<div class="wfm-lora-stack-info-label">Lora syntax</div>
|
||||
<div id="wfm-lora-stack-syntax" class="wfm-lora-stack-syntax">—</div>
|
||||
</div>
|
||||
<div class="wfm-lora-stack-info-block">
|
||||
<div class="wfm-lora-stack-info-label">Trigger words</div>
|
||||
<div id="wfm-lora-stack-triggers" class="wfm-lora-stack-triggers">${stackTriggerHtml}</div>
|
||||
</div>
|
||||
<div class="wfm-lora-stack-models">
|
||||
${stackModelRows || `<p class="wfm-placeholder">No models in Stack group</p>`}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Fix: overwrite textContent to avoid HTML parsing of <lora:...> syntax
|
||||
const _synEl = document.getElementById("wfm-lora-stack-syntax");
|
||||
if (_synEl) _synEl.textContent = stackLoraSyntax || "—";
|
||||
|
||||
// ── Tab switching ────────────────────────────────────
|
||||
el.querySelectorAll(".wfm-lora-tab-btn").forEach((btn) => {
|
||||
btn.addEventListener("click", () => {
|
||||
el.querySelectorAll(".wfm-lora-tab-btn").forEach(b => b.classList.remove("active"));
|
||||
btn.classList.add("active");
|
||||
const tab = btn.dataset.tab;
|
||||
document.getElementById("wfm-lora-panel-single").style.display = tab === "single" ? "" : "none";
|
||||
document.getElementById("wfm-lora-panel-stack").style.display = tab === "stack" ? "" : "none";
|
||||
});
|
||||
});
|
||||
|
||||
// ── Single: filter ───────────────────────────────────
|
||||
document.getElementById("wfm-lora-filter")?.addEventListener("input", (e) => {
|
||||
const filter = e.target.value.toLowerCase();
|
||||
const select = document.getElementById("wfm-lora-select");
|
||||
if (!select) return;
|
||||
select.innerHTML = loras
|
||||
.filter((m) => m.toLowerCase().includes(filter))
|
||||
.map((m) => `<option value="${m}">${m}</option>`)
|
||||
.join("");
|
||||
_refreshLoraSingleDynamic(metadata, civitaiCache);
|
||||
});
|
||||
|
||||
// ── Single: update SYNTAX/TRIGGERS on model or strength change ──
|
||||
document.getElementById("wfm-lora-select")?.addEventListener("change", () => _refreshLoraSingleDynamic(metadata, civitaiCache));
|
||||
document.getElementById("wfm-lora-str-model")?.addEventListener("input", () => _refreshLoraSingleDynamic(metadata, civitaiCache));
|
||||
document.getElementById("wfm-lora-str-clip")?.addEventListener("input", () => _refreshLoraSingleDynamic(metadata, civitaiCache));
|
||||
|
||||
// ── Single: Apply button ─────────────────────────────
|
||||
document.getElementById("wfm-lora-single-apply")?.addEventListener("click", () => {
|
||||
const nodeId = document.getElementById("wfm-lora-single-target")?.value;
|
||||
const select = document.getElementById("wfm-lora-select");
|
||||
if (!nodeId || !comfyUI.currentWorkflow?.[nodeId] || !select?.value) return;
|
||||
|
||||
const node = loraNodes.find((n) => String(n.id) === String(nodeId));
|
||||
const strModel = parseFloat(document.getElementById("wfm-lora-str-model")?.value) || 1.0;
|
||||
const strClip = parseFloat(document.getElementById("wfm-lora-str-clip")?.value) || 1.0;
|
||||
_applyLoraToNode(nodeId, select.value, strModel, strClip, node?.is_lora_manager);
|
||||
_syncRawJson();
|
||||
|
||||
// Sync to Positive prompt
|
||||
const posTextarea = document.getElementById("wfm-prompt-pos-text");
|
||||
if (!posTextarea) return;
|
||||
const stem = _loraBasename(select.value);
|
||||
const loraSyntax = `<lora:${stem}:${strModel}:${strClip}>`;
|
||||
const sha = (metadata[select.value] || {}).sha256;
|
||||
const civInfo = sha && civitaiCache[sha];
|
||||
const triggerWords = civInfo?.trainedWords || [];
|
||||
|
||||
let cleaned = posTextarea.value;
|
||||
const escapedStem = stem.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
cleaned = cleaned.replace(new RegExp(`,?\\s*<lora:${escapedStem}:[^>]*>`, "gi"), "");
|
||||
if (triggerWords.length > 0) {
|
||||
const wordSet = new Set(triggerWords.map(w => w.trim().toLowerCase()));
|
||||
cleaned = cleaned.split(",").map(p => p.trim()).filter(p => p && !wordSet.has(p.toLowerCase())).join(", ");
|
||||
}
|
||||
cleaned = cleaned.replace(/,\s*$/, "").trim();
|
||||
const append = triggerWords.length > 0 ? `${loraSyntax}, ${triggerWords.join(", ")}` : loraSyntax;
|
||||
posTextarea.value = cleaned ? `${cleaned}, ${append}` : append;
|
||||
|
||||
const posNodeId = document.getElementById("wfm-prompt-pos-target")?.value;
|
||||
if (posNodeId && comfyUI.currentWorkflow?.[posNodeId]) {
|
||||
const promptNode = comfyUI.currentAnalysis?.prompt_nodes?.find(n => String(n.id) === String(posNodeId));
|
||||
comfyUI.currentWorkflow[posNodeId].inputs[promptNode?.textKey || "text"] = posTextarea.value;
|
||||
_syncRawJson();
|
||||
}
|
||||
});
|
||||
|
||||
// ── Single: P button ─────────────────────────────────
|
||||
document.getElementById("wfm-lora-single-pos-apply")?.addEventListener("click", () => {
|
||||
const nodeId = document.getElementById("wfm-prompt-pos-target")?.value;
|
||||
const text = document.getElementById("wfm-prompt-pos-text")?.value;
|
||||
if (nodeId && comfyUI.currentWorkflow?.[nodeId]) {
|
||||
const promptNode = comfyUI.currentAnalysis?.prompt_nodes?.find(n => String(n.id) === String(nodeId));
|
||||
comfyUI.currentWorkflow[nodeId].inputs[promptNode?.textKey || "text"] = text;
|
||||
_syncRawJson();
|
||||
}
|
||||
});
|
||||
|
||||
// ── Stack: per-model strength + toggle ───────────────
|
||||
el.querySelectorAll(".wfm-lora-stack-model-row").forEach((row) => {
|
||||
const modelName = row.dataset.model;
|
||||
const inputM = row.querySelector(".wfm-lora-stack-str-m");
|
||||
const inputC = row.querySelector(".wfm-lora-stack-str-c");
|
||||
const cbActive = row.querySelector(".wfm-lora-stack-active-cb");
|
||||
|
||||
const onStrChange = () => {
|
||||
_stackStrengths[modelName] = { m: parseFloat(inputM.value) || 1.0, c: parseFloat(inputC.value) || 1.0 };
|
||||
_refreshLoraPaneDynamic(stackModels, metadata, civitaiCache);
|
||||
};
|
||||
inputM?.addEventListener("input", onStrChange);
|
||||
inputC?.addEventListener("input", onStrChange);
|
||||
|
||||
cbActive?.addEventListener("change", () => {
|
||||
const on = cbActive.checked;
|
||||
_stackActive[modelName] = on;
|
||||
row.classList.toggle("wfm-lora-stack-model-row--off", !on);
|
||||
if (inputM) inputM.disabled = !on;
|
||||
if (inputC) inputC.disabled = !on;
|
||||
_syncStackToggleAll(stackModels);
|
||||
_refreshLoraPaneDynamic(stackModels, metadata, civitaiCache);
|
||||
});
|
||||
});
|
||||
|
||||
// ── Stack: toggle-all checkbox ───────────────────────
|
||||
const toggleAllCb = document.getElementById("wfm-lora-stack-toggle-all");
|
||||
if (toggleAllCb) {
|
||||
toggleAllCb.indeterminate = !allActive && anyActive;
|
||||
toggleAllCb.addEventListener("change", () => {
|
||||
const on = toggleAllCb.checked;
|
||||
stackModels.forEach((m) => { _stackActive[m] = on; });
|
||||
el.querySelectorAll(".wfm-lora-stack-model-row").forEach((row) => {
|
||||
const cb = row.querySelector(".wfm-lora-stack-active-cb");
|
||||
const inM = row.querySelector(".wfm-lora-stack-str-m");
|
||||
const inC = row.querySelector(".wfm-lora-stack-str-c");
|
||||
if (cb) cb.checked = on;
|
||||
if (inM) inM.disabled = !on;
|
||||
if (inC) inC.disabled = !on;
|
||||
row.classList.toggle("wfm-lora-stack-model-row--off", !on);
|
||||
});
|
||||
_refreshLoraPaneDynamic(stackModels, metadata, civitaiCache);
|
||||
});
|
||||
}
|
||||
|
||||
// ── Stack: global strength adjustment ────────────────
|
||||
if (stackModels.length > 0) {
|
||||
const adjApply = (key, sign) => {
|
||||
const delta = sign * (parseFloat(document.getElementById(`wfm-stack-adj-step-${key}`)?.value) || 0.05);
|
||||
stackModels.forEach((m) => {
|
||||
const str = _stackStrengths[m] || { m: 1.0, c: 1.0 };
|
||||
str[key] = Math.max(0, Math.round((str[key] + delta) * 1000) / 1000);
|
||||
_stackStrengths[m] = str;
|
||||
});
|
||||
el.querySelectorAll(".wfm-lora-stack-model-row").forEach((row) => {
|
||||
const str = _stackStrengths[row.dataset.model];
|
||||
if (!str) return;
|
||||
const inp = row.querySelector(`.wfm-lora-stack-str-${key}`);
|
||||
if (inp) inp.value = str[key];
|
||||
});
|
||||
_refreshLoraPaneDynamic(stackModels, metadata, civitaiCache);
|
||||
};
|
||||
document.getElementById("wfm-stack-adj-m-inc")?.addEventListener("click", () => adjApply("m", 1));
|
||||
document.getElementById("wfm-stack-adj-m-dec")?.addEventListener("click", () => adjApply("m", -1));
|
||||
document.getElementById("wfm-stack-adj-c-inc")?.addEventListener("click", () => adjApply("c", 1));
|
||||
document.getElementById("wfm-stack-adj-c-dec")?.addEventListener("click", () => adjApply("c", -1));
|
||||
}
|
||||
|
||||
// ── Stack: Apply button ──────────────────────────────
|
||||
document.getElementById("wfm-lora-stack-apply")?.addEventListener("click", () => {
|
||||
const nodeId = document.getElementById("wfm-lora-stack-target")?.value;
|
||||
if (!nodeId || !comfyUI.currentWorkflow?.[nodeId]) return;
|
||||
|
||||
const node = loraNodes.find((n) => String(n.id) === String(nodeId));
|
||||
if (node?.is_lora_manager) {
|
||||
const loraValue = stackModels.map((m) => {
|
||||
const stem = _loraBasename(m);
|
||||
const str = _stackStrengths[m] || { m: 1.0, c: 1.0 };
|
||||
const active = _stackActive[m] !== false;
|
||||
return { name: stem, strength: str.m, active, expanded: false, clipStrength: str.c, locked: false };
|
||||
});
|
||||
comfyUI.currentWorkflow[nodeId].inputs.loras = { __value__: loraValue };
|
||||
comfyUI.currentWorkflow[nodeId].inputs.text = _buildLoraManagerSyntax(stackModels);
|
||||
} else {
|
||||
const first = stackModels[0];
|
||||
if (first) {
|
||||
comfyUI.currentWorkflow[nodeId].inputs.lora_name = first;
|
||||
comfyUI.currentWorkflow[nodeId].inputs.strength_model = _stackStrengths[first]?.m ?? 1.0;
|
||||
comfyUI.currentWorkflow[nodeId].inputs.strength_clip = _stackStrengths[first]?.c ?? 1.0;
|
||||
}
|
||||
}
|
||||
_syncRawJson();
|
||||
|
||||
// Sync Stack LORA SYNTAX + TRIGGER WORDS to Positive prompt
|
||||
const posTextarea = document.getElementById("wfm-prompt-pos-text");
|
||||
if (!posTextarea) return;
|
||||
const effectiveSyntax = _buildLoraSyntax(stackModels);
|
||||
|
||||
let cleaned = posTextarea.value;
|
||||
for (const m of stackModels) {
|
||||
const stem = _loraBasename(m).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
cleaned = cleaned.replace(new RegExp(`,?\\s*<lora:${stem}:[^>]*>`, "gi"), "");
|
||||
}
|
||||
if (allStackTriggers.length > 0) {
|
||||
const wordSet = new Set(allStackTriggers.map(w => w.trim().toLowerCase()));
|
||||
cleaned = cleaned.split(",").map(p => p.trim()).filter(p => p && !wordSet.has(p.toLowerCase())).join(", ");
|
||||
}
|
||||
cleaned = cleaned.replace(/,\s*$/, "").trim();
|
||||
if (effectiveSyntax) {
|
||||
const append = activeTriggerWords.length > 0
|
||||
? `${effectiveSyntax}, ${activeTriggerWords.join(", ")}`
|
||||
: effectiveSyntax;
|
||||
posTextarea.value = cleaned ? `${cleaned}, ${append}` : append;
|
||||
} else {
|
||||
posTextarea.value = cleaned;
|
||||
}
|
||||
|
||||
const posNodeId = document.getElementById("wfm-prompt-pos-target")?.value;
|
||||
if (posNodeId && comfyUI.currentWorkflow?.[posNodeId]) {
|
||||
const promptNode = comfyUI.currentAnalysis?.prompt_nodes?.find(n => String(n.id) === String(posNodeId));
|
||||
comfyUI.currentWorkflow[posNodeId].inputs[promptNode?.textKey || "text"] = posTextarea.value;
|
||||
_syncRawJson();
|
||||
}
|
||||
});
|
||||
|
||||
// ── Stack: P button ──────────────────────────────────
|
||||
document.getElementById("wfm-lora-pos-apply")?.addEventListener("click", () => {
|
||||
const nodeId = document.getElementById("wfm-prompt-pos-target")?.value;
|
||||
const text = document.getElementById("wfm-prompt-pos-text")?.value;
|
||||
if (nodeId && comfyUI.currentWorkflow?.[nodeId]) {
|
||||
const promptNode = comfyUI.currentAnalysis?.prompt_nodes?.find(n => String(n.id) === String(nodeId));
|
||||
comfyUI.currentWorkflow[nodeId].inputs[promptNode?.textKey || "text"] = text;
|
||||
_syncRawJson();
|
||||
}
|
||||
});
|
||||
|
||||
// ── Auto-apply Stack to LoraManager on load ──────────
|
||||
if (defaultStackTarget && stackModels.length > 0 && comfyUI.currentWorkflow?.[defaultStackTarget]) {
|
||||
const targetNode = loraNodes.find((n) => String(n.id) === String(defaultStackTarget));
|
||||
if (targetNode?.is_lora_manager) {
|
||||
const loraValue = stackModels.map((m) => {
|
||||
const stem = _loraBasename(m);
|
||||
const str = _stackStrengths[m] || { m: 1.0, c: 1.0 };
|
||||
const active = _stackActive[m] !== false;
|
||||
return { name: stem, strength: str.m, active, expanded: false, clipStrength: str.c, locked: false };
|
||||
});
|
||||
comfyUI.currentWorkflow[defaultStackTarget].inputs.loras = { __value__: loraValue };
|
||||
comfyUI.currentWorkflow[defaultStackTarget].inputs.text = _buildLoraManagerSyntax(stackModels);
|
||||
_syncRawJson();
|
||||
}
|
||||
}
|
||||
|
||||
// Initial single tab display
|
||||
_refreshLoraSingleDynamic(metadata, civitaiCache);
|
||||
},
|
||||
|
||||
renderSettingsTab(analysis, containerId) {
|
||||
const el = document.getElementById(containerId);
|
||||
if (!el) return;
|
||||
@@ -424,6 +891,37 @@ export const comfyEditor = {
|
||||
comfyUI.currentWorkflow[negTarget].inputs[negTextKey] = negText;
|
||||
}
|
||||
},
|
||||
|
||||
disableAllStack(containerId = "wfm-gen-lora-fields") {
|
||||
for (const k of Object.keys(_stackActive)) {
|
||||
_stackActive[k] = false;
|
||||
}
|
||||
const toggleAll = document.getElementById("wfm-lora-stack-toggle-all");
|
||||
if (toggleAll) toggleAll.checked = false;
|
||||
const container = document.getElementById(containerId);
|
||||
if (!container) return;
|
||||
container.querySelectorAll(".wfm-lora-stack-model-row").forEach((row) => {
|
||||
row.classList.add("wfm-lora-stack-model-row--off");
|
||||
const cb = row.querySelector(".wfm-lora-stack-active-cb");
|
||||
const inM = row.querySelector(".wfm-lora-stack-str-m");
|
||||
const inC = row.querySelector(".wfm-lora-stack-str-c");
|
||||
if (cb) cb.checked = false;
|
||||
if (inM) inM.disabled = true;
|
||||
if (inC) inC.disabled = true;
|
||||
});
|
||||
},
|
||||
|
||||
switchLoraSingleTab() {
|
||||
const container = document.getElementById("wfm-gen-lora-fields");
|
||||
if (!container) return;
|
||||
container.querySelectorAll(".wfm-lora-tab-btn").forEach(b => b.classList.remove("active"));
|
||||
const singleBtn = container.querySelector(".wfm-lora-tab-btn[data-tab='single']");
|
||||
if (singleBtn) singleBtn.classList.add("active");
|
||||
const singlePanel = document.getElementById("wfm-lora-panel-single");
|
||||
const stackPanel = document.getElementById("wfm-lora-panel-stack");
|
||||
if (singlePanel) singlePanel.style.display = "";
|
||||
if (stackPanel) stackPanel.style.display = "none";
|
||||
},
|
||||
};
|
||||
|
||||
function _nodeOptions(nodes) {
|
||||
|
||||
@@ -591,6 +591,23 @@ export const comfyWorkflow = {
|
||||
});
|
||||
}
|
||||
|
||||
// ImageMetadataPromptLoader — checkpoint + positive/negative prompts in one node
|
||||
if (ct === "ImageMetadataPromptLoader") {
|
||||
result.checkpoint_nodes.push({ id, type: ct, title, ckpt_name: inputs.ckpt_name });
|
||||
if (typeof inputs.positive_text === "string") {
|
||||
result.prompt_nodes.push({
|
||||
id, type: ct, title: `${title} [positive]`, role: "positive",
|
||||
text: inputs.positive_text, textKey: "positive_text",
|
||||
});
|
||||
}
|
||||
if (typeof inputs.negative_text === "string") {
|
||||
result.prompt_nodes.push({
|
||||
id, type: ct, title: `${title} [negative]`, role: "negative",
|
||||
text: inputs.negative_text, textKey: "negative_text",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// --- Prompt nodes ---
|
||||
|
||||
if (ct === "CLIPTextEncode") {
|
||||
@@ -618,6 +635,17 @@ export const comfyWorkflow = {
|
||||
}
|
||||
}
|
||||
|
||||
// CLIPTextEncodeEditPlus — text_edit is the locally editable override; text1 is always a link
|
||||
if (ct === "CLIPTextEncodeEditPlus") {
|
||||
const textVal = inputs.text_edit;
|
||||
if (typeof textVal === "string") {
|
||||
result.prompt_nodes.push({
|
||||
id, type: ct, title, role: getRole(),
|
||||
text: textVal, textKey: "text_edit",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Qwen-based image+text encoder
|
||||
if (ct === "TextEncodeQwenImageEditPlus") {
|
||||
result.prompt_nodes.push({
|
||||
@@ -696,6 +724,26 @@ export const comfyWorkflow = {
|
||||
}
|
||||
}
|
||||
|
||||
// Lora Loader (LoraManager) — loras stored in inputs.loras.__value__
|
||||
if (ct === "Lora Loader (LoraManager)") {
|
||||
result.lora_nodes.push({ id, type: ct, title, is_lora_manager: true });
|
||||
}
|
||||
|
||||
// ImageMetadataLoRALoader — up to 3 LoRA slots; skip "None" entries
|
||||
if (ct === "ImageMetadataLoRALoader") {
|
||||
for (let i = 1; i <= 3; i++) {
|
||||
const loraName = inputs[`lora_${i}`];
|
||||
if (typeof loraName === "string" && loraName !== "None") {
|
||||
result.lora_nodes.push({
|
||||
id, type: ct, title,
|
||||
lora_name: loraName,
|
||||
strength_model: inputs[`strength_model_${i}`] ?? 1.0,
|
||||
strength_clip: inputs[`strength_clip_${i}`] ?? 1.0,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- VAE nodes ---
|
||||
if (ct === "VAELoader") {
|
||||
result.vae_nodes.push({ id, type: ct, title, vae_name: inputs.vae_name });
|
||||
@@ -781,6 +829,10 @@ function _getWidgetMapping(nodeType) {
|
||||
CheckpointLoaderSimple: ["ckpt_name"],
|
||||
KSampler: ["seed", "steps", "cfg", "sampler_name", "scheduler", "denoise"],
|
||||
CLIPTextEncode: ["text"],
|
||||
CLIPTextEncodeEditPlus: ["text_edit", "mode"],
|
||||
ImageMetadataCheckpointLoader: ["ckpt_name", "vae_name", "_metadata_json"],
|
||||
ImageMetadataPromptLoader: ["ckpt_name", "vae_name", "positive_text", "negative_text", "_metadata_json"],
|
||||
ImageMetadataLoRALoader: ["lora_1", "strength_model_1", "strength_clip_1", "lora_2", "strength_model_2", "strength_clip_2", "lora_3", "strength_model_3", "strength_clip_3"],
|
||||
EmptyLatentImage: ["width", "height", "batch_size"],
|
||||
LoraLoader: ["lora_name", "strength_model", "strength_clip"],
|
||||
VAELoader: ["vae_name"],
|
||||
|
||||
@@ -135,6 +135,10 @@ async function _startRun() {
|
||||
const msg = JSON.parse(ev.data);
|
||||
if (msg.type === "image_loop_node_sync" && String(msg.data?.node_id) === String(nodeId)) {
|
||||
_lastSync = msg.data;
|
||||
if (msg.data.thumbnail_path) {
|
||||
const p = msg.data.thumbnail_path;
|
||||
_showPreview(p, p.split("/").pop());
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
};
|
||||
@@ -507,4 +511,5 @@ export async function initFeederTab() {
|
||||
document.getElementById("wfm-feeder-stop-btn")?.addEventListener("click", _stopRun);
|
||||
|
||||
await Promise.all([_loadTree(), _loadPresets()]);
|
||||
_selectDir("");
|
||||
}
|
||||
|
||||
+683
-77
@@ -140,6 +140,7 @@ export async function loadWorkflowIntoEditor(workflow, filename) {
|
||||
const nameEl = document.getElementById("wfm-gen-wf-name");
|
||||
if (nameEl) {
|
||||
nameEl.textContent = filename || "Loaded Workflow";
|
||||
nameEl.dataset.filename = filename || "";
|
||||
}
|
||||
|
||||
// Enable generate button
|
||||
@@ -153,10 +154,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" | "sampler" | "scheduler" | null
|
||||
|
||||
async function _waitIfPaused() {
|
||||
if (!_ckptBatch.paused) return;
|
||||
@@ -171,42 +173,97 @@ 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", sampler: "Sampler", scheduler: "Scheduler" };
|
||||
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() {
|
||||
// Sampler / Scheduler 選択状態
|
||||
const _samplerSelected = new Set();
|
||||
const _schedulerSelected = new Set();
|
||||
|
||||
// 汎用: 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 +281,71 @@ 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, "&").replace(/</g, "<").replace(/"/g, """);
|
||||
const safeName = name.replace(/&/g, "&").replace(/</g, "<");
|
||||
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, "&").replace(/</g, "<").replace(/"/g, """) : "";
|
||||
const safeLabel = label.replace(/&/g, "&").replace(/</g, "<");
|
||||
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"
|
||||
);
|
||||
// Sampler
|
||||
_renderQueueColumn(
|
||||
"wfm-batch-sampler-count", "wfm-batch-sampler-list",
|
||||
[..._samplerSelected].sort(),
|
||||
(s) => s,
|
||||
"sampler", "samplers"
|
||||
);
|
||||
// Scheduler
|
||||
_renderQueueColumn(
|
||||
"wfm-batch-scheduler-count", "wfm-batch-scheduler-list",
|
||||
[..._schedulerSelected].sort(),
|
||||
(s) => s,
|
||||
"scheduler", "schedulers"
|
||||
);
|
||||
}
|
||||
|
||||
// モデルパスリストをフォルダ → [modelPath, ...] のMapに変換
|
||||
@@ -549,8 +653,341 @@ 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
|
||||
);
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Sampler / Scheduler リスト
|
||||
// ============================================
|
||||
function _buildSimpleGroupList(listEl, items, selectedSet, emptyMsg) {
|
||||
if (!listEl) return;
|
||||
if (items.length === 0) {
|
||||
listEl.innerHTML = `<div style="padding:8px 10px;font-size:11px;color:var(--wfm-text-secondary);">${emptyMsg}</div>`;
|
||||
return;
|
||||
}
|
||||
listEl.innerHTML = "";
|
||||
|
||||
const group = document.createElement("div");
|
||||
group.className = "wfm-ckpt-folder-group open";
|
||||
|
||||
const header = document.createElement("div");
|
||||
header.className = "wfm-ckpt-folder-header";
|
||||
|
||||
const folderCb = document.createElement("input");
|
||||
folderCb.type = "checkbox";
|
||||
const selCount = () => items.filter((x) => selectedSet.has(x)).length;
|
||||
const updateFolderCb = () => {
|
||||
const n = selCount();
|
||||
folderCb.checked = items.length > 0 && n === items.length;
|
||||
folderCb.indeterminate = n > 0 && n < items.length;
|
||||
};
|
||||
updateFolderCb();
|
||||
|
||||
const toggle = document.createElement("span");
|
||||
toggle.className = "wfm-ckpt-folder-toggle";
|
||||
toggle.textContent = "▶";
|
||||
|
||||
const nameSpan = document.createElement("span");
|
||||
nameSpan.className = "wfm-ckpt-folder-name";
|
||||
nameSpan.textContent = "(root)";
|
||||
|
||||
const countSpan = document.createElement("span");
|
||||
countSpan.className = "wfm-ckpt-folder-count";
|
||||
countSpan.textContent = items.length;
|
||||
|
||||
const filesDiv = document.createElement("div");
|
||||
filesDiv.className = "wfm-ckpt-folder-files";
|
||||
|
||||
for (const s of items) {
|
||||
const label = document.createElement("label");
|
||||
label.className = "wfm-ckpt-item wfm-ckpt-item--indented";
|
||||
const cb = document.createElement("input");
|
||||
cb.type = "checkbox";
|
||||
cb.value = s;
|
||||
cb.checked = selectedSet.has(s);
|
||||
cb.addEventListener("change", () => {
|
||||
if (cb.checked) selectedSet.add(s);
|
||||
else selectedSet.delete(s);
|
||||
updateFolderCb();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
const span = document.createElement("span");
|
||||
span.className = "wfm-ckpt-item-label";
|
||||
span.textContent = s;
|
||||
label.appendChild(cb);
|
||||
label.appendChild(span);
|
||||
filesDiv.appendChild(label);
|
||||
}
|
||||
|
||||
folderCb.addEventListener("change", () => {
|
||||
folderCb.indeterminate = false;
|
||||
items.forEach((s) => { if (folderCb.checked) selectedSet.add(s); else selectedSet.delete(s); });
|
||||
filesDiv.querySelectorAll("input[type=checkbox]").forEach((c) => { c.checked = folderCb.checked; });
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
[toggle, nameSpan].forEach((el) => {
|
||||
el.addEventListener("click", () => group.classList.toggle("open"));
|
||||
});
|
||||
|
||||
header.appendChild(folderCb);
|
||||
header.appendChild(toggle);
|
||||
header.appendChild(nameSpan);
|
||||
header.appendChild(countSpan);
|
||||
group.appendChild(header);
|
||||
group.appendChild(filesDiv);
|
||||
listEl.appendChild(group);
|
||||
}
|
||||
|
||||
function _rebuildSamplerList() {
|
||||
_buildSimpleGroupList(
|
||||
document.getElementById("wfm-sampler-list"),
|
||||
comfyEditor.models.samplers || [],
|
||||
_samplerSelected,
|
||||
"No samplers (connect to ComfyUI first)"
|
||||
);
|
||||
}
|
||||
|
||||
function _rebuildSchedulerList() {
|
||||
_buildSimpleGroupList(
|
||||
document.getElementById("wfm-scheduler-list"),
|
||||
comfyEditor.models.schedulers || [],
|
||||
_schedulerSelected,
|
||||
"No schedulers (connect to ComfyUI first)"
|
||||
);
|
||||
}
|
||||
|
||||
function initBatchTab() {
|
||||
// 内部タブ切り替え
|
||||
// 左ペイン タブ切り替え
|
||||
document.querySelectorAll(".wfm-batch-left-tab").forEach((btn) => {
|
||||
btn.addEventListener("click", () => {
|
||||
document.querySelectorAll(".wfm-batch-left-tab").forEach((b) => b.classList.remove("active"));
|
||||
btn.classList.add("active");
|
||||
const tabId = btn.dataset.leftTab;
|
||||
document.querySelectorAll(".wfm-batch-left-content").forEach((c) => c.classList.remove("active"));
|
||||
document.getElementById(`wfm-batch-left-${tabId}`)?.classList.add("active");
|
||||
if (tabId === "sampler") _rebuildSamplerList();
|
||||
else if (tabId === "scheduler") _rebuildSchedulerList();
|
||||
});
|
||||
});
|
||||
|
||||
// 中央ペイン 内部タブ切り替え
|
||||
document.querySelectorAll(".wfm-batch-inner-tab").forEach((btn) => {
|
||||
btn.addEventListener("click", () => {
|
||||
document.querySelectorAll(".wfm-batch-inner-tab").forEach((b) => b.classList.remove("active"));
|
||||
@@ -558,13 +995,17 @@ 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();
|
||||
});
|
||||
});
|
||||
|
||||
// 検索フィルター(左ペイン)
|
||||
// 検索フィルター(左ペイン Checkpoint)
|
||||
document.getElementById("wfm-ckpt-search")?.addEventListener("input", _rebuildCkptList);
|
||||
|
||||
// 全選択 / 全解除(左ペイン)
|
||||
// 全選択 / 全解除(左ペイン Checkpoint)
|
||||
document.getElementById("wfm-ckpt-select-all")?.addEventListener("click", () => {
|
||||
_ckptState.mode = "all";
|
||||
_ckptState.selected.clear();
|
||||
@@ -578,20 +1019,55 @@ function initBatchTab() {
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// Batch タブが表示されたときにグループを読み込む
|
||||
// 全選択 / 全解除(左ペイン Sampler)
|
||||
document.getElementById("wfm-sampler-select-all")?.addEventListener("click", () => {
|
||||
(comfyEditor.models.samplers || []).forEach((s) => _samplerSelected.add(s));
|
||||
_rebuildSamplerList();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
document.getElementById("wfm-sampler-deselect-all")?.addEventListener("click", () => {
|
||||
_samplerSelected.clear();
|
||||
_rebuildSamplerList();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// 全選択 / 全解除(左ペイン Scheduler)
|
||||
document.getElementById("wfm-scheduler-select-all")?.addEventListener("click", () => {
|
||||
(comfyEditor.models.schedulers || []).forEach((s) => _schedulerSelected.add(s));
|
||||
_rebuildSchedulerList();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
document.getElementById("wfm-scheduler-deselect-all")?.addEventListener("click", () => {
|
||||
_schedulerSelected.clear();
|
||||
_rebuildSchedulerList();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// 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 +1164,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 +1191,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 +1216,7 @@ async function _runBatchGenerate() {
|
||||
_ckptBatch._resumeResolve = null;
|
||||
}
|
||||
_setPauseBtnState(false);
|
||||
_updateBatchTypeLabel(false);
|
||||
}
|
||||
|
||||
if (batchBar) batchBar.style.width = "100%";
|
||||
@@ -766,12 +1226,118 @@ 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]) continue;
|
||||
if (node.is_lora_manager) {
|
||||
const stem = loraName.replace(/\\/g, "/").split("/").pop().replace(/\.[^.]+$/, "");
|
||||
comfyUI.currentWorkflow[node.id].inputs.loras = {
|
||||
__value__: [{ name: stem, strength: 1.0, active: true, expanded: false, clipStrength: 1.0, locked: false }],
|
||||
};
|
||||
comfyUI.currentWorkflow[node.id].inputs.text = `<lora:${stem}:1:1>`;
|
||||
} else {
|
||||
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/raw?filename=${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;
|
||||
}
|
||||
case "sampler": {
|
||||
const samplerNodes = comfyUI.currentAnalysis?.sampler_nodes || [];
|
||||
if (samplerNodes.length === 0) { showToast("No KSampler node found in workflow", "error"); return; }
|
||||
const list = [..._samplerSelected].sort();
|
||||
if (list.length === 0) { showToast("No samplers selected", "error"); return; }
|
||||
await _runBatchLoop(list, (samplerName) => {
|
||||
for (const node of samplerNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
comfyUI.currentWorkflow[node.id].inputs.sampler_name = samplerName;
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "scheduler": {
|
||||
const samplerNodes = comfyUI.currentAnalysis?.sampler_nodes || [];
|
||||
if (samplerNodes.length === 0) { showToast("No KSampler node found in workflow", "error"); return; }
|
||||
const list = [..._schedulerSelected].sort();
|
||||
if (list.length === 0) { showToast("No schedulers selected", "error"); return; }
|
||||
await _runBatchLoop(list, (schedulerName) => {
|
||||
for (const node of samplerNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
comfyUI.currentWorkflow[node.id].inputs.scheduler = schedulerName;
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Generate entry point
|
||||
// ============================================
|
||||
@@ -794,7 +1360,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) {
|
||||
@@ -841,9 +1407,27 @@ export async function initGenerateTab() {
|
||||
comfyEditor.renderAll(comfyUI.currentAnalysis, comfyUI.currentWorkflow);
|
||||
}
|
||||
showToast("Model lists refreshed", "success");
|
||||
_rebuildSamplerList();
|
||||
_rebuildSchedulerList();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
document.getElementById("wfm-gen-reset-workflow-btn")?.addEventListener("click", async () => {
|
||||
const filename = document.getElementById("wfm-gen-wf-name")?.dataset?.filename;
|
||||
if (!filename || !filename.endsWith(".json")) {
|
||||
showToast("No file-based workflow loaded", "warning");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const resp = await fetch(`/api/wfm/workflows/raw?filename=${encodeURIComponent(filename)}`);
|
||||
if (!resp.ok) throw new Error(resp.status);
|
||||
const data = await resp.json();
|
||||
await loadWorkflowIntoEditor(data, filename);
|
||||
} catch (err) {
|
||||
showToast("Reset failed: " + err.message, "error");
|
||||
}
|
||||
});
|
||||
|
||||
// Generate button
|
||||
document.getElementById("wfm-gen-generate-btn")?.addEventListener("click", handleGenerate);
|
||||
|
||||
@@ -884,6 +1468,28 @@ export async function initGenerateTab() {
|
||||
document.querySelectorAll(".wfm-gen-subtab-content").forEach((c) => c.classList.remove("active"));
|
||||
document.getElementById(`wfm-gen-subtab-${target}`)?.classList.add("active");
|
||||
moveRawJsonToTab(target);
|
||||
// Re-render LoRA pane when switching to model tab so Stack group changes are reflected
|
||||
if (target === "model" && comfyUI.currentAnalysis) {
|
||||
comfyEditor.renderLoraPane(comfyUI.currentAnalysis, "wfm-gen-lora-fields");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Stack refresh button in LoRA column header
|
||||
document.getElementById("wfm-lora-stack-refresh")?.addEventListener("click", () => {
|
||||
if (comfyUI.currentAnalysis) {
|
||||
comfyEditor.renderLoraPane(comfyUI.currentAnalysis, "wfm-gen-lora-fields");
|
||||
}
|
||||
});
|
||||
|
||||
// Input inner tab (Prompt / Image)
|
||||
document.querySelectorAll(".wfm-input-inner-tab").forEach((btn) => {
|
||||
btn.addEventListener("click", () => {
|
||||
const target = btn.dataset.inputTab;
|
||||
document.querySelectorAll(".wfm-input-inner-tab").forEach((b) => b.classList.remove("active"));
|
||||
btn.classList.add("active");
|
||||
document.querySelectorAll(".wfm-input-inner-panel").forEach((p) => p.style.display = "none");
|
||||
document.getElementById(`wfm-input-panel-${target}`)?.style.setProperty("display", "");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+117
-30
@@ -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,15 +422,19 @@ 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",
|
||||
helpGen5: "Model tab: Checkpoint, VAE, LoRA (Single/Stack tabs), ControlNet, UNET, TextEncoder selectors with filter",
|
||||
helpGen6: "Settings tab: KSampler and Latent Image side by side, each at 50% width",
|
||||
helpGen7: "Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow",
|
||||
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 tab — enable one batch type at a time by checking the checkbox in the Batch Queue column header; Generate then runs through all queued items sequentially with Pause/Resume and Stop controls",
|
||||
helpGen12: "Batch tab — Left pane has 3 tabs: Checkpoints (folder tree with Filter/All/None; (root) header checkbox selects all), Sampler (KSampler sampler_name list with (root) checkbox), Scheduler (KSampler scheduler list with (root) checkbox); All/None toolbar buttons also available",
|
||||
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): 6 columns — Checkpoint, Lora, Prompt, Workflow, Sampler, Scheduler; each column has an enable checkbox (radio behavior: only one at a time); count shown per column",
|
||||
helpGen15: "Sampler/Scheduler batch: select samplers or schedulers in the left pane, enable the column in Batch Queue, then Generate to iterate through each value on the KSampler node; lists are fetched from ComfyUI (connection required)",
|
||||
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 +465,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,13 +475,13 @@ 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",
|
||||
helpModels6: "Detail modal: preview image, CivitAI info (base model, trained words, tags), thumbnail change",
|
||||
helpModels6: "Detail modal: preview image, CivitAI info (base model, trained words, tags), thumbnail change — upload any image format; changes take effect immediately; broken/empty preview files are automatically skipped",
|
||||
helpModels7: "Group management: create, rename, delete groups and assign/remove models",
|
||||
helpModels8: "GenUI Model button: apply the selected model to the corresponding node in GenerateUI's current workflow (Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
helpModels8: "GenUI Model button: applies the selected model to the workflow node; LoRA additionally switches to the Single tab, disables all Stack models, and shows LORA SYNTAX / TRIGGER WORDS (Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
helpModels9: "User-defined badges: assign free-label badges with custom colors shared with the Workflow tab",
|
||||
helpModels10: "Enable/Disable models: toggle visibility in ComfyUI by renaming file extension (.disabled suffix). Disable per model (⏸ button on each card) or per group (Enable All / Disable All in Group panel). Changes take effect after ComfyUI refresh.",
|
||||
helpModels11: "Multi-select & bulk operations: click Select to enter selection mode, check multiple models, then use the bulk action bar to add/remove from groups or permanently delete files (model file + preview images + sidecar files such as .json/.info).",
|
||||
@@ -480,11 +508,11 @@ const LANGUAGES = {
|
||||
helpSidepanel8: "Copy individual positive (P) or negative (N) prompts from sidebar items",
|
||||
helpSidepanel9: "Double-click items to load/place without dragging",
|
||||
helpSidepanel10: "Search within each sub-tab to quickly find items",
|
||||
helpSidepanel11: "Models tab: All / ★ Favorites / Groups / By Type sub-tabs",
|
||||
helpSidepanel11: "Models tab: All / ★ Favorites / Groups / By Type sub-tabs; Prompts tab: All / ★ Favorites / Categories sub-tabs + Groups sub-tab (row 2); Models Groups — LoRA groups show an \"All N LoRAs\" item to drag all into a single Lora Loader (LoraManager) node",
|
||||
helpSidepanel12: "⚙ Theme button (header): customize panel background, sub-header background, text, border, and secondary text colors — changes are saved to localStorage and applied on next open",
|
||||
helpSidepanel13: "I tab (Information): drop a ComfyUI PNG/WebP/JSON to inspect model, LoRA, and prompt metadata in the side panel — sub-tabs: model / lora / Prompts; supports UnetLoaderGGUF and QuadrupleCLIPLoader node types",
|
||||
helpSidepanel13: "I tab (Information): drop a ComfyUI PNG/WebP/JSON to inspect model, LoRA, and prompt metadata in the side panel — sub-tabs: model / lora / Prompts; supports UnetLoaderGGUF, QuadrupleCLIPLoader, and Lora Loader (LoraManager) node types",
|
||||
helpSidepanel14: "Information tab — drag items to canvas: model sub-tab places the loader node (Checkpoint → CheckpointLoaderSimple, VAE → VAELoader, Diffusion Model → UNETLoader, Text Encoder → CLIPLoader); double-click also places at canvas center",
|
||||
helpSidepanel15: "Information tab — LoRA sub-tab: drag individual LoRA to place LoraLoader; \"Multiple LORA\" section at bottom places all LoRAs in a single Lora Loader (LoraManager) node; Prompts sub-tab: drag a prompt to place CLIPTextEncode node with text pre-filled; click prompt to view full text and copy",
|
||||
helpSidepanel15: "Information tab — LoRA sub-tab: detects LoRAs from LoraLoader, LoraLoaderModelOnly, and Lora Loader (LoraManager) nodes (API format supported); drag individual LoRA to place LoraLoader; \"Multiple LORA\" section places all LoRAs in a single Lora Loader (LoraManager) node with LoRA syntax pre-filled; Prompts sub-tab: drag a prompt to place CLIPTextEncode node with text pre-filled; click prompt to view full text and copy",
|
||||
helpSidepanel16: "A tab (AI Tools): Translation and VLM sub-tabs powered by Ollama or LM Studio; settings (backend, URL, model) are shared with the SPA AI tab via localStorage",
|
||||
helpAiTitle: "AI Tab (A)",
|
||||
helpAi1: "Translation sub-tab: translate text between Japanese, English, Chinese, or a custom Free language using Ollama or LM Studio",
|
||||
@@ -503,6 +531,7 @@ const LANGUAGES = {
|
||||
helpTrouble2: "Cannot connect to Ollama: Use connection test button, check if Ollama is running and models are downloaded",
|
||||
helpTrouble3: "Workflows not showing: Click refresh button, check if loadable in ComfyUI, try restarting browser/ComfyUI",
|
||||
helpTrouble4: "Image generation fails: Check if specified models exist in ComfyUI, verify connection, try restarting",
|
||||
helpTrouble5: "LoRA Stack fails with 'No such file or directory' error: The LoRA may not be recognized by comfyui-lora-manager (known issue). Try a different LoRA or check if the file appears in Lora Manager's own UI",
|
||||
helpSupportTitle: "Support",
|
||||
helpSupportDesc: "If you find this plugin useful, please consider supporting its development!",
|
||||
helpGithubDesc: "Report issues, request features, and contribute",
|
||||
@@ -882,6 +911,10 @@ const LANGUAGES = {
|
||||
modelsBadges: "バッジ",
|
||||
modelsInfo: "情報",
|
||||
modelsFavorite: "お気に入り",
|
||||
modelsBatch: "バッチ",
|
||||
modelsBatchClear: "バッチ一括解除",
|
||||
promptBatchClear: "バッチプリセットを一括解除しました",
|
||||
wfBatchClear: "バッチワークフローを一括解除しました",
|
||||
modelsMemo: "メモ",
|
||||
modelsMemoPlaceholder: "このモデルについてのメモ...",
|
||||
modelsSave: "保存",
|
||||
@@ -915,6 +948,7 @@ const LANGUAGES = {
|
||||
modelsGroupExists: "同名のグループが既に存在します",
|
||||
modelsRenamePrompt: "新しいグループ名を入力:",
|
||||
modelsDeleteGroupConfirm: "グループ「{name}」を削除しますか?",
|
||||
modelsGroupReserved: "このグループは予約済みのため削除・名前変更できません。",
|
||||
modelEnable: "有効化",
|
||||
modelDisable: "無効化",
|
||||
modelDisabled: "無効",
|
||||
@@ -952,7 +986,15 @@ const LANGUAGES = {
|
||||
civitaiHashing: "ハッシュ計算中...(大きいファイルは時間がかかります)",
|
||||
civitaiFound: "CivitAI情報を取得しました",
|
||||
civitaiNotFound: "CivitAIにモデルが見つかりません",
|
||||
civitaiNotFoundDesc: "確認済みですが、このモデルはCivitAIに見つかりませんでした。",
|
||||
civitaiRefetchBtn: "再確認する",
|
||||
civitaiError: "CivitAIからの取得エラー",
|
||||
civitaiType: "タイプ",
|
||||
civitaiBaseModel: "ベースモデル",
|
||||
civitaiHashLabel: "ハッシュ",
|
||||
civitaiCopyHash: "クリックでハッシュをコピー",
|
||||
civitaiHashCopied: "ハッシュをコピーしました",
|
||||
civitaiOpenImage: "画像を別タブで開く",
|
||||
civitaiTriggerWords: "トリガーワード",
|
||||
civitaiCopyWord: "クリックでコピー",
|
||||
civitaiWordCopied: "トリガーワードをコピーしました",
|
||||
@@ -966,6 +1008,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 +1084,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,15 +1093,19 @@ 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のセレクタ(フィルタ検索付き)",
|
||||
helpGen5: "Modelタブ:Checkpoint/VAE/LoRA(Single/Stackタブ)/ControlNet/UNET/TextEncoderのセレクタ(フィルタ検索付き)",
|
||||
helpGen6: "Settingsタブ:KSamplerとLatent Imageを横並び(各50%幅)",
|
||||
helpGen7: "Raw JSONを各タブの右列に常時表示 — 直接編集してApplyでワークフロー即時反映",
|
||||
helpGen8: "シード管理:ランダム / 固定 / 増加 / 減少",
|
||||
helpGen9: "画像生成、進捗表示、生成停止、結果表示",
|
||||
helpGen10: "Eagle連携:生成画像をEagleへ自動保存",
|
||||
helpGen11: "Checkpoint Batch:ドロップダウンのフォルダツリーからチェックポイントを選択 — フォルダにチェックでそのフォルダ内を一括選択、▶で展開して個別選択も可能;Filterで絞り込み;Pause/Resumeでモデル間の処理を一時停止・再開;Stopで現在の生成完了後に中断",
|
||||
helpGen11: "Batchタブ — バッチキューのカラムヘッダーのチェックボックスで1種類だけ有効化;Generateで全キュー項目を順次処理;一時停止/再開・停止ボタンで制御可能",
|
||||
helpGen12: "Batchタブ — 左ペインは3タブ構成:Checkpoints(フォルダツリー、Filter/All/None、(root)ヘッダーで全選択)、Sampler(KSamplerのsampler_nameリスト、(root)チェックボックスで全選択)、Scheduler(KSamplerのschedulerリスト、(root)チェックボックスで全選択);各タブにAll/Noneボタンも完備",
|
||||
helpGen13: "Batchタブ — 中央ペイン:グループ選択(Checkpoint | Lora | Prompt | Workflowの内部タブ);Checkpoint/LoraグループはModelsタブ、PromptグループはPromptタブ、WorkflowグループはWorkflowタブの定義を反映 — グループヘッダーにチェックで全メンバーを選択、▶で展開して個別選択も可能",
|
||||
helpGen14: "Batchタブ — 右ペイン(バッチキュー):6列構成 — Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler;各列にチェックボックスがあり1種類のみ有効化可能(ラジオ動作);各列に件数を表示",
|
||||
helpGen15: "Sampler/Schedulerバッチ:左ペインでサンプラーまたはスケジューラーを選択し、バッチキューの対応列を有効化してGenerateを実行;選択した値を順番にKSamplerノードに適用して生成;リストはComfyUIから取得(要接続)",
|
||||
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 +1136,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,13 +1146,13 @@ const LANGUAGES = {
|
||||
helpNodes5: "サイドパネル:詳細(クラス名、パッケージ、カテゴリ、説明、フラグ)、I/O仕様(入出力の型・デフォルト値)、グループ管理",
|
||||
helpNodes6: "ノードセット:再利用可能なノードコレクションの作成(説明、タグ、ノード間リンク定義付き)",
|
||||
helpModels1: "インストール済みモデルの閲覧:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embeddingをサブタブで切り替え",
|
||||
helpModels2: "サムネイル / カード / テーブル表示モード切り替え(ページネーション付き)",
|
||||
helpModels2: "サムネイル / テーブル表示モード切り替え(ページネーション付き)",
|
||||
helpModels3: "検索、タグフィルタ、グループフィルタ、お気に入りフィルタ、ステータスフィルタ(すべて / 有効のみ / 無効のみ)",
|
||||
helpModels4: "サイドパネル:基本情報(ファイルパス、タグ、メモ)、グループ管理、CivitAI連携",
|
||||
helpModels5: "CivitAI連携:SHA256ハッシュでモデル情報取得、モデルタイプごとの一括取得;プレビュー画像がない場合は自動でダウンロード・保存",
|
||||
helpModels6: "詳細モーダル:プレビュー画像、CivitAI情報(ベースモデル、トリガーワード、タグ)、サムネイル変更",
|
||||
helpModels6: "詳細モーダル:プレビュー画像、CivitAI情報(ベースモデル、トリガーワード、タグ)、サムネイル変更 — 任意の画像形式をアップロード可能;ComfyUI再起動なしで即時反映;破損/空のプレビューファイルは自動スキップ",
|
||||
helpModels7: "グループ管理:グループの作成・名前変更・削除、モデルの割り当て・解除",
|
||||
helpModels8: "GenUI Modelボタン:選択モデルをGenerateUIの現在のワークフローの該当ノードに直接適用(Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
helpModels8: "GenUI Modelボタン:選択モデルをワークフローノードに適用。LoRAはSingleタブへ切り替え・Stack全無効化・LORA SYNTAX/TRIGGER WORDSをLoRAペインに表示(Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
helpModels9: "ユーザー定義バッジ:自由ラベルのバッジをモデルに付与(Workflowタブと色パレットを共有)",
|
||||
helpModels10: "モデルの有効/無効切り替え:拡張子リネーム(.disabledサフィックス)でComfyUIへの表示を制御。各カードの⏸ボタンで単体操作、グループパネルの「全て有効化 / 全て無効化」でグループ一括操作。変更はComfyUIリフレッシュ後に反映。",
|
||||
helpModels11: "複数選択と一括操作:「選択」ボタンで選択モードに入り複数モデルにチェックを入れると、一括操作バーからグループへの追加/削除、またはファイルの完全削除(モデルファイル+プレビュー画像+.json/.infoなどのサイドカーファイル)が行えます。",
|
||||
@@ -1122,11 +1179,11 @@ const LANGUAGES = {
|
||||
helpSidepanel8: "サイドバーアイテムからポジティブ(P)/ネガティブ(N)プロンプトを個別コピー",
|
||||
helpSidepanel9: "ダブルクリックでもアイテムの読み込み・配置が可能",
|
||||
helpSidepanel10: "各サブタブ内で検索してアイテムをすばやく検索",
|
||||
helpSidepanel11: "Modelsタブ:All / ★ Favorites / Groups / By Typeサブタブ",
|
||||
helpSidepanel11: "Modelsタブ:All / ★ Favorites / Groups / By Type サブタブ;Promptsタブ:All / ★ Favorites / Categories サブタブ+Groupsサブタブ(下段);Models Groupsの LoRA グループには「All N LoRAs」アイテムがあり、ドラッグで全 LoRA を Lora Loader (LoraManager) ノードに一括配置できる",
|
||||
helpSidepanel12: "⚙ テーマボタン(ヘッダー):パネル背景・サブヘッダー背景・文字色・ボーダー・補助テキスト色をカスタマイズ可能、設定はlocalStorageに保存され次回起動時も反映",
|
||||
helpSidepanel13: "I タブ(Information):ComfyUI の PNG / WebP / JSON をドロップするとサイドパネル内でモデル・LoRA・プロンプトのメタデータを確認可能 — サブタブ: model / lora / Prompts;UnetLoaderGGUF・QuadrupleCLIPLoader ノードタイプに対応",
|
||||
helpSidepanel13: "I タブ(Information):ComfyUI の PNG / WebP / JSON をドロップするとサイドパネル内でモデル・LoRA・プロンプトのメタデータを確認可能 — サブタブ: model / lora / Prompts;UnetLoaderGGUF・QuadrupleCLIPLoader・Lora Loader (LoraManager) ノードタイプに対応",
|
||||
helpSidepanel14: "Information タブ — キャンバスへドラッグ:model サブタブのアイテムをドラッグすると対応ローダーノードを配置(Checkpoint → CheckpointLoaderSimple、VAE → VAELoader、Diffusion Model → UNETLoader、Text Encoder → CLIPLoader);ダブルクリックでもキャンバス中央に配置可能",
|
||||
helpSidepanel15: "Information タブ — lora サブタブ:個別 LoRA をドラッグで LoraLoader を配置;下部の「Multiple LORA」セクションをドラッグすると全 LoRA を一括で Lora Loader (LoraManager) に配置;Prompts サブタブ:プロンプトをドラッグするとテキスト入力済みの CLIPTextEncode ノードを配置;クリックで全文表示・コピー可能",
|
||||
helpSidepanel15: "Information タブ — lora サブタブ:LoraLoader・LoraLoaderModelOnly・Lora Loader (LoraManager) ノード(APIフォーマット含む)から LoRA を検出;個別 LoRA をドラッグで LoraLoader を配置;「Multiple LORA」セクションで全 LoRA を Lora Loader (LoraManager) ノードに一括配置(LoRA構文自動入力);Prompts サブタブ:プロンプトをドラッグするとテキスト入力済みの CLIPTextEncode ノードを配置;クリックで全文表示・コピー可能",
|
||||
helpSidepanel16: "A タブ(AI ツール):翻訳・VLM サブタブ;設定(バックエンド・URL・モデル)は SPA の AI タブと localStorage で共有される",
|
||||
helpAiTitle: "AI タブ(A)",
|
||||
helpAi1: "翻訳サブタブ:Ollama または LM Studio を使って日本語・英語・中国語・カスタム言語(Free)間でテキストを翻訳",
|
||||
@@ -1145,6 +1202,7 @@ const LANGUAGES = {
|
||||
helpTrouble2: "Ollamaに接続できない:接続テストボタンで確認、Ollamaの起動・モデルのダウンロードを確認",
|
||||
helpTrouble3: "ワークフローが表示されない:更新ボタン押下、ComfyUIで読み込めるか確認、ブラウザ・ComfyUI再起動",
|
||||
helpTrouble4: "画像生成が失敗する:指定モデルの存在確認、ComfyUI接続確認、再起動",
|
||||
helpTrouble5: "LoRAスタック実行時に「No such file or directory」エラー:comfyui-lora-managerが該当LoRAを認識していない可能性があります(既知の問題)。別のLoRAを試すか、Lora Manager自体のUIで該当ファイルが表示されるか確認してください",
|
||||
helpSupportTitle: "サポート",
|
||||
helpSupportDesc: "このプラグインが役に立ったら、開発を支援していただけると嬉しいです!",
|
||||
helpGithubDesc: "バグ報告、機能リクエスト、コントリビュート",
|
||||
@@ -1520,6 +1578,10 @@ const LANGUAGES = {
|
||||
modelsBadges: "标签",
|
||||
modelsInfo: "信息",
|
||||
modelsFavorite: "收藏",
|
||||
modelsBatch: "批次",
|
||||
modelsBatchClear: "清空批次",
|
||||
promptBatchClear: "已清空批次预设",
|
||||
wfBatchClear: "已清空批次工作流",
|
||||
modelsMemo: "备注",
|
||||
modelsMemoPlaceholder: "关于此模型的备注...",
|
||||
modelsSave: "保存",
|
||||
@@ -1553,6 +1615,7 @@ const LANGUAGES = {
|
||||
modelsGroupExists: "同名分组已存在",
|
||||
modelsRenamePrompt: "输入新分组名称:",
|
||||
modelsDeleteGroupConfirm: "删除分组「{name}」?",
|
||||
modelsGroupReserved: "此分组为系统保留分组,无法删除或重命名。",
|
||||
modelEnable: "启用",
|
||||
modelDisable: "禁用",
|
||||
modelDisabled: "已禁用",
|
||||
@@ -1590,7 +1653,15 @@ const LANGUAGES = {
|
||||
civitaiHashing: "计算哈希中...(大文件可能需要较长时间)",
|
||||
civitaiFound: "已加载CivitAI信息",
|
||||
civitaiNotFound: "在CivitAI上未找到该模型",
|
||||
civitaiNotFoundDesc: "已检查,但在CivitAI上未找到此模型。",
|
||||
civitaiRefetchBtn: "重新检查",
|
||||
civitaiError: "从CivitAI获取时出错",
|
||||
civitaiType: "类型",
|
||||
civitaiBaseModel: "基础模型",
|
||||
civitaiHashLabel: "哈希",
|
||||
civitaiCopyHash: "点击复制哈希",
|
||||
civitaiHashCopied: "哈希已复制",
|
||||
civitaiOpenImage: "在新标签页中打开图片",
|
||||
civitaiTriggerWords: "触发词",
|
||||
civitaiCopyWord: "点击复制",
|
||||
civitaiWordCopied: "触发词已复制",
|
||||
@@ -1604,6 +1675,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 +1751,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,15 +1760,19 @@ 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选择器(含筛选)",
|
||||
helpGen5: "Model标签:Checkpoint/VAE/LoRA(Single/Stack标签)/ControlNet/UNET/TextEncoder选择器(含筛选)",
|
||||
helpGen6: "Settings标签:KSampler与Latent Image并排显示(各占50%宽度)",
|
||||
helpGen7: "Raw JSON在每个标签右列常驻显示 — 直接编辑并Apply即时重载工作流",
|
||||
helpGen8: "种子管理:随机/固定/递增/递减",
|
||||
helpGen9: "生成图片、进度显示、停止生成、查看结果",
|
||||
helpGen10: "Eagle集成:自动保存生成图片到Eagle",
|
||||
helpGen11: "Checkpoint Batch:从下拉框文件夹树中选择检查点 — 勾选文件夹可一键选中该文件夹内的所有文件,▶展开后也可单独选择;使用Filter筛选;Pause/Resume可在模型之间暂停和继续;Stop在当前生成完成后中止",
|
||||
helpGen11: "Batch标签 — 勾选批次队列列标题复选框激活对应批次类型(每次仅一种);Generate按顺序处理所有队列项目;支持暂停/继续/停止控制",
|
||||
helpGen12: "Batch标签 — 左窗格含3个标签:Checkpoints(文件树,Filter/All/None,(root)标题勾选全选)、Sampler(KSampler采样器列表,(root)复选框全选)、Scheduler(KSampler调度器列表,(root)复选框全选);每个标签均有All/None按钮",
|
||||
helpGen13: "Batch标签 — 中央窗格:基于组的选择(含Checkpoint | Lora | Prompt | Workflow内部标签);Checkpoint/Lora组来自Models标签,Prompt组来自Prompt标签,Workflow组来自Workflow标签 — 勾选组标题选中所有成员,▶展开后也可单独选择",
|
||||
helpGen14: "Batch标签 — 右窗格(批量队列):6列 — Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler;每列有启用复选框(单选行为,每次仅一种);每列显示数量",
|
||||
helpGen15: "Sampler/Scheduler批次:在左窗格选择采样器或调度器,启用批次队列对应列后点击Generate;依次将每个值应用到KSampler节点逐一生成;列表从ComfyUI获取(需已连接)",
|
||||
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 +1803,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,13 +1813,13 @@ const LANGUAGES = {
|
||||
helpNodes5: "侧面板:详情(类名、包、分类、描述、标志)、I/O规格(输入输出类型和默认值)、组管理",
|
||||
helpNodes6: "节点集:创建可复用的节点集合(含描述、标签、节点间链接定义)",
|
||||
helpModels1: "浏览已安装模型:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embedding,通过子标签切换",
|
||||
helpModels2: "缩略图、卡片和表格视图模式切换(带分页)",
|
||||
helpModels2: "缩略图和表格视图模式切换(带分页)",
|
||||
helpModels3: "搜索、标签筛选、分组筛选、收藏筛选、状态筛选(全部 / 仅启用 / 仅禁用)",
|
||||
helpModels4: "侧面板:基本信息(文件路径、标签、备注)、分组管理、CivitAI集成",
|
||||
helpModels5: "CivitAI集成:通过SHA256哈希获取模型信息,按模型类型批量获取;无预览图时自动下载并保存",
|
||||
helpModels6: "详情弹窗:预览图片、CivitAI信息(基础模型、触发词、标签)、缩略图更改",
|
||||
helpModels6: "详情弹窗:预览图片、CivitAI信息(基础模型、触发词、标签)、缩略图更改 — 可上传任意格式图片;无需重启ComfyUI立即生效;损坏/空预览文件自动跳过",
|
||||
helpModels7: "分组管理:创建、重命名、删除分组,分配/移除模型",
|
||||
helpModels8: "GenUI Model按钮:将选中模型直接应用到GenerateUI当前工作流的对应节点(Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
helpModels8: "GenUI Model按钮:将选中模型应用到工作流节点;LoRA还会切换到Single标签、禁用所有Stack模型并在LoRA面板显示LORA SYNTAX/TRIGGER WORDS(Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
helpModels9: "用户自定义徽章:为模型添加自由标签徽章(颜色调色板与Workflow标签共享)",
|
||||
helpModels10: "模型启用/禁用:通过重命名文件扩展名(添加.disabled后缀)控制ComfyUI中的显示。点击每个卡片上的⏸按钮单独操作,或在分组面板中使用「全部启用/全部禁用」进行批量操作。更改在刷新ComfyUI后生效。",
|
||||
helpModels11: "多选与批量操作:点击「选择」按钮进入选择模式,勾选多个模型后,可通过批量操作栏将其添加/移出分组,或永久删除文件(模型文件+预览图+.json/.info等附属文件)。",
|
||||
@@ -1760,11 +1846,11 @@ const LANGUAGES = {
|
||||
helpSidepanel8: "从侧边栏项目中单独复制正面(P)或负面(N)提示词",
|
||||
helpSidepanel9: "双击项目也可加载/放置",
|
||||
helpSidepanel10: "在各子标签内搜索快速查找项目",
|
||||
helpSidepanel11: "Models标签:All / ★ Favorites / Groups / By Type子标签",
|
||||
helpSidepanel11: "Models标签:All / ★ Favorites / Groups / By Type子标签;Prompts标签:All / ★ Favorites / Categories子标签+Groups子标签(第二行);Models Groups的LoRA组显示「All N LoRAs」条目,可拖拽将全部LoRA放入单个Lora Loader (LoraManager)节点",
|
||||
helpSidepanel12: "⚙ 主题按钮(标题栏):可自定义面板背景、子标题背景、文字颜色、边框及辅助文字颜色,设置保存至localStorage并在下次打开时生效",
|
||||
helpSidepanel13: "I 标签(Information):拖放 ComfyUI PNG/WebP/JSON 即可在侧面板内查看模型、LoRA 和提示词元数据 — 子标签:model / lora / Prompts;支持 UnetLoaderGGUF 和 QuadrupleCLIPLoader 节点类型",
|
||||
helpSidepanel13: "I 标签(Information):拖放 ComfyUI PNG/WebP/JSON 即可在侧面板内查看模型、LoRA 和提示词元数据 — 子标签:model / lora / Prompts;支持 UnetLoaderGGUF、QuadrupleCLIPLoader 和 Lora Loader (LoraManager) 节点类型",
|
||||
helpSidepanel14: "Information 标签 — 拖拽到画布:model 子标签拖拽可放置对应加载节点(Checkpoint → CheckpointLoaderSimple、VAE → VAELoader、Diffusion Model → UNETLoader、Text Encoder → CLIPLoader);双击也可放置到画布中央",
|
||||
helpSidepanel15: "Information 标签 — lora 子标签:拖拽单个 LoRA 放置 LoraLoader;底部「Multiple LORA」区域可将全部 LoRA 一次性放入 Lora Loader (LoraManager) 节点;Prompts 子标签:拖拽提示词放置预填文本的 CLIPTextEncode 节点;点击可查看全文并复制",
|
||||
helpSidepanel15: "Information 标签 — lora 子标签:可检测 LoraLoader、LoraLoaderModelOnly 及 Lora Loader (LoraManager) 节点(含API格式)的 LoRA;拖拽单个 LoRA 放置 LoraLoader;「Multiple LORA」区域可将全部 LoRA 一次性放入 Lora Loader (LoraManager) 节点并自动填入LoRA语法;Prompts 子标签:拖拽提示词放置预填文本的 CLIPTextEncode 节点;点击可查看全文并复制",
|
||||
helpSidepanel16: "A 标签(AI 工具):翻译子标签和 VLM 子标签;设置(后端、URL、模型)通过 localStorage 与 SPA 的 AI 标签共享",
|
||||
helpAiTitle: "AI 标签页(A)",
|
||||
helpAi1: "翻译子标签:使用 Ollama 或 LM Studio 在日语、英语、中文或自定义语言(Free)之间翻译文本",
|
||||
@@ -1783,6 +1869,7 @@ const LANGUAGES = {
|
||||
helpTrouble2: "无法连接Ollama:使用连接测试按钮、确认Ollama运行中且已下载模型",
|
||||
helpTrouble3: "工作流不显示:点击刷新按钮、确认能在ComfyUI中加载、尝试重启浏览器/ComfyUI",
|
||||
helpTrouble4: "图片生成失败:确认指定模型存在、验证ComfyUI连接、尝试重启",
|
||||
helpTrouble5: "LoRA Stack出现「No such file or directory」错误:该LoRA可能未被comfyui-lora-manager识别(已知问题)。请尝试其他LoRA,或检查该文件是否显示在Lora Manager自身的界面中",
|
||||
helpSupportTitle: "支持",
|
||||
helpSupportDesc: "如果您觉得这个插件有用,请考虑支持它的开发!",
|
||||
helpGithubDesc: "报告问题、请求功能和贡献代码",
|
||||
|
||||
@@ -154,7 +154,9 @@ function extractLoRAs(wf) {
|
||||
function add(name, sm, sc) {
|
||||
if (!name || typeof name !== "string" || name === "None" || seen.has(name)) return;
|
||||
seen.add(name);
|
||||
results.push({ name, strength_model: typeof sm === "number" ? sm : 1.0, strength_clip: typeof sc === "number" ? sc : 1.0 });
|
||||
const smNum = parseFloat(sm);
|
||||
const scNum = parseFloat(sc);
|
||||
results.push({ name, strength_model: isNaN(smNum) ? 1.0 : smNum, strength_clip: isNaN(scNum) ? 1.0 : scNum });
|
||||
}
|
||||
if (Array.isArray(wf.nodes)) {
|
||||
for (const n of collectAllNodes(wf)) {
|
||||
@@ -170,6 +172,11 @@ function extractLoRAs(wf) {
|
||||
const ct = n.class_type ?? "";
|
||||
if (ct === "LoraLoader") add(n.inputs?.lora_name, n.inputs?.strength_model, n.inputs?.strength_clip);
|
||||
else if (ct === "LoraLoaderModelOnly") add(n.inputs?.lora_name, n.inputs?.strength, 1.0);
|
||||
else if (ct === "Lora Loader (LoraManager)") {
|
||||
const lorasData = n.inputs?.loras;
|
||||
const list = lorasData?.__value__ ?? (Array.isArray(lorasData) ? lorasData : null);
|
||||
if (list) for (const l of list) { if (l?.active !== false) add(l?.name, l?.strength ?? 1.0, l?.clipStrength ?? l?.strength ?? 1.0); }
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
||||
+341
-109
@@ -8,6 +8,11 @@ import { t } from "./i18n.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { comfyEditor } from "./comfyui-editor.js";
|
||||
|
||||
// ── Constants ─────────────────────────────────────────────
|
||||
const RESERVED_GROUPS = ["Batch", "Stack"];
|
||||
const BATCH_MODEL_TYPES = ["checkpoint", "lora"];
|
||||
const STACK_MODEL_TYPES = ["lora"];
|
||||
|
||||
// ── State ─────────────────────────────────────────────────
|
||||
|
||||
const state = {
|
||||
@@ -35,7 +40,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: {},
|
||||
@@ -86,25 +92,81 @@ function applyToGenUI(modelName, modelType) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { key, inputKey } = mapping;
|
||||
let selectEl = null;
|
||||
|
||||
// Find the first matching node in the current workflow
|
||||
const nodeId = Object.keys(comfyUI.currentWorkflow).find((id) => {
|
||||
const node = comfyUI.currentWorkflow[id];
|
||||
return node.inputs && inputKey in node.inputs;
|
||||
});
|
||||
if (modelType === "lora") {
|
||||
// Use lora_nodes from analysis to correctly handle Lora Loader (LoraManager)
|
||||
const loraNodes = comfyUI.currentAnalysis?.lora_nodes || [];
|
||||
let nodeId = null;
|
||||
let isLoraManager = false;
|
||||
|
||||
if (!nodeId) {
|
||||
showToast(t("modelsGenUINoNode", TYPE_LABELS[modelType] || modelType), "warning");
|
||||
return;
|
||||
if (loraNodes.length > 0) {
|
||||
const targetNode = loraNodes[0];
|
||||
nodeId = targetNode.id;
|
||||
isLoraManager = !!targetNode.is_lora_manager;
|
||||
} else {
|
||||
// Fallback: find a standard LoraLoader node by lora_name input
|
||||
nodeId = Object.keys(comfyUI.currentWorkflow).find((id) => {
|
||||
const node = comfyUI.currentWorkflow[id];
|
||||
return node.inputs && "lora_name" in node.inputs;
|
||||
});
|
||||
}
|
||||
|
||||
if (!nodeId || !comfyUI.currentWorkflow[nodeId]) {
|
||||
showToast(t("modelsGenUINoNode", TYPE_LABELS[modelType] || modelType), "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
const stem = modelName.replace(/\\/g, "/").split("/").pop().replace(/\.[^.]+$/, "");
|
||||
|
||||
if (isLoraManager) {
|
||||
comfyUI.currentWorkflow[nodeId].inputs.loras = {
|
||||
__value__: [{ name: stem, strength: 1.0, active: true, expanded: false, clipStrength: 1.0, locked: false }],
|
||||
};
|
||||
comfyUI.currentWorkflow[nodeId].inputs.text = `<lora:${stem}:1:1>`;
|
||||
} else {
|
||||
comfyUI.currentWorkflow[nodeId].inputs.lora_name = modelName;
|
||||
}
|
||||
|
||||
// Disable all Stack models and switch to Single tab
|
||||
comfyEditor.disableAllStack("wfm-gen-lora-fields");
|
||||
comfyEditor.switchLoraSingleTab();
|
||||
|
||||
// Update Single tab LORA SYNTAX and TRIGGER WORDS displays
|
||||
const loraSyntax = `<lora:${stem}:1:1>`;
|
||||
const sha = (state.modelMetadata[modelName] || {}).sha256;
|
||||
const civInfo = sha && state.civitaiCache[sha];
|
||||
const triggerWords = civInfo?.trainedWords || [];
|
||||
|
||||
const singleSyntaxEl = document.getElementById("wfm-lora-single-syntax");
|
||||
if (singleSyntaxEl) singleSyntaxEl.textContent = loraSyntax;
|
||||
|
||||
const singleTriggersEl = document.getElementById("wfm-lora-single-triggers");
|
||||
if (singleTriggersEl) {
|
||||
singleTriggersEl.innerHTML = triggerWords.length
|
||||
? triggerWords.map(w => `<span class="wfm-lora-trigger-word">${w}</span>`).join(" ")
|
||||
: `<span style="color:var(--wfm-text-secondary);font-size:12px;">—</span>`;
|
||||
}
|
||||
|
||||
selectEl = document.getElementById("wfm-lora-select");
|
||||
} else {
|
||||
const { key, inputKey } = mapping;
|
||||
|
||||
const nodeId = Object.keys(comfyUI.currentWorkflow).find((id) => {
|
||||
const node = comfyUI.currentWorkflow[id];
|
||||
return node.inputs && inputKey in node.inputs;
|
||||
});
|
||||
|
||||
if (!nodeId) {
|
||||
showToast(t("modelsGenUINoNode", TYPE_LABELS[modelType] || modelType), "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
comfyUI.currentWorkflow[nodeId].inputs[inputKey] = modelName;
|
||||
selectEl = document.getElementById(`wfm-model-${key}`);
|
||||
}
|
||||
|
||||
comfyUI.currentWorkflow[nodeId].inputs[inputKey] = modelName;
|
||||
|
||||
// Sync GenUI select element if visible
|
||||
const selectEl = document.getElementById(`wfm-model-${key}`);
|
||||
if (selectEl) {
|
||||
// Add option if not present (subdir paths may not be in list)
|
||||
if (![...selectEl.options].some(o => o.value === modelName)) {
|
||||
const opt = document.createElement("option");
|
||||
opt.value = modelName;
|
||||
@@ -114,7 +176,6 @@ function applyToGenUI(modelName, modelType) {
|
||||
selectEl.value = modelName;
|
||||
}
|
||||
|
||||
// Sync raw JSON display
|
||||
const rawTextarea = document.getElementById("wfm-gen-raw-json");
|
||||
if (rawTextarea) {
|
||||
rawTextarea.value = JSON.stringify(comfyUI.currentWorkflow, null, 2);
|
||||
@@ -554,6 +615,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 +806,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 +815,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 +885,6 @@ function renderModelGrid() {
|
||||
|
||||
if (state.viewMode === "table") {
|
||||
renderTableView(grid, filtered);
|
||||
} else if (state.viewMode === "card") {
|
||||
renderCardView(grid, filtered);
|
||||
} else {
|
||||
renderThumbView(grid, filtered);
|
||||
}
|
||||
@@ -848,6 +902,12 @@ 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 showBatchBtn = ["checkpoint", "lora"].includes(state.activeModelType);
|
||||
const showStackBtn = state.activeModelType === "lora";
|
||||
const inBatch = showBatchBtn && isInBatch(modelName);
|
||||
const inStack = showStackBtn && isInStack(modelName);
|
||||
const batchClass = inBatch ? "wfm-batch-btn active" : "wfm-batch-btn";
|
||||
const stackClass = inStack ? "wfm-stack-btn active" : "wfm-stack-btn";
|
||||
|
||||
const card = document.createElement("div");
|
||||
card.className = "wfm-card";
|
||||
@@ -865,6 +925,8 @@ 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>
|
||||
${showBatchBtn ? `<button class="${batchClass}" title="${t("modelsBatch")}">B</button>` : ""}
|
||||
${showStackBtn ? `<button class="${stackClass}" title="Stack (Lora multi-apply)">S</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 +935,14 @@ 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-stack-btn")?.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleStack(modelName);
|
||||
});
|
||||
card.querySelector(".wfm-fav-btn").addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleFavorite(modelName);
|
||||
@@ -888,7 +958,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-stack-btn, .wfm-fav-btn, .wfm-toggle-btn")) return;
|
||||
toggleModelSelection(modelName);
|
||||
});
|
||||
} else {
|
||||
@@ -899,65 +969,12 @@ 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 ────────────────────────────────────────────
|
||||
|
||||
function renderTableView(grid, models) {
|
||||
const showBatchBtn = ["checkpoint", "lora"].includes(state.activeModelType);
|
||||
const showStackBtn = state.activeModelType === "lora";
|
||||
const rows = models
|
||||
.map((modelName) => {
|
||||
const meta = state.modelMetadata[modelName] || {};
|
||||
@@ -966,6 +983,8 @@ function renderTableView(grid, models) {
|
||||
const disabled = isModelDisabled(modelName);
|
||||
const isChecked = state.selectMode && state.selectedModels.has(modelName);
|
||||
const favIcon = meta.favorite ? "★" : "☆";
|
||||
const batchIcon = !showBatchBtn ? "" : isInBatch(modelName) ? `<button class="wfm-batch-btn active" title="${t("modelsBatch")}">B</button>` : `<button class="wfm-batch-btn" title="${t("modelsBatch")}">B</button>`;
|
||||
const stackIcon = isInStack(modelName) ? `<button class="wfm-stack-btn active" title="Stack (Lora multi-apply)">S</button>` : `<button class="wfm-stack-btn" title="Stack (Lora multi-apply)">S</button>`;
|
||||
const tagsStr = (meta.tags || []).join(", ");
|
||||
const memo = meta.memo || "";
|
||||
const toggleLabel = disabled ? t("modelEnable") : t("modelDisable");
|
||||
@@ -983,6 +1002,8 @@ 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>
|
||||
${showBatchBtn ? `<td class="wfm-table-td-batch">${batchIcon}</td>` : ""}
|
||||
${showStackBtn ? `<td class="wfm-table-td-stack">${stackIcon}</td>` : ""}
|
||||
</tr>`;
|
||||
})
|
||||
.join("");
|
||||
@@ -998,6 +1019,8 @@ function renderTableView(grid, models) {
|
||||
<th>${t("modelsTags")}</th>
|
||||
<th>${t("modelsMemo")}</th>
|
||||
<th style="width:50px;"></th>
|
||||
${showBatchBtn ? `<th style="width:30px;">B</th>` : ""}
|
||||
${showStackBtn ? `<th style="width:30px;">S</th>` : ""}
|
||||
</tr></thead><tbody>${rows}</tbody></table>`;
|
||||
|
||||
grid.querySelectorAll(".wfm-models-table-row").forEach((row) => {
|
||||
@@ -1007,7 +1030,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, .wfm-stack-btn")) return;
|
||||
toggleModelSelection(mn);
|
||||
});
|
||||
} else {
|
||||
@@ -1022,9 +1045,75 @@ function renderTableView(grid, models) {
|
||||
e.stopPropagation();
|
||||
toggleModelEnable(mn);
|
||||
});
|
||||
row.querySelector(".wfm-batch-btn")?.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleBatch(mn);
|
||||
});
|
||||
row.querySelector(".wfm-stack-btn")?.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleStack(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");
|
||||
}
|
||||
|
||||
function isInStack(modelName) {
|
||||
return (state.modelGroups["Stack"] || []).includes(modelName);
|
||||
}
|
||||
|
||||
async function toggleStack(modelName) {
|
||||
const stack = state.modelGroups["Stack"] || [];
|
||||
const idx = stack.indexOf(modelName);
|
||||
if (idx >= 0) {
|
||||
stack.splice(idx, 1);
|
||||
} else {
|
||||
stack.push(modelName);
|
||||
}
|
||||
state.modelGroups["Stack"] = stack;
|
||||
state.allModelGroups[state.activeModelType] = state.modelGroups;
|
||||
await saveModelGroups(state.modelGroups);
|
||||
renderModelGrid();
|
||||
}
|
||||
|
||||
async function clearStackGroup() {
|
||||
state.modelGroups["Stack"] = [];
|
||||
state.allModelGroups[state.activeModelType] = state.modelGroups;
|
||||
await saveModelGroups(state.modelGroups);
|
||||
renderModelGrid();
|
||||
showToast("Stack cleared", "success");
|
||||
}
|
||||
|
||||
// ── Favorite toggle ───────────────────────────────────────
|
||||
|
||||
async function toggleFavorite(modelName) {
|
||||
@@ -1198,12 +1287,12 @@ function showSidePanel(modelName) {
|
||||
const { name } = parseModelPath(modelName);
|
||||
document.getElementById("wfm-models-panel-title").textContent = name;
|
||||
|
||||
// Reset to Info tab
|
||||
// Reset to CivitAI tab
|
||||
document.querySelectorAll(".wfm-models-side-tab-btn").forEach((b) => b.classList.remove("active"));
|
||||
document.querySelector('.wfm-models-side-tab-btn[data-side-tab="info"]')?.classList.add("active");
|
||||
document.querySelector('.wfm-models-side-tab-btn[data-side-tab="civitai"]')?.classList.add("active");
|
||||
document.querySelectorAll(".wfm-models-side-content").forEach((c) => (c.style.display = "none"));
|
||||
const infoEl = document.getElementById("wfm-models-side-info");
|
||||
if (infoEl) infoEl.style.display = "block";
|
||||
const civitaiEl = document.getElementById("wfm-models-side-civitai");
|
||||
if (civitaiEl) civitaiEl.style.display = "block";
|
||||
|
||||
renderSideInfo(modelName);
|
||||
renderSideGroup(modelName);
|
||||
@@ -1439,6 +1528,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 +1551,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 +1593,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 +1681,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 +1731,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 +1798,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 +1825,14 @@ 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);
|
||||
}
|
||||
if (STACK_MODEL_TYPES.includes(type) && !state.modelGroups["Stack"]) {
|
||||
state.modelGroups["Stack"] = [];
|
||||
await saveModelGroups(state.modelGroups);
|
||||
}
|
||||
state.allModelGroups[type] = state.modelGroups;
|
||||
renderTagFilter();
|
||||
renderDirFilter();
|
||||
@@ -1647,6 +1852,14 @@ 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);
|
||||
}
|
||||
if (STACK_MODEL_TYPES.includes(type) && !groups["Stack"]) {
|
||||
groups["Stack"] = [];
|
||||
await saveModelGroups(groups);
|
||||
}
|
||||
state.modelGroups = groups;
|
||||
state.allModelGroups[type] = groups;
|
||||
|
||||
@@ -1888,6 +2101,24 @@ 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();
|
||||
});
|
||||
|
||||
// Stack clear
|
||||
document.getElementById("wfm-models-stack-clear-btn")?.addEventListener("click", () => {
|
||||
clearStackGroup();
|
||||
});
|
||||
|
||||
// View mode (thumb / card / table)
|
||||
document.querySelectorAll("[data-models-view]").forEach((btn) => {
|
||||
if (btn.dataset.modelsView === state.viewMode) {
|
||||
@@ -1933,6 +2164,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
@@ -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;">★</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">★</button>
|
||||
<button class="wfm-pm-action-btn pm-del-btn" title="Delete" style="color:var(--wfm-danger);">✕</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", () => {
|
||||
|
||||
@@ -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() || "";
|
||||
|
||||
+87
-18
@@ -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">★</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, """)}">${wf.metadata.memo || ""}</td>
|
||||
<td class="wfm-table-td-summary" title="${(wf.metadata.summary || "").replace(/"/g, """)}">${wf.metadata.summary || ""}</td>`;
|
||||
<td class="wfm-table-td-summary" title="${(wf.metadata.summary || "").replace(/"/g, """)}">${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) {
|
||||
@@ -884,6 +946,8 @@ function openDetailModal(wf) {
|
||||
showToast(t("renameError") + ": " + err.message, "error");
|
||||
}
|
||||
};
|
||||
if (titleInput._commitRename) titleInput.removeEventListener("blur", titleInput._commitRename);
|
||||
titleInput._commitRename = commitRename;
|
||||
titleInput.addEventListener("blur", commitRename);
|
||||
titleInput.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") { e.preventDefault(); titleInput.blur(); }
|
||||
@@ -1271,6 +1335,11 @@ export function initWorkflowTab() {
|
||||
openBadgeEditModal(() => renderGrid());
|
||||
});
|
||||
|
||||
// Toolbar: BC (batch clear) button
|
||||
document.getElementById("wfm-wf-batch-clear-btn")?.addEventListener("click", () => {
|
||||
clearBatch();
|
||||
});
|
||||
|
||||
// Initial load
|
||||
loadWorkflows();
|
||||
}
|
||||
|
||||
+401
-267
@@ -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">⊞</button>
|
||||
<button class="wfm-view-btn" data-view="card" title="Card">☰</button>
|
||||
<button class="wfm-view-btn" data-view="table" title="Table">≡</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">⚙</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">★</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">⊞</button>
|
||||
<button class="wfm-view-btn" data-models-view="card" title="Card">☰</button>
|
||||
<button class="wfm-view-btn" data-models-view="table" title="Table">≡</button>
|
||||
</div>
|
||||
<span id="wfm-models-count" class="wfm-nodes-count"></span>
|
||||
@@ -210,6 +210,8 @@
|
||||
<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">⚙ 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>
|
||||
<button id="wfm-models-stack-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all stack entries (Lora)">SC</button>
|
||||
</div>
|
||||
<!-- Bulk action bar (shown in select mode) -->
|
||||
<div id="wfm-models-bulk-bar" class="wfm-bulk-bar" style="display:none;"></div>
|
||||
@@ -251,6 +253,7 @@
|
||||
<span id="wfm-gen-status" class="wfm-gen-status disconnected">Disconnected</span>
|
||||
<button id="wfm-gen-connect-btn" class="wfm-btn wfm-btn-sm">Connect</button>
|
||||
<button id="wfm-gen-model-refresh-btn" class="wfm-btn wfm-btn-sm">Refresh Models</button>
|
||||
<button id="wfm-gen-reset-workflow-btn" class="wfm-btn wfm-btn-sm">Reset Workflow</button>
|
||||
</div>
|
||||
<div class="wfm-toolbar-right" style="display:flex;align-items:center;gap:8px;">
|
||||
<span id="wfm-gen-wf-name" style="color:var(--wfm-text-secondary);font-size:13px;">No workflow loaded</span>
|
||||
@@ -270,18 +273,20 @@
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="batch">Batch</button>
|
||||
</div>
|
||||
|
||||
<!-- Tab: Input — left sub-col: Prompt(top)+Image(bottom), right sub-col: Raw JSON -->
|
||||
<!-- Tab: Input — left sub-col: Prompt/Image (tabbed), right sub-col: Raw JSON -->
|
||||
<div id="wfm-gen-subtab-input" class="wfm-gen-subtab-content active">
|
||||
<div class="wfm-gen-tab-cols">
|
||||
<div class="wfm-gen-params-col">
|
||||
<div class="wfm-gen-params-section">
|
||||
<h3 class="wfm-gen-col-title">Prompt</h3>
|
||||
<div class="wfm-input-inner-tabnav">
|
||||
<button class="wfm-input-inner-tab active" data-input-tab="prompt">Prompt</button>
|
||||
<button class="wfm-input-inner-tab" data-input-tab="image">Image</button>
|
||||
</div>
|
||||
<div id="wfm-input-panel-prompt" class="wfm-input-inner-panel">
|
||||
<div id="wfm-gen-prompt-fields">
|
||||
<p class="wfm-placeholder">Load a workflow to edit prompts</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-gen-params-section wfm-gen-params-section--top-border">
|
||||
<h3 class="wfm-gen-col-title">Image</h3>
|
||||
<div id="wfm-input-panel-image" class="wfm-input-inner-panel" style="display:none;">
|
||||
<div id="wfm-gen-image-fields">
|
||||
<p class="wfm-placeholder">Load a workflow to set input images</p>
|
||||
</div>
|
||||
@@ -291,14 +296,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab: Model — left sub-col: model selects, right sub-col: Raw JSON -->
|
||||
<!-- Tab: Model — 3 panes: model selects | lora | Raw JSON -->
|
||||
<div id="wfm-gen-subtab-model" class="wfm-gen-subtab-content">
|
||||
<div class="wfm-gen-tab-cols">
|
||||
<div class="wfm-gen-params-col wfm-gen-params-col--scroll">
|
||||
<div class="wfm-gen-params-col wfm-gen-params-col--scroll wfm-gen-params-col--narrow">
|
||||
<div id="wfm-gen-model-fields">
|
||||
<p class="wfm-placeholder">Load a workflow to edit models</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-gen-lora-col">
|
||||
<div class="wfm-gen-lora-col-header">
|
||||
<span>LoRA</span>
|
||||
<button class="wfm-btn wfm-btn-xs wfm-lora-refresh-btn" id="wfm-lora-stack-refresh" title="Refresh Stack group">🔄</button>
|
||||
</div>
|
||||
<div id="wfm-gen-lora-fields" class="wfm-gen-lora-col-body">
|
||||
<p class="wfm-placeholder">Load a workflow to edit LoRA</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-gen-rawjson-col" id="wfm-gen-rawjson-col-model"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -317,15 +331,35 @@
|
||||
<!-- Tab: Batch — 3-pane: file tree | group select | queue preview -->
|
||||
<div id="wfm-gen-subtab-batch" class="wfm-gen-subtab-content">
|
||||
<div class="wfm-batch-layout">
|
||||
<!-- Left pane: file-tree checkpoint selection -->
|
||||
<!-- Left pane: tabbed checkpoint / sampler / scheduler -->
|
||||
<div class="wfm-batch-pane wfm-batch-left">
|
||||
<div class="wfm-batch-pane-header">Checkpoints</div>
|
||||
<div class="wfm-batch-toolbar">
|
||||
<input type="text" id="wfm-ckpt-search" class="wfm-input" placeholder="Filter...">
|
||||
<button type="button" id="wfm-ckpt-select-all" class="wfm-btn wfm-btn-sm">All</button>
|
||||
<button type="button" id="wfm-ckpt-deselect-all" class="wfm-btn wfm-btn-sm">None</button>
|
||||
<div class="wfm-batch-left-tab-nav">
|
||||
<button class="wfm-batch-left-tab active" data-left-tab="checkpoint">Checkpoints</button>
|
||||
<button class="wfm-batch-left-tab" data-left-tab="sampler">Sampler</button>
|
||||
<button class="wfm-batch-left-tab" data-left-tab="scheduler">Scheduler</button>
|
||||
</div>
|
||||
<div id="wfm-batch-left-checkpoint" class="wfm-batch-left-content active">
|
||||
<div class="wfm-batch-toolbar">
|
||||
<input type="text" id="wfm-ckpt-search" class="wfm-input" placeholder="Filter...">
|
||||
<button type="button" id="wfm-ckpt-select-all" class="wfm-btn wfm-btn-sm">All</button>
|
||||
<button type="button" id="wfm-ckpt-deselect-all" class="wfm-btn wfm-btn-sm">None</button>
|
||||
</div>
|
||||
<div id="wfm-ckpt-list" class="wfm-batch-list"></div>
|
||||
</div>
|
||||
<div id="wfm-batch-left-sampler" class="wfm-batch-left-content">
|
||||
<div class="wfm-batch-toolbar">
|
||||
<button type="button" id="wfm-sampler-select-all" class="wfm-btn wfm-btn-sm">All</button>
|
||||
<button type="button" id="wfm-sampler-deselect-all" class="wfm-btn wfm-btn-sm">None</button>
|
||||
</div>
|
||||
<div id="wfm-sampler-list" class="wfm-batch-list"></div>
|
||||
</div>
|
||||
<div id="wfm-batch-left-scheduler" class="wfm-batch-left-content">
|
||||
<div class="wfm-batch-toolbar">
|
||||
<button type="button" id="wfm-scheduler-select-all" class="wfm-btn wfm-btn-sm">All</button>
|
||||
<button type="button" id="wfm-scheduler-deselect-all" class="wfm-btn wfm-btn-sm">None</button>
|
||||
</div>
|
||||
<div id="wfm-scheduler-list" class="wfm-batch-list"></div>
|
||||
</div>
|
||||
<div id="wfm-ckpt-list" class="wfm-batch-list"></div>
|
||||
</div>
|
||||
|
||||
<!-- Center pane: group-based selection with inner tabs -->
|
||||
@@ -341,21 +375,72 @@
|
||||
<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 (6 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 class="wfm-batch-queue-col">
|
||||
<div class="wfm-batch-queue-col-header">
|
||||
<span>Sampler</span>
|
||||
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="sampler" title="Sampler batch を有効にする">
|
||||
</div>
|
||||
<div id="wfm-batch-sampler-count" class="wfm-batch-count"></div>
|
||||
<div id="wfm-batch-sampler-list" class="wfm-batch-preview-list"></div>
|
||||
</div>
|
||||
<div class="wfm-batch-queue-col">
|
||||
<div class="wfm-batch-queue-col-header">
|
||||
<span>Scheduler</span>
|
||||
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="scheduler" title="Scheduler batch を有効にする">
|
||||
</div>
|
||||
<div id="wfm-batch-scheduler-count" class="wfm-batch-count"></div>
|
||||
<div id="wfm-batch-scheduler-list" class="wfm-batch-preview-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -463,16 +548,16 @@
|
||||
<div class="wfm-feeder-grid-msg">Select a folder</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preview -->
|
||||
<div class="wfm-feeder-preview-pane">
|
||||
<div class="wfm-feeder-pane-header">Preview</div>
|
||||
<img id="wfm-feeder-preview-img" class="wfm-feeder-preview-img" style="display:none;" alt="">
|
||||
<div id="wfm-feeder-preview-name" class="wfm-feeder-preview-name"></div>
|
||||
<pre id="wfm-feeder-preview-info" class="wfm-feeder-preview-info"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right: Preview -->
|
||||
<div class="wfm-feeder-preview-pane">
|
||||
<div class="wfm-feeder-pane-header">Preview</div>
|
||||
<img id="wfm-feeder-preview-img" class="wfm-feeder-preview-img" style="display:none;" alt="">
|
||||
<div id="wfm-feeder-preview-name" class="wfm-feeder-preview-name"></div>
|
||||
<pre id="wfm-feeder-preview-info" class="wfm-feeder-preview-info"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -509,14 +594,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 +744,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>
|
||||
@@ -817,241 +903,289 @@
|
||||
|
||||
<!-- Help & Support Tab -->
|
||||
<section id="wfm-tab-help" class="wfm-tab-content">
|
||||
<div class="wfm-help-container">
|
||||
<!-- Help Section -->
|
||||
<div class="wfm-help-section">
|
||||
<h2 class="wfm-help-section-title" id="wfm-help-manual-title">Features</h2>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-about-title">About</h3>
|
||||
<p id="wfm-help-about-desc">A centralized control UI for managing ComfyUI workflow JSON files, generating images via API, assisting with prompt creation, and browsing/organizing nodes.</p>
|
||||
<ul>
|
||||
<li id="wfm-help-about-1">Install via ComfyUI Manager or git clone to custom_nodes</li>
|
||||
<li id="wfm-help-about-2">Launch from the Workflow Studio button in the ComfyUI toolbar, or open http://127.0.0.1:8188/wfm</li>
|
||||
</ul>
|
||||
<div class="wfm-help-layout">
|
||||
<!-- Left Sidebar -->
|
||||
<nav class="wfm-help-sidebar">
|
||||
<div class="wfm-help-nav">
|
||||
<button class="wfm-help-nav-item active" data-help-page="about">About</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="workflow">Workflow Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="generate">GenerateUI Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="feeder">Feeder subtab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="prompt">Prompt Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="metadata">Metadata Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="settings">Settings Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="nodes">Nodes Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="gallery">Gallery Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="models">Models Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="sidepanel">Library (Side Panel)</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="aitool">AI TOOL Tab</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="shortcuts">Keyboard Shortcuts</button>
|
||||
<button class="wfm-help-nav-item" data-help-page="trouble">Troubleshooting</button>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3>Workflow Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-wf-1">Switch between Thumbnail, Card, and Table view modes</li>
|
||||
<li id="wfm-help-wf-2">Search, category filter, favorites filter, and group filter</li>
|
||||
<li id="wfm-help-wf-3">Create, rename, delete groups and assign/remove workflows</li>
|
||||
<li id="wfm-help-wf-4">Import JSON/PNG files via button or drag & drop</li>
|
||||
<li id="wfm-help-wf-5">Side panel: thumbnail, JSON viewer (format badge: UI/API/App), clipboard copy, group management</li>
|
||||
<li id="wfm-help-wf-6">Detail modal: rename, favorite, thumbnail change, badge assignment, tags, memo, AI summary, open in ComfyUI, load in GenerateUI, set as default, delete</li>
|
||||
<li id="wfm-help-wf-7">Badge management: add, rename, delete badges with custom colors shared with the Models tab (⚙ Badge button)</li>
|
||||
</ul>
|
||||
<div class="wfm-help-sidebar-support">
|
||||
<button class="wfm-help-nav-item" data-help-page="support">Support</button>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- Right Content Pane -->
|
||||
<div class="wfm-help-content">
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3>GenerateUI Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-gen-1">Connect/disconnect ComfyUI and check connection status</li>
|
||||
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported)</li>
|
||||
<li id="wfm-help-gen-3">5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
|
||||
<li id="wfm-help-gen-4">Input tab: Prompt (top) and Image drag-and-drop (bottom) in the left column</li>
|
||||
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter</li>
|
||||
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
|
||||
<li id="wfm-help-gen-7">Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow</li>
|
||||
<li id="wfm-help-gen-8">Seed control: random, fixed, increment, decrement — seed input and mode selector stacked vertically for readability</li>
|
||||
<li id="wfm-help-gen-9">Generate, progress display, stop, and view results</li>
|
||||
<li id="wfm-help-gen-10">Eagle integration: auto-save generated images to Eagle</li>
|
||||
<li id="wfm-help-gen-11">Checkpoint Batch toggle (right panel): enable/disable batch mode — when enabled, Generate runs through all queued checkpoints sequentially with Pause/Resume and Stop controls</li>
|
||||
<li id="wfm-help-gen-12">Batch tab — 3-pane layout: Left pane (file tree) selects checkpoints by folder; use Filter to narrow the list, All/None buttons to select or clear all; initial state is all unchecked</li>
|
||||
<li id="wfm-help-gen-13">Batch tab — Center pane: group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint tab shows groups defined in the Models tab — check a group header to select all its members, or expand ▶ to check individual models; group membership always reflects the current Models tab state</li>
|
||||
<li id="wfm-help-gen-14">Batch tab — Right pane (Batch Queue): live preview of all checkpoints that will be processed, combining file-tree and group selections with duplicates removed; count shown at top</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-feeder-title">GenerateUI Tab — Feeder subtab</h3>
|
||||
<p id="wfm-help-feeder-desc">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/.</p>
|
||||
<ul>
|
||||
<li id="wfm-help-feeder-1">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</li>
|
||||
<li id="wfm-help-feeder-2">Left pane — Presets: save the current directory + selection as a named preset; load or delete saved presets</li>
|
||||
<li id="wfm-help-feeder-3">Left pane — Run: After gen mode determines index behavior after each generation — Loop (wrap back to 0 and continue indefinitely), Increment (advance index and stop when all images are exhausted), Fixed (always use the same index); click Run to start the loop, Stop to interrupt</li>
|
||||
<li id="wfm-help-feeder-4">Center pane — Folder tree: browse subfolders inside image-loop-data; click a folder to load its images; click ↺ to reload the tree</li>
|
||||
<li id="wfm-help-feeder-5">Center pane — Image grid: displays thumbnails of all images in the selected folder; check individual images to add them to the selection; All / None buttons select or clear the entire folder; click an image to open the preview panel</li>
|
||||
<li id="wfm-help-feeder-6">Center pane — Preview panel: shows the clicked image at larger size with filename, resolution, and file size</li>
|
||||
<li id="wfm-help-feeder-7">Status bar: shows the current folder path and how many images are selected out of the total in the folder</li>
|
||||
<li id="wfm-help-feeder-8">Seed during Run: uses the right-pane seed setting (Random / Fixed / Increment / Decrement) — the ImageFeeder's own Seed field controls random sort order only</li>
|
||||
<li id="wfm-help-feeder-9">Index sync: after each generation the node returns the next index via WebSocket; the Index field updates automatically so the display stays in sync</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3>Prompt Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-prompt-1">AI assistant (Ollama): model selection, chat for prompt consultation, image attachment (vision models)</li>
|
||||
<li id="wfm-help-prompt-2">Apply AI responses to GenerateUI prompts</li>
|
||||
<li id="wfm-help-prompt-3">Translation: JA↔EN, ZH↔EN</li>
|
||||
<li id="wfm-help-prompt-4">Preset management: create, edit, positive/negative prompt clipboard copy (PP/NP)</li>
|
||||
<li id="wfm-help-prompt-5">Preset Manager: browse all presets, favorites, and group-based filtering</li>
|
||||
<li id="wfm-help-prompt-6">Group management: create groups, assign/remove presets, delete groups</li>
|
||||
<li id="wfm-help-prompt-7">GenUI Set: apply preset prompts directly to GenerateUI</li>
|
||||
<li id="wfm-help-prompt-8">Wildcard toolbar: one-click buttons to insert wildcard syntax ({|}, {n$|}, __|__, <lora:>, etc.); wraps selected text</li>
|
||||
<li id="wfm-help-prompt-9">Wildcard file manager: create/edit/delete .txt/.yaml wildcard files; click filename to insert __filename__ at cursor</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-metadata-title">Metadata Tab</h3>
|
||||
<p id="wfm-help-metadata-desc">Drop a ComfyUI-generated PNG/WebP or workflow JSON to instantly extract and view the embedded model and prompt information.</p>
|
||||
<ul>
|
||||
<li id="wfm-help-metadata-1">Left column: drop zone (image preview for PNG/WebP) and file info; click or drop to load</li>
|
||||
<li id="wfm-help-metadata-2">Center column: Checkpoint, VAE, Diffusion Model, and Text Encoder lists extracted from the workflow</li>
|
||||
<li id="wfm-help-metadata-3">Right column: LoRA list (with strength values) and Prompt list (click to view full text below)</li>
|
||||
<li id="wfm-help-metadata-4">Prompt actions — Copy: copy to clipboard; GenUI:P/N: set GenerateUI positive/negative prompt; Prompt:P/N: set Prompt tab preset positive/negative</li>
|
||||
<li id="wfm-help-metadata-5">Supported: ComfyUI PNG/WebP/JSON (standard + Flux.2 / Qwen-Image / Z-Image subgraph workflows), SD WebUI, SD Forge, Fooocus. Model extraction covers UNETLoader, UnetLoaderGGUF, UNETLoaderGGUF (e.g. HiDream GGUF), CLIPLoader, DualCLIPLoader, TripleCLIPLoader, and QuadrupleCLIPLoader (e.g. HiDream 4-CLIP).</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3>Settings Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-settings-1">UI language and summary language</li>
|
||||
<li id="wfm-help-settings-2">Theme selection (13 presets) with customization: color overrides, background patterns (stripes, polka dot, checkerboard, SVG tiling), and font selection (16 Google Fonts including Japanese display fonts)</li>
|
||||
<li id="wfm-help-settings-3">Workflow data folder path</li>
|
||||
<li id="wfm-help-settings-4">ComfyUI connection URL and test</li>
|
||||
<li id="wfm-help-settings-5">Ollama URL, default model, and connection test</li>
|
||||
<li id="wfm-help-settings-6">Default workflow setting</li>
|
||||
<li id="wfm-help-settings-7">Eagle integration URL and auto-save toggle</li>
|
||||
<li id="wfm-help-settings-8">Data Management: export all plugin data to JSON / import to restore</li>
|
||||
<li id="wfm-help-settings-9">All sections are collapsible accordion panels</li>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3>Nodes Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-nodes-1">Node Browser: search by name/description/alias/tag, filter by category, package, tag, group, favorites</li>
|
||||
<li id="wfm-help-nodes-2">Card and Table view modes with pagination</li>
|
||||
<li id="wfm-help-nodes-3">Favorite nodes and add custom tags for organization</li>
|
||||
<li id="wfm-help-nodes-4">Create, rename, delete node groups and assign/remove nodes</li>
|
||||
<li id="wfm-help-nodes-5">Side panel: Details (class name, package, category, description, flags), I/O Spec (inputs/outputs with types and defaults), Groups management</li>
|
||||
<li id="wfm-help-nodes-6">Node Sets: create reusable node collections with descriptions, tags, and link definitions between nodes</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-gallery-title">Gallery Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-gallery-1">Browse images in the ComfyUI output folder — set the folder path in Settings > Gallery Output Folder</li>
|
||||
<li id="wfm-help-gallery-2">3-column layout: folder tree (left) | image grid (center) | detail panel (right)</li>
|
||||
<li id="wfm-help-gallery-3">Thumbnail and Table view modes; double-click any image to open fullscreen lightbox</li>
|
||||
<li id="wfm-help-gallery-4">Toolbar filters: favorites (★), text search, tag filter, group filter, sort by date/name</li>
|
||||
<li id="wfm-help-gallery-5">Folder tree: click to load images, expand with ▶; "+ New" creates a subfolder inside the selected folder, "Del" deletes it with all contents</li>
|
||||
<li id="wfm-help-gallery-6">Multi-select with Ctrl+click — bulk operations: Add to Group, Favorite All, Unfavorite All, Move To..., Delete</li>
|
||||
<li id="wfm-help-gallery-7">Detail panel — Info tab: filename, size, date, tags (add/remove), memo; "Move To..." moves the image to another folder, "Delete" removes it permanently</li>
|
||||
<li id="wfm-help-gallery-8">Detail panel — Metadata tab: displays workflow JSON from PNG embedded data (prompt / workflow keys) or from metadata saved by the Generate UI tab; one-click clipboard copy</li>
|
||||
<li id="wfm-help-gallery-9">Detail panel — Groups tab: create, assign, remove, rename, and delete groups per image</li>
|
||||
<li id="wfm-help-gallery-10">Workflow auto-save: images generated in the Generate UI tab automatically have their workflow saved to gallery metadata and shown in the Metadata tab</li>
|
||||
<li id="wfm-help-gallery-11">Supports PNG (tEXt/iTXt), JPEG, WebP, GIF; workflow extraction reads ComfyUI prompt and workflow keys embedded in PNG metadata</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3>Models Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-models-1">Browse installed models: Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding with sub-tab switching</li>
|
||||
<li id="wfm-help-models-2">Thumbnail, Card, and Table view modes with pagination</li>
|
||||
<li id="wfm-help-models-3">Search, tag filter, group filter, favorites filter, and status filter (All / Enabled only / Disabled only)</li>
|
||||
<li id="wfm-help-models-4">Side panel: Info (file path, tags, memo), Groups management, CivitAI integration</li>
|
||||
<li id="wfm-help-models-5">CivitAI integration: fetch model info by SHA256 hash, batch fetch per model type</li>
|
||||
<li id="wfm-help-models-6">Detail modal: preview image, CivitAI info (base model, trained words, tags), thumbnail change</li>
|
||||
<li id="wfm-help-models-7">Group management: create, rename, delete groups and assign/remove models</li>
|
||||
<li id="wfm-help-models-8">GenUI Model button: apply the selected model to the corresponding node in GenerateUI's current workflow (Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)</li>
|
||||
<li id="wfm-help-models-9">User-defined badges: assign free-label badges with custom colors shared with the Workflow tab</li>
|
||||
<li id="wfm-help-models-10">Enable/Disable models: toggle visibility in ComfyUI by renaming file extension (.disabled suffix). Disable per model (⏸ button on each card) or per group (Enable All / Disable All in Group panel). Changes take effect after ComfyUI refresh.</li>
|
||||
<li id="wfm-help-models-11">Multi-select & bulk operations: click Select to enter selection mode, then check multiple models; the bulk action bar provides: Deselect All — clear all selections without exiting select mode; ★ Favorite / ☆ Unfavorite — toggle favorites for all selected models; Add to Group / Remove from Group — assign or remove from an existing group; Create & Add — type a new group name and add all selected; +Badge / −Badge — apply or remove a badge from all selected; Delete Files — permanently remove model files, preview images, and sidecar files (.json/.info)</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-sidepanel-title">Workflow Studio Library (ComfyUI Side Panel)</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-sidepanel-1">Open from the Workflow Studio Library button in the ComfyUI toolbar</li>
|
||||
<li id="wfm-help-sidepanel-2">Workflows tab: All / ★ Favorites / Groups sub-tabs; ★ shown for favorites in All view</li>
|
||||
<li id="wfm-help-sidepanel-3">Nodes tab: All / ★ Favorites / Groups / Sets / 📂 Category / 🧩 Package sub-tabs; Category and Package show a dropdown to filter nodes</li>
|
||||
<li id="wfm-help-sidepanel-11">Models tab: All / ★ Favorites / Groups / By Type sub-tabs</li>
|
||||
<li id="wfm-help-sidepanel-4">Prompts tab: browse prompt presets with All/Favorites/Categories sub-tabs</li>
|
||||
<li id="wfm-help-sidepanel-5">Drag & drop workflows onto the canvas to load them</li>
|
||||
<li id="wfm-help-sidepanel-6">Drag & drop nodes/node sets onto the canvas to place them</li>
|
||||
<li id="wfm-help-sidepanel-7">Drag & drop prompt presets to create WFS_PromptText nodes with positive/negative prompts</li>
|
||||
<li id="wfm-help-sidepanel-8">Copy individual positive (P) or negative (N) prompts from sidebar items</li>
|
||||
<li id="wfm-help-sidepanel-9">Double-click items to load/place without dragging</li>
|
||||
<li id="wfm-help-sidepanel-10">Search within each sub-tab to quickly find items</li>
|
||||
<li id="wfm-help-sidepanel-12">⚙ Theme button (header): customize panel background, text, border colors — saved to localStorage</li>
|
||||
<li id="wfm-help-sidepanel-13">I tab (Information): drop a ComfyUI PNG/WebP/JSON to inspect model, LoRA, and prompt metadata in the side panel — sub-tabs: model / lora / Prompts; supports UnetLoaderGGUF and QuadrupleCLIPLoader node types</li>
|
||||
<li id="wfm-help-sidepanel-14">Information tab — drag items to canvas: model sub-tab places the loader node (Checkpoint → CheckpointLoaderSimple, VAE → VAELoader, Diffusion Model → UNETLoader, Text Encoder → CLIPLoader); double-click also places at canvas center</li>
|
||||
<li id="wfm-help-sidepanel-15">Information tab — LoRA sub-tab: drag individual LoRA to place LoraLoader; "Multiple LORA" section at bottom places all LoRAs in a single Lora Loader (LoraManager) node; Prompts sub-tab: drag a prompt to place CLIPTextEncode node with text pre-filled; click prompt to view full text and copy</li>
|
||||
<li id="wfm-help-sidepanel-16">AI TOOL tab: Translation and TOOLS (VLM) panes powered by Ollama or LM Studio; 3-pane layout (Translation | TOOLS | Settings) always visible; settings (backend, URL, model) are shared with the SPA AI TOOL tab via localStorage</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-ai-title">AI TOOL Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-ai-1">3-pane layout — Translation (40%) | TOOLS (40%) | Settings (20%) — all panes are always visible simultaneously</li>
|
||||
<li id="wfm-help-ai-2">Translation pane: translate text between Japanese, English, Chinese, or a custom Free language using Ollama or LM Studio; language selectors with ⇄ swap button; text content is also swapped on swap; selections are saved automatically</li>
|
||||
<li id="wfm-help-ai-3">TOOLS pane (VLM): drop an image into the drop zone and select a task — Describe Image or Create Prompt — then click Run to analyze with a vision model; result displayed with Copy button</li>
|
||||
<li id="wfm-help-ai-4">Settings pane: choose backend (Ollama / LM Studio), set the API URL, test connection, select model, and configure Free language names for translation</li>
|
||||
<li id="wfm-help-ai-5">Settings are saved to localStorage and shared with the Library panel's AI TOOL tab</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-shortcuts-title">Keyboard Shortcuts</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-shortcuts-1">Escape: Close modal/panel</li>
|
||||
<li id="wfm-help-shortcuts-2">Enter: Confirm rename, send chat</li>
|
||||
<li id="wfm-help-shortcuts-3">Shift+Enter: New line in chat</li>
|
||||
<li id="wfm-help-shortcuts-4">Double-click: Open detail modal</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-trouble-title">Troubleshooting</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-trouble-1">Cannot connect to ComfyUI: Check if ComfyUI can generate images, verify URL in Settings, try refreshing or restarting</li>
|
||||
<li id="wfm-help-trouble-2">Cannot connect to Ollama: Use connection test button, check if Ollama is running and models are downloaded</li>
|
||||
<li id="wfm-help-trouble-3">Workflows not showing: Click refresh button, check if loadable in ComfyUI, try restarting browser/ComfyUI</li>
|
||||
<li id="wfm-help-trouble-4">Image generation fails: Check if specified models exist in ComfyUI, verify connection, try restarting</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Support Section -->
|
||||
<div class="wfm-help-section">
|
||||
<h2 class="wfm-help-section-title" id="wfm-help-support-title">Support</h2>
|
||||
|
||||
<div class="wfm-help-card wfm-help-support-card">
|
||||
<p id="wfm-help-support-desc">If you find this plugin useful, please consider supporting its development!</p>
|
||||
|
||||
<div class="wfm-help-links">
|
||||
<a href="https://github.com/ketle-man/ComfyUI-Workflow-Studio" target="_blank" rel="noopener noreferrer" class="wfm-help-link wfm-help-link-github">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
|
||||
<div>
|
||||
<div class="wfm-help-link-title">GitHub</div>
|
||||
<div class="wfm-help-link-desc" id="wfm-help-github-desc">Report issues, request features, and contribute</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="https://ko-fi.com/ninnin90033" target="_blank" rel="noopener noreferrer" class="wfm-help-link wfm-help-link-kofi">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M23.881 8.948c-.773-4.085-4.859-4.593-4.859-4.593H.723c-.604 0-.679.798-.679.798s-.082 7.324-.022 11.822c.164 2.424 2.586 2.672 2.586 2.672s8.267-.023 11.966-.049c2.438-.426 2.683-2.566 2.658-3.734 4.352.24 7.422-2.831 6.649-6.916zm-11.062 3.511c-1.246 1.453-4.011 3.976-4.011 3.976s-.121.119-.31.023c-.076-.057-.108-.09-.108-.09-.443-.441-3.368-3.049-4.034-3.954-.709-.965-1.041-2.7-.091-3.71.951-1.01 3.005-1.086 4.363.407 0 0 1.565-1.782 3.468-.963 1.904.82 1.832 3.011.723 4.311zm6.173.478c-.928.116-1.682.028-1.682.028V7.284h1.77s1.971.551 1.971 2.638c0 1.913-.985 2.667-2.059 3.015z"/></svg>
|
||||
<div>
|
||||
<div class="wfm-help-link-title">Ko-fi</div>
|
||||
<div class="wfm-help-link-desc" id="wfm-help-kofi-desc">Buy me a coffee to support development</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="wfm-help-page active" id="wfm-help-page-about">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-about-title">About</h3>
|
||||
<p id="wfm-help-about-desc">A centralized control UI for managing ComfyUI workflow JSON files, generating images via API, assisting with prompt creation, and browsing/organizing nodes.</p>
|
||||
<ul>
|
||||
<li id="wfm-help-about-1">Install via ComfyUI Manager or git clone to custom_nodes</li>
|
||||
<li id="wfm-help-about-2">Launch from the Workflow Studio button in the ComfyUI toolbar, or open http://127.0.0.1:8188/wfm</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p class="wfm-help-thanks" id="wfm-help-thanks">Thank you for using Workflow Studio!</p>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-workflow">
|
||||
<div class="wfm-help-card">
|
||||
<h3>Workflow Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-wf-1">Switch between Thumbnail, Card, and Table view modes</li>
|
||||
<li id="wfm-help-wf-2">Search, category filter, favorites filter, and group filter</li>
|
||||
<li id="wfm-help-wf-3">Create, rename, delete groups and assign/remove workflows</li>
|
||||
<li id="wfm-help-wf-4">Import JSON/PNG files via button or drag & drop</li>
|
||||
<li id="wfm-help-wf-5">Side panel: thumbnail, JSON viewer (format badge: UI/API/App), clipboard copy, group management</li>
|
||||
<li id="wfm-help-wf-6">Detail modal: rename, favorite, thumbnail change, badge assignment, tags, memo, AI summary, open in ComfyUI, load in GenerateUI, set as default, delete</li>
|
||||
<li id="wfm-help-wf-7">Badge management: add, rename, delete badges with custom colors shared with the Models tab (⚙ Badge button)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-generate">
|
||||
<div class="wfm-help-card">
|
||||
<h3>GenerateUI Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-gen-1">Connect/disconnect ComfyUI and check connection status</li>
|
||||
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor</li>
|
||||
<li id="wfm-help-gen-3">5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
|
||||
<li id="wfm-help-gen-4">Input tab: inner tabs — Prompt (positive/negative textboxes with doubled height) and Image (drag-and-drop upload); switch between tabs with the tab bar at the top of the left column</li>
|
||||
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones</li>
|
||||
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
|
||||
<li id="wfm-help-gen-7">Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow</li>
|
||||
<li id="wfm-help-gen-8">Seed control: random, fixed, increment, decrement — seed input and mode selector stacked vertically for readability</li>
|
||||
<li id="wfm-help-gen-9">Generate, progress display, stop, and view results</li>
|
||||
<li id="wfm-help-gen-10">Eagle integration: auto-save generated images to Eagle</li>
|
||||
<li id="wfm-help-gen-11">Batch tab — enable one batch type at a time by checking the checkbox in the Batch Queue column header; Generate then runs through all queued items sequentially with Pause/Resume and Stop controls</li>
|
||||
<li id="wfm-help-gen-12">Batch tab — Left pane has 3 tabs: <b>Checkpoints</b> (folder tree with Filter/All/None; (root) header checkbox selects all), <b>Sampler</b> (KSampler sampler_name list with (root) checkbox), <b>Scheduler</b> (KSampler scheduler list with (root) checkbox); All/None toolbar buttons also available for each tab</li>
|
||||
<li id="wfm-help-gen-13">Batch tab — Center pane: group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint tab shows groups defined in the Models tab — check a group header to select all its members, or expand ▶ to check individual models; group membership always reflects the current Models tab state</li>
|
||||
<li id="wfm-help-gen-14">Batch tab — Right pane (Batch Queue): 6 columns — Checkpoint, Lora, Prompt, Workflow, Sampler, Scheduler; each column has an enable checkbox; only one type active at a time; count shown per column</li>
|
||||
<li id="wfm-help-gen-15">Sampler/Scheduler batch: select one or more samplers or schedulers from the left pane, enable the column in Batch Queue, then Generate to run each value through the KSampler node sequentially; sampler/scheduler lists are fetched from ComfyUI (requires connection)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-feeder">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-feeder-title">GenerateUI Tab — Feeder subtab</h3>
|
||||
<p id="wfm-help-feeder-desc">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/.</p>
|
||||
<ul>
|
||||
<li id="wfm-help-feeder-1">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</li>
|
||||
<li id="wfm-help-feeder-2">Left pane — Presets: save the current directory + selection as a named preset; load or delete saved presets</li>
|
||||
<li id="wfm-help-feeder-3">Left pane — Run: After gen mode determines index behavior after each generation — Loop (wrap back to 0 and continue indefinitely), Increment (advance index and stop when all images are exhausted), Fixed (always use the same index); click Run to start the loop, Stop to interrupt</li>
|
||||
<li id="wfm-help-feeder-4">Center pane — Folder tree: browse subfolders inside image-loop-data; (root) is selected automatically on load; click a folder to load its images; click ↺ to reload the tree</li>
|
||||
<li id="wfm-help-feeder-5">Center pane — Image grid: displays thumbnails of all images in the selected folder; check individual images to add them to the selection; All / None buttons select or clear the entire folder; click an image to open the preview panel</li>
|
||||
<li id="wfm-help-feeder-6">Right pane — Preview: fixed at the far right of the layout; shows the clicked image at larger size with filename, resolution, and file size; during a RUN the preview updates automatically to show the current processing image</li>
|
||||
<li id="wfm-help-feeder-7">Status bar: shows the current folder path and how many images are selected out of the total in the folder</li>
|
||||
<li id="wfm-help-feeder-8">Seed during Run: uses the right-pane seed setting (Random / Fixed / Increment / Decrement) — the ImageFeeder's own Seed field controls random sort order only</li>
|
||||
<li id="wfm-help-feeder-9">Index sync: after each generation the node returns the next index via WebSocket; the Index field updates automatically so the display stays in sync</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-prompt">
|
||||
<div class="wfm-help-card">
|
||||
<h3>Prompt Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-prompt-1">AI assistant (Ollama): model selection, chat for prompt consultation, image attachment (vision models)</li>
|
||||
<li id="wfm-help-prompt-2">Apply AI responses to GenerateUI prompts</li>
|
||||
<li id="wfm-help-prompt-3">Translation: JA↔EN, ZH↔EN</li>
|
||||
<li id="wfm-help-prompt-4">Preset management: create, edit, positive/negative prompt clipboard copy (PP/NP)</li>
|
||||
<li id="wfm-help-prompt-5">Preset Manager: browse all presets, favorites, and group-based filtering</li>
|
||||
<li id="wfm-help-prompt-6">Group management: create groups, assign/remove presets, delete groups</li>
|
||||
<li id="wfm-help-prompt-7">GenUI Set: apply preset prompts directly to GenerateUI</li>
|
||||
<li id="wfm-help-prompt-8">Wildcard toolbar: one-click buttons to insert wildcard syntax ({|}, {n$|}, __|__, <lora:>, etc.); wraps selected text</li>
|
||||
<li id="wfm-help-prompt-9">Wildcard file manager: create/edit/delete .txt/.yaml wildcard files; click filename to insert __filename__ at cursor</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-metadata">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-metadata-title">Metadata Tab</h3>
|
||||
<p id="wfm-help-metadata-desc">Drop a ComfyUI-generated PNG/WebP or workflow JSON to instantly extract and view the embedded model and prompt information.</p>
|
||||
<ul>
|
||||
<li id="wfm-help-metadata-1">Left column: drop zone (image preview for PNG/WebP) and file info; click or drop to load</li>
|
||||
<li id="wfm-help-metadata-2">Center column: Checkpoint, VAE, Diffusion Model, and Text Encoder lists extracted from the workflow</li>
|
||||
<li id="wfm-help-metadata-3">Right column: LoRA list (with strength values) and Prompt list (click to view full text below)</li>
|
||||
<li id="wfm-help-metadata-4">Prompt actions — Copy: copy to clipboard; GenUI:P/N: set GenerateUI positive/negative prompt; Prompt:P/N: set Prompt tab preset positive/negative</li>
|
||||
<li id="wfm-help-metadata-5">Supported: ComfyUI PNG/WebP/JSON (standard + Flux.2 / Qwen-Image / Z-Image subgraph workflows), SD WebUI, SD Forge, Fooocus. Model extraction covers UNETLoader, UnetLoaderGGUF, UNETLoaderGGUF (e.g. HiDream GGUF), CLIPLoader, DualCLIPLoader, TripleCLIPLoader, and QuadrupleCLIPLoader (e.g. HiDream 4-CLIP).</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-settings">
|
||||
<div class="wfm-help-card">
|
||||
<h3>Settings Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-settings-1">UI language and summary language</li>
|
||||
<li id="wfm-help-settings-2">Theme selection (13 presets) with customization: color overrides, background patterns (stripes, polka dot, checkerboard, SVG tiling), and font selection (16 Google Fonts including Japanese display fonts)</li>
|
||||
<li id="wfm-help-settings-3">Workflow data folder path</li>
|
||||
<li id="wfm-help-settings-4">ComfyUI connection URL and test</li>
|
||||
<li id="wfm-help-settings-5">Ollama URL, default model, and connection test</li>
|
||||
<li id="wfm-help-settings-6">Default workflow setting</li>
|
||||
<li id="wfm-help-settings-7">Eagle integration URL and auto-save toggle</li>
|
||||
<li id="wfm-help-settings-8">Data Management: export all plugin data to JSON / import to restore</li>
|
||||
<li id="wfm-help-settings-9">All sections are collapsible accordion panels</li>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-nodes">
|
||||
<div class="wfm-help-card">
|
||||
<h3>Nodes Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-nodes-1">Node Browser: search by name/description/alias/tag, filter by category, package, tag, group, favorites</li>
|
||||
<li id="wfm-help-nodes-2">Card and Table view modes with pagination</li>
|
||||
<li id="wfm-help-nodes-3">Favorite nodes and add custom tags for organization</li>
|
||||
<li id="wfm-help-nodes-4">Create, rename, delete node groups and assign/remove nodes</li>
|
||||
<li id="wfm-help-nodes-5">Side panel: Details (class name, package, category, description, flags), I/O Spec (inputs/outputs with types and defaults), Groups management</li>
|
||||
<li id="wfm-help-nodes-6">Node Sets: create reusable node collections with descriptions, tags, and link definitions between nodes</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-gallery">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-gallery-title">Gallery Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-gallery-1">Browse images in the ComfyUI output folder — set the folder path in Settings > Gallery Output Folder</li>
|
||||
<li id="wfm-help-gallery-2">3-column layout: folder tree (left) | image grid (center) | detail panel (right)</li>
|
||||
<li id="wfm-help-gallery-3">Thumbnail and Table view modes; double-click any image to open fullscreen lightbox</li>
|
||||
<li id="wfm-help-gallery-4">Toolbar filters: favorites (★), text search, tag filter, group filter, sort by date/name</li>
|
||||
<li id="wfm-help-gallery-5">Folder tree: click to load images, expand with ▶; "+ New" creates a subfolder inside the selected folder, "Del" deletes it with all contents</li>
|
||||
<li id="wfm-help-gallery-6">Multi-select with Ctrl+click — bulk operations: Add to Group, Favorite All, Unfavorite All, Move To..., Delete</li>
|
||||
<li id="wfm-help-gallery-7">Detail panel — Info tab: filename, size, date, tags (add/remove), memo; "Move To..." moves the image to another folder, "Delete" removes it permanently</li>
|
||||
<li id="wfm-help-gallery-8">Detail panel — Metadata tab: displays workflow JSON from PNG embedded data (prompt / workflow keys) or from metadata saved by the Generate UI tab; one-click clipboard copy</li>
|
||||
<li id="wfm-help-gallery-9">Detail panel — Groups tab: create, assign, remove, rename, and delete groups per image</li>
|
||||
<li id="wfm-help-gallery-10">Workflow auto-save: images generated in the Generate UI tab automatically have their workflow saved to gallery metadata and shown in the Metadata tab</li>
|
||||
<li id="wfm-help-gallery-11">Supports PNG (tEXt/iTXt), JPEG, WebP, GIF; workflow extraction reads ComfyUI prompt and workflow keys embedded in PNG metadata</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-models">
|
||||
<div class="wfm-help-card">
|
||||
<h3>Models Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-models-1">Browse installed models: Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding with sub-tab switching</li>
|
||||
<li id="wfm-help-models-2">Thumbnail, Card, and Table view modes with pagination</li>
|
||||
<li id="wfm-help-models-3">Search, tag filter, group filter, favorites filter, and status filter (All / Enabled only / Disabled only)</li>
|
||||
<li id="wfm-help-models-4">Side panel: opens to CivitAI tab by default when a model is selected; Info (file path, tags, memo), Groups management, CivitAI integration</li>
|
||||
<li id="wfm-help-models-5">CivitAI integration: fetch model info by SHA256 hash, batch fetch per model type</li>
|
||||
<li id="wfm-help-models-6">Detail modal: preview image, CivitAI info (base model, trained words, tags), thumbnail change — upload any image format to replace the preview; changes take effect immediately without restarting ComfyUI; broken/empty preview files are automatically skipped</li>
|
||||
<li id="wfm-help-models-7">Group management: create, rename, delete groups and assign/remove models</li>
|
||||
<li id="wfm-help-models-8">GenUI Model button: apply the selected model to the corresponding node in GenerateUI's current workflow (Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)</li>
|
||||
<li id="wfm-help-models-9">User-defined badges: assign free-label badges with custom colors shared with the Workflow tab</li>
|
||||
<li id="wfm-help-models-10">Enable/Disable models: toggle visibility in ComfyUI by renaming file extension (.disabled suffix). Disable per model (⏸ button on each card) or per group (Enable All / Disable All in Group panel). Changes take effect after ComfyUI refresh.</li>
|
||||
<li id="wfm-help-models-11">Multi-select & bulk operations: click Select to enter selection mode, then check multiple models; the bulk action bar provides: Deselect All — clear all selections without exiting select mode; ★ Favorite / ☆ Unfavorite — toggle favorites for all selected models; Add to Group / Remove from Group — assign or remove from an existing group; Create & Add — type a new group name and add all selected; +Badge / −Badge — apply or remove a badge from all selected; Delete Files — permanently remove model files, preview images, and sidecar files (.json/.info)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-sidepanel">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-sidepanel-title">Workflow Studio Library (ComfyUI Side Panel)</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-sidepanel-1">Open from the Workflow Studio Library button in the ComfyUI toolbar</li>
|
||||
<li id="wfm-help-sidepanel-2">Workflows tab: All / ★ Favorites / Groups sub-tabs; ★ shown for favorites in All view</li>
|
||||
<li id="wfm-help-sidepanel-3">Nodes tab: All / ★ Favorites / Groups / Sets / 📂 Category / 🧩 Package sub-tabs; Category and Package show a dropdown to filter nodes</li>
|
||||
<li id="wfm-help-sidepanel-11">Models tab: All / ★ Favorites / Groups / By Type sub-tabs</li>
|
||||
<li id="wfm-help-sidepanel-4">Prompts tab: browse prompt presets with All/Favorites/Categories sub-tabs</li>
|
||||
<li id="wfm-help-sidepanel-5">Drag & drop workflows onto the canvas to load them</li>
|
||||
<li id="wfm-help-sidepanel-6">Drag & drop nodes/node sets onto the canvas to place them</li>
|
||||
<li id="wfm-help-sidepanel-7">Drag & drop prompt presets to create WFS_PromptText nodes with positive/negative prompts</li>
|
||||
<li id="wfm-help-sidepanel-8">Copy individual positive (P) or negative (N) prompts from sidebar items</li>
|
||||
<li id="wfm-help-sidepanel-9">Double-click items to load/place without dragging</li>
|
||||
<li id="wfm-help-sidepanel-10">Search within each sub-tab to quickly find items</li>
|
||||
<li id="wfm-help-sidepanel-12">⚙ Theme button (header): customize panel background, text, border colors — saved to localStorage</li>
|
||||
<li id="wfm-help-sidepanel-13">I tab (Information): drop a ComfyUI PNG/WebP/JSON to inspect model, LoRA, and prompt metadata in the side panel — sub-tabs: model / lora / Prompts; supports UnetLoaderGGUF and QuadrupleCLIPLoader node types</li>
|
||||
<li id="wfm-help-sidepanel-14">Information tab — drag items to canvas: model sub-tab places the loader node (Checkpoint → CheckpointLoaderSimple, VAE → VAELoader, Diffusion Model → UNETLoader, Text Encoder → CLIPLoader); double-click also places at canvas center</li>
|
||||
<li id="wfm-help-sidepanel-15">Information tab — LoRA sub-tab: drag individual LoRA to place LoraLoader; "Multiple LORA" section at bottom places all LoRAs in a single Lora Loader (LoraManager) node; Prompts sub-tab: drag a prompt to place CLIPTextEncode node with text pre-filled; click prompt to view full text and copy</li>
|
||||
<li id="wfm-help-sidepanel-16">AI TOOL tab: Translation and TOOLS (VLM) panes powered by Ollama or LM Studio; 3-pane layout (Translation | TOOLS | Settings) always visible; settings (backend, URL, model) are shared with the SPA AI TOOL tab via localStorage</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-aitool">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-ai-title">AI TOOL Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-ai-1">3-pane layout — Translation (40%) | TOOLS (40%) | Settings (20%) — all panes are always visible simultaneously</li>
|
||||
<li id="wfm-help-ai-2">Translation pane: translate text between Japanese, English, Chinese, or a custom Free language using Ollama or LM Studio; language selectors with ⇄ swap button; text content is also swapped on swap; selections are saved automatically</li>
|
||||
<li id="wfm-help-ai-3">TOOLS pane (VLM): drop an image into the drop zone and select a task — Describe Image or Create Prompt — then click Run to analyze with a vision model; result displayed with Copy button</li>
|
||||
<li id="wfm-help-ai-4">Settings pane: choose backend (Ollama / LM Studio), set the API URL, test connection, select model, and configure Free language names for translation</li>
|
||||
<li id="wfm-help-ai-5">Settings are saved to localStorage and shared with the Library panel's AI TOOL tab</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-shortcuts">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-shortcuts-title">Keyboard Shortcuts</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-shortcuts-1">Escape: Close modal/panel</li>
|
||||
<li id="wfm-help-shortcuts-2">Enter: Confirm rename, send chat</li>
|
||||
<li id="wfm-help-shortcuts-3">Shift+Enter: New line in chat</li>
|
||||
<li id="wfm-help-shortcuts-4">Double-click: Open detail modal</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-trouble">
|
||||
<div class="wfm-help-card">
|
||||
<h3 id="wfm-help-trouble-title">Troubleshooting</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-trouble-1">Cannot connect to ComfyUI: Check if ComfyUI can generate images, verify URL in Settings, try refreshing or restarting</li>
|
||||
<li id="wfm-help-trouble-2">Cannot connect to Ollama: Use connection test button, check if Ollama is running and models are downloaded</li>
|
||||
<li id="wfm-help-trouble-3">Workflows not showing: Click refresh button, check if loadable in ComfyUI, try restarting browser/ComfyUI</li>
|
||||
<li id="wfm-help-trouble-4">Image generation fails: Check if specified models exist in ComfyUI, verify connection, try restarting</li>
|
||||
<li id="wfm-help-trouble-5">LoRA Stack fails with "No such file or directory" error: The LoRA may not be recognized by comfyui-lora-manager (known issue). Try a different LoRA or check if the file appears in Lora Manager's own UI</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wfm-help-page" id="wfm-help-page-support">
|
||||
<div class="wfm-help-card wfm-help-support-card">
|
||||
<h3 id="wfm-help-support-title">Support</h3>
|
||||
<p id="wfm-help-support-desc">If you find this plugin useful, please consider supporting its development!</p>
|
||||
<div class="wfm-help-links">
|
||||
<a href="https://github.com/ketle-man/ComfyUI-Workflow-Studio" target="_blank" rel="noopener noreferrer" class="wfm-help-link wfm-help-link-github">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
|
||||
<div>
|
||||
<div class="wfm-help-link-title">GitHub</div>
|
||||
<div class="wfm-help-link-desc" id="wfm-help-github-desc">Report issues, request features, and contribute</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://ko-fi.com/ninnin90033" target="_blank" rel="noopener noreferrer" class="wfm-help-link wfm-help-link-kofi">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M23.881 8.948c-.773-4.085-4.859-4.593-4.859-4.593H.723c-.604 0-.679.798-.679.798s-.082 7.324-.022 11.822c.164 2.424 2.586 2.672 2.586 2.672s8.267-.023 11.966-.049c2.438-.426 2.683-2.566 2.658-3.734 4.352.24 7.422-2.831 6.649-6.916zm-11.062 3.511c-1.246 1.453-4.011 3.976-4.011 3.976s-.121.119-.31.023c-.076-.057-.108-.09-.108-.09-.443-.441-3.368-3.049-4.034-3.954-.709-.965-1.041-2.7-.091-3.71.951-1.01 3.005-1.086 4.363.407 0 0 1.565-1.782 3.468-.963 1.904.82 1.832 3.011.723 4.311zm6.173.478c-.928.116-1.682.028-1.682.028V7.284h1.77s1.971.551 1.971 2.638c0 1.913-.985 2.667-2.059 3.015z"/></svg>
|
||||
<div>
|
||||
<div class="wfm-help-link-title">Ko-fi</div>
|
||||
<div class="wfm-help-link-desc" id="wfm-help-kofi-desc">Buy me a coffee to support development</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<p class="wfm-help-thanks" id="wfm-help-thanks">Thank you for using Workflow Studio!</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -43,9 +43,11 @@ const state = {
|
||||
wfLoaded: false,
|
||||
// Prompts sub-tabs
|
||||
promptSubTab: "prompt-all", // "prompt-all" | "prompt-favorites" | "prompt-categories"
|
||||
promptSubTab2: null, // "prompt-groups" | null
|
||||
promptList: [], // full prompt array from API
|
||||
promptFavorites: [], // favorite === true
|
||||
promptCategories: [], // unique category strings
|
||||
promptGroups: {}, // { groupName: [promptId, ...] } from localStorage
|
||||
promptLoaded: false,
|
||||
// Models sub-tabs
|
||||
modelSubTab: "model-all", // "model-all" | "model-favorites" | "model-groups"
|
||||
@@ -143,6 +145,15 @@ const loadPromptData = async () => {
|
||||
if (c) catSet.add(c);
|
||||
}
|
||||
state.promptCategories = [...catSet].sort();
|
||||
|
||||
try {
|
||||
state.promptGroups = JSON.parse(localStorage.getItem("wfm_prompt_preset_groups") || "{}");
|
||||
} catch { state.promptGroups = {}; }
|
||||
const validIds = new Set(prompts.map(p => p.id));
|
||||
for (const g of Object.keys(state.promptGroups)) {
|
||||
state.promptGroups[g] = (state.promptGroups[g] || []).filter(id => validIds.has(id));
|
||||
}
|
||||
|
||||
state.promptLoaded = true;
|
||||
};
|
||||
|
||||
@@ -478,9 +489,21 @@ const placeLoraMgrNode = (loras, pos) => {
|
||||
node.pos = pos || centerPos;
|
||||
graph.add(node);
|
||||
if (node.widgets) {
|
||||
const loraList = loras.map(l => ({ name: l.name, strength: l.strength_model ?? 1.0, clipStrength: l.strength_clip ?? l.strength_model ?? 1.0, active: true }));
|
||||
const loraList = loras.map(l => ({ name: l.name, strength: l.strength_model ?? l.strength ?? 1.0, clipStrength: l.strength_clip ?? l.strength_model ?? l.strength ?? 1.0, active: true }));
|
||||
const w = node.widgets.find(ww => Array.isArray(ww.value) || ww.name === "loras");
|
||||
if (w) { w.value = loraList; if (w.callback) w.callback(loraList); }
|
||||
const textW = node.widgets.find(ww => ww.name === "text");
|
||||
if (textW) {
|
||||
textW.value = loraList
|
||||
.filter(l => l.active !== false)
|
||||
.map(l => {
|
||||
const s = parseFloat(l.strength) || 1.0;
|
||||
const c = parseFloat(l.clipStrength) || s;
|
||||
return s === c ? `<lora:${l.name}:${s}>` : `<lora:${l.name}:${s}:${c}>`;
|
||||
})
|
||||
.join(" ");
|
||||
if (textW.callback) textW.callback(textW.value);
|
||||
}
|
||||
}
|
||||
app.canvas.setDirty(true, true);
|
||||
showToast(`Placed: Lora Loader (${loras.length} loras)`, "success");
|
||||
@@ -892,8 +915,11 @@ const rebuildSubTabs = () => {
|
||||
{ key: "prompt-favorites", label: "\u2605 Favorites" },
|
||||
{ key: "prompt-categories", label: "\ud83d\udcc1 Categories" },
|
||||
];
|
||||
const row2Tabs = [
|
||||
{ key: "prompt-groups", label: "\ud83d\udcc1 Groups" },
|
||||
];
|
||||
|
||||
const activeKey = state.promptSubTab;
|
||||
const activeKey = state.promptSubTab2 || state.promptSubTab;
|
||||
|
||||
for (const t of row1Tabs) {
|
||||
const btn = document.createElement("button");
|
||||
@@ -902,13 +928,26 @@ const rebuildSubTabs = () => {
|
||||
btn.textContent = t.label;
|
||||
btn.addEventListener("click", () => {
|
||||
state.promptSubTab = t.key;
|
||||
state.promptSubTab2 = null;
|
||||
updateAllActive();
|
||||
btn.classList.add("active");
|
||||
renderContent();
|
||||
});
|
||||
row1.appendChild(btn);
|
||||
}
|
||||
// No row2 tabs for prompts
|
||||
for (const t of row2Tabs) {
|
||||
const btn = document.createElement("button");
|
||||
btn.className = "wfm-nlp-tab wfm-nlp-sub-tab" + (activeKey === t.key ? " active" : "");
|
||||
btn.dataset.subtab = t.key;
|
||||
btn.textContent = t.label;
|
||||
btn.addEventListener("click", () => {
|
||||
state.promptSubTab2 = t.key;
|
||||
updateAllActive();
|
||||
btn.classList.add("active");
|
||||
renderContent();
|
||||
});
|
||||
row2.appendChild(btn);
|
||||
}
|
||||
} else if (state.topTab === "workflows") {
|
||||
const row1Tabs = [
|
||||
{ key: "wf-all", label: "All" },
|
||||
@@ -1040,10 +1079,12 @@ const renderContent = () => {
|
||||
content.innerHTML = `<div class="wfm-nlp-empty">Loading...</div>`;
|
||||
return;
|
||||
}
|
||||
switch (state.promptSubTab) {
|
||||
const promptKey = state.promptSubTab2 || state.promptSubTab;
|
||||
switch (promptKey) {
|
||||
case "prompt-all": renderPromptAll(content); break;
|
||||
case "prompt-favorites": renderPromptFavorites(content); break;
|
||||
case "prompt-categories": renderPromptCategories(content); break;
|
||||
case "prompt-groups": renderPromptGroups(content); break;
|
||||
}
|
||||
} else if (state.topTab === "workflows") {
|
||||
if (!state.wfLoaded) {
|
||||
@@ -1529,6 +1570,32 @@ const renderModelGroups = async (container) => {
|
||||
const item = createModelItem(name, type);
|
||||
listEl.appendChild(item);
|
||||
}
|
||||
|
||||
if (modelType === "lora" && filtered.length >= 1) {
|
||||
const sep = document.createElement("div");
|
||||
sep.className = "wfm-nlp-info-section-title";
|
||||
sep.style.marginTop = "6px";
|
||||
listEl.appendChild(sep);
|
||||
|
||||
const multiItem = document.createElement("div");
|
||||
multiItem.className = "wfm-nlp-item wfm-nlp-model-item";
|
||||
multiItem.draggable = true;
|
||||
multiItem.title = `Drag to canvas to place Lora Loader (LoraManager) with all ${filtered.length} loras`;
|
||||
multiItem.innerHTML = `<div class="wfm-nlp-item-row"><div class="wfm-nlp-item-body"><div class="wfm-nlp-item-label">All ${filtered.length} LoRAs</div><div class="wfm-nlp-item-sub">→ Lora Loader (LoraManager)</div></div></div>`;
|
||||
const buildLoraList = () => filtered.map(n => {
|
||||
const stem = n.replace(/\\/g, "/").split("/").pop().replace(/\.[^.]+$/, "");
|
||||
return { name: stem, strength: 1.0, clipStrength: 1.0, active: true };
|
||||
});
|
||||
multiItem.addEventListener("dragstart", (e) => {
|
||||
e.dataTransfer.effectAllowed = "copy";
|
||||
e.dataTransfer.setData("application/x-wfm-lora-multi", JSON.stringify({ loras: buildLoraList() }));
|
||||
multiItem.classList.add("dragging");
|
||||
});
|
||||
multiItem.addEventListener("dragend", () => multiItem.classList.remove("dragging"));
|
||||
multiItem.addEventListener("dblclick", (e) => { e.stopPropagation(); placeLoraMgrNode(buildLoraList()); });
|
||||
listEl.appendChild(multiItem);
|
||||
}
|
||||
|
||||
section.appendChild(listEl);
|
||||
container.appendChild(section);
|
||||
}
|
||||
@@ -1722,6 +1789,55 @@ const renderPromptCategories = (container) => {
|
||||
}
|
||||
};
|
||||
|
||||
const renderPromptGroups = (container) => {
|
||||
container.innerHTML = "";
|
||||
const groupNames = Object.keys(state.promptGroups).sort();
|
||||
|
||||
if (groupNames.length === 0) {
|
||||
container.innerHTML = `<div class="wfm-nlp-empty">
|
||||
No groups.<br><small>Create groups in Workflow Studio</small>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
|
||||
const promptMap = new Map(state.promptList.map(p => [p.id, p]));
|
||||
let hasAny = false;
|
||||
|
||||
for (const groupName of groupNames) {
|
||||
const ids = state.promptGroups[groupName] || [];
|
||||
const prompts = ids.map(id => promptMap.get(id)).filter(Boolean);
|
||||
const filtered = prompts.filter(matchesPromptSearch);
|
||||
if (state.searchText && filtered.length === 0) continue;
|
||||
|
||||
hasAny = true;
|
||||
const section = document.createElement("div");
|
||||
section.className = "wfm-nlp-group-section";
|
||||
|
||||
const header = document.createElement("div");
|
||||
header.className = "wfm-nlp-group-header collapsed";
|
||||
header.innerHTML = `<span>${esc(groupName)}</span> <span class="wfm-nlp-badge">${filtered.length}</span>`;
|
||||
header.addEventListener("click", () => {
|
||||
const list = section.querySelector(".wfm-nlp-group-list");
|
||||
list.style.display = list.style.display === "none" ? "block" : "none";
|
||||
header.classList.toggle("collapsed");
|
||||
});
|
||||
section.appendChild(header);
|
||||
|
||||
const list = document.createElement("div");
|
||||
list.className = "wfm-nlp-group-list";
|
||||
list.style.display = "none";
|
||||
for (const p of filtered) {
|
||||
list.appendChild(createDraggablePromptItem(p));
|
||||
}
|
||||
section.appendChild(list);
|
||||
container.appendChild(section);
|
||||
}
|
||||
|
||||
if (!hasAny) {
|
||||
container.innerHTML = `<div class="wfm-nlp-empty">No matches.</div>`;
|
||||
}
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// Render – Node sub-tabs (existing)
|
||||
// ============================================
|
||||
@@ -2217,7 +2333,9 @@ function _extractLoRAs(wf) {
|
||||
function add(name, sm, sc) {
|
||||
if (!name || typeof name !== "string" || name === "None" || seen.has(name)) return;
|
||||
seen.add(name);
|
||||
results.push({ name, strength_model: typeof sm === "number" ? sm : 1.0, strength_clip: typeof sc === "number" ? sc : 1.0 });
|
||||
const smNum = parseFloat(sm);
|
||||
const scNum = parseFloat(sc);
|
||||
results.push({ name, strength_model: isNaN(smNum) ? 1.0 : smNum, strength_clip: isNaN(scNum) ? 1.0 : scNum });
|
||||
}
|
||||
if (Array.isArray(wf.nodes)) {
|
||||
for (const n of _collectAllNodes(wf)) {
|
||||
@@ -2233,6 +2351,11 @@ function _extractLoRAs(wf) {
|
||||
const ct = n.class_type ?? "";
|
||||
if (ct === "LoraLoader") add(n.inputs?.lora_name, n.inputs?.strength_model, n.inputs?.strength_clip);
|
||||
else if (ct === "LoraLoaderModelOnly") add(n.inputs?.lora_name, n.inputs?.strength, 1.0);
|
||||
else if (ct === "Lora Loader (LoraManager)") {
|
||||
const lorasData = n.inputs?.loras;
|
||||
const list = lorasData?.__value__ ?? (Array.isArray(lorasData) ? lorasData : null);
|
||||
if (list) for (const l of list) { if (l?.active !== false) add(l?.name, l?.strength ?? 1.0, l?.clipStrength ?? l?.strength ?? 1.0); }
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
||||
Reference in New Issue
Block a user