Compare commits
@@ -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,931 @@
|
||||
# DEVLOG - ComfyUI-Workflow-Studio
|
||||
|
||||
## 2026-06-05: v0.3.22 — カードビュー廃止 + Batch タイプ切り替え UI + 4タイプバッチ生成
|
||||
|
||||
### 概要
|
||||
|
||||
WorkflowタブとModelsタブのカードビューを廃止(サムネイル/テーブルの2択に統一)。
|
||||
生成UIタブのBatch機能を4タイプ(Checkpoint/Lora/Prompt/Workflow)のいずれかを有効化する
|
||||
ラジオ選択型に拡張し、バッチ実行ループも全タイプ対応。
|
||||
|
||||
**カードビュー廃止(Workflow・Models タブ)**
|
||||
- ビュー切り替えボタンから Card(☰)を削除(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キー・フィールド拡充)
|
||||
|
||||
### 概要
|
||||
|
||||
CivitAI API との連携を全面的に改善。バッチ取得を `POST /model-versions/by-hash` 一括リクエストに変更して大幅に高速化。
|
||||
429/5xx エラーへの指数バックオフリトライを追加。APIキーをオプション対応し設定UIとエクスポート除外を実装。
|
||||
取得フィールドを `nsfwLevel`・`air`・`stats`・`updatedAt` 等に拡充。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `py/services/civitai_service.py` — 全面改修
|
||||
|
||||
**バッチ高速化 (POST 一括取得)**
|
||||
- `_batch_fetch_post(sha256_hashes)` を新設 — `POST /model-versions/by-hash` で最大 100 件を 1 リクエストで取得
|
||||
- レスポンスの `files[].hashes.SHA256` でリクエストのハッシュと照合してキャッシュに保存
|
||||
- 100 件超は `_BATCH_CHUNK_SIZE = 100` 単位でチャンク処理
|
||||
- `batch_fetch()` を 2 フェーズ構成に変更
|
||||
- **Phase 1 (hashing)**: 全モデルの SHA256 を計算。キャッシュ済みはここでスキップ
|
||||
- **Phase 2 (fetching)**: 未キャッシュ分をまとめて `_batch_fetch_post()` に投げる
|
||||
- 以前の 1 件ずつ GET + 0.5 秒ウェイト方式を廃止 → 100 モデルで約 50 秒→数秒に短縮
|
||||
|
||||
**429/5xx 指数バックオフリトライ**
|
||||
- `fetch_by_hash()` および `_batch_fetch_post()` 両方に実装
|
||||
- 対象コード: `{429, 500, 502, 503, 504}`。1s → 2s → 4s、最大 3 回
|
||||
- 404 はリトライせず即 `None` を返す(従来通り)
|
||||
|
||||
**APIキー対応**
|
||||
- `_get_api_key()` を新設 — 環境変数 `CIVITAI_API_KEY` を優先し、なければ `settings.json` の `civitai_api_key` にフォールバック
|
||||
- `_build_headers()` を新設 — APIキーがあれば `Authorization: Bearer ...` ヘッダーを付与
|
||||
|
||||
**ハッシュの大文字/小文字統一**
|
||||
- キャッシュキー: 小文字 `sha256_lower`
|
||||
- API 送信 (GET URL パス・POST ボディ): `sha256.upper()`
|
||||
- `get_cached()` も `.lower()` を適用してキー不一致を防止
|
||||
|
||||
**`_extract_info()` 拡張**
|
||||
| 追加フィールド | 内容 |
|
||||
|---|---|
|
||||
| `nsfwLevel` | 数値 NSFW レベル(0〜6)|
|
||||
| `air` | AIR 識別子 (`urn:air:sdxl:lora:civitai:xxx@yyy`) |
|
||||
| `stats` | `downloadCount` / `thumbsUpCount` / `thumbsDownCount` |
|
||||
| `updatedAt` | バージョン最終更新日時 |
|
||||
| `publishedAt` | バージョン公開日時 |
|
||||
| `imageDetails` | 画像の `url`・`width`・`height`・`nsfwLevel` を含む配列 |
|
||||
| `fileMeta` | プライマリファイルの `fp`・`size`・`format` |
|
||||
|
||||
- `images` URLリストは後方互換のため維持
|
||||
|
||||
#### `py/routes/settings_routes.py`
|
||||
|
||||
- `_SETTINGS_EXPORT_EXCLUDE = {"civitai_api_key"}` を定義
|
||||
- `_build_export_bundle()` でエクスポート時に `settings.json` から除外キーをフィルタリング — APIキーが誤って他人に渡るリスクを排除
|
||||
|
||||
#### `static/js/settings-tab.js`
|
||||
|
||||
- Ollama 設定セクションの直後に **CivitAI API Key** セクションを追加
|
||||
- `type="password"` 入力フィールド(`wfm-settings-civitai-api-key`)
|
||||
- 保存ボタン → `saveServerSettings({ civitai_api_key })` を呼び `settings.json` に保存
|
||||
|
||||
#### `static/js/i18n.js`
|
||||
|
||||
- `civitaiApiKeySetting` / `civitaiApiKeyHint` / `civitaiApiKeyPlaceholder` / `civitaiApiKeySave` / `civitaiApiKeySaved` を EN・JA・ZH の 3 言語に追加
|
||||
|
||||
#### `static/js/models-tab.js`
|
||||
|
||||
- バッチ完了 `done` イベント処理で `data.hashes`(`{モデル名: sha256}`)を直接 `state.modelMetadata` に適用
|
||||
- `fetchModelMetadata()` の結果に sha256 が含まれない場合のタイミング問題によるサイドパネル CivitAI タブ表示バグを修正
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-31: v0.3.18 — Batch タブ追加・Models 複数選択強化
|
||||
|
||||
### 概要
|
||||
|
||||
GenerateUI タブに **Batch** サブタブを追加。チェックポイントの一括生成キューを 3 ペインで組み立てられる専用 UI を実装。
|
||||
Models タブの複数選択バルクアクションバーにお気に入り・バッジ操作・Deselect All を追加。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `templates/index.html`
|
||||
|
||||
- **GenerateUI サブタブナビ** に `<button data-subtab="batch">Batch</button>` を追加(5 タブ目)
|
||||
- **`#wfm-gen-subtab-batch`** コンテンツを追加(3 ペインレイアウト)
|
||||
- 左ペイン (`.wfm-batch-left`): `wfm-ckpt-search` 検索入力 + `wfm-ckpt-list` フォルダツリー + All/None ボタン
|
||||
- 中央ペイン (`.wfm-batch-center`): 内部タブナビ(Checkpoint / Lora / Prompt / Workflow)+ Checkpoint タブにグループリスト `#wfm-batch-group-list`; Lora/Prompt/Workflow は "Coming soon" プレースホルダー
|
||||
- 右ペイン (`.wfm-batch-right`): Batch Queue (`#wfm-batch-preview-count` + `#wfm-batch-preview-list`)
|
||||
- **Checkpoint Batch Panel** の `body` を簡略化
|
||||
- 削除: `wfm-ckpt-dropdown-wrap`(フォルダツリー全体)・`wfm-ckpt-batch-info`
|
||||
- 残す: 有効/無効チェックボックスとプログレス表示(`wfm-ckpt-batch-progress`)のみ
|
||||
- ヘルプ更新
|
||||
- `wfm-help-gen-3`: 「4-tab」→「5-tab」、Batch タブを追記
|
||||
- `wfm-help-gen-11`: Checkpoint Batch をパネルのトグル説明のみに簡略化
|
||||
- `wfm-help-gen-12〜14`: Batch タブ 3 ペインの説明を新規追加
|
||||
- `wfm-help-models-11`: バルクアクションの全ボタン(Deselect All / ★ / ☆ / グループ / +Badge / −Badge / Delete)を網羅した説明に更新
|
||||
|
||||
#### `static/js/generate-tab.js`
|
||||
|
||||
**状態管理の刷新**
|
||||
|
||||
- `_batchGroupState` の `selectedModels: Set<modelName>` を廃止
|
||||
- 旧: グループ選択時にメンバーをフラットな Set に追加 → グループのメンバー変更が反映されない
|
||||
- 新: `selectedGroups: Set<groupName>` + `partialSelections: { groupName: Set<modelName> }` に変更
|
||||
- **`_getSelectedGroupModels()`** 追加 — `_batchGroupState.groups` から常に最新のメンバーを解決して返す; グループのメンバーが変わっても自動反映
|
||||
- **`_getGroupSelCount(name)`** 追加 — グループの選択済みモデル数を返す(ヘッダー CB のカウント表示用)
|
||||
- **`_getSelectedCheckpoints()`** 更新 — 左ペイン選択 + `_getSelectedGroupModels()` を統合(重複排除)
|
||||
|
||||
**Batch タブ初期化**
|
||||
|
||||
- **`_loadBatchCheckpointGroups()`** — `/api/wfm/models/groups?type=checkpoint` でグループを取得; 削除されたグループを `selectedGroups` / `partialSelections` からクリーンアップ; 完了後 `_renderBatchGroupList()` と `_renderBatchPreview()` を呼ぶ
|
||||
- **`_renderBatchGroupList()`** — グループリストを DOM 生成
|
||||
- グループヘッダー CB: `selectedGroups` に昇格/降格ロジック付き
|
||||
- 個別メンバー CB: グループ全体選択中に1つ外すと自動的に `partialSelections` に移行; 全員選択になると `selectedGroups` に昇格; 空になると `partialSelections` エントリ削除
|
||||
- **`initBatchTab()`** — 内部タブ切り替え・左ペイン検索 / All / None・Batch タブ表示時の `_loadBatchCheckpointGroups()` 呼び出しを登録
|
||||
- **`_renderBatchPreview()`** 追加 — Batch Queue 右ペインを更新(件数 + ファイル名リスト)
|
||||
|
||||
**既存コード整理**
|
||||
|
||||
- `_updateDropdownLabel()` / `_updateBatchInfo()` を削除 → `_renderBatchPreview()` に統一
|
||||
- `initCheckpointBatch()` からドロップダウン開閉ロジック(`wfm-ckpt-dropdown-*` 関連)を削除; Pause/Resume ハンドラのみ残す
|
||||
- `moveRawJsonToTab()`: `"feeder"` に加えて `"batch"` も Raw JSON 非表示対象に追加
|
||||
- 初期選択状態を `_ckptState = { mode: "none" }` に変更(デフォルト全チェックなし)
|
||||
|
||||
#### `static/js/models-tab.js`
|
||||
|
||||
**新規関数**
|
||||
|
||||
- **`bulkSetFavorite(isFav)`** — 選択中モデルのお気に入りを一括設定(既に同状態のモデルはスキップ)
|
||||
- **`bulkApplyBadge(badgeLabel, add)`** — 選択中モデルに指定バッジを一括追加 / 削除(重複・不在はスキップ)
|
||||
|
||||
**`renderBulkActionBar()` 更新**
|
||||
|
||||
- `Deselect All` ボタンを件数表示直後に追加(`clearSelection()` 呼び出し)
|
||||
- `★ Favorite` / `☆ Unfavorite` ボタンを追加(グループ操作の前)
|
||||
- バッジセレクト (`wfm-bulk-badge-select`) + `+Badge` / `−Badge` ボタンを追加(バッジ未定義時は disabled)
|
||||
|
||||
#### `static/js/i18n.js`
|
||||
|
||||
EN / JA / ZH 全言語に以下を追加:
|
||||
- `modelBulkDeselectAll` — Deselect All / 選択解除 / 取消全选
|
||||
- `modelBulkFavAdd` / `modelBulkFavRemove` — ★ Favorite / ☆ Unfavorite
|
||||
- `modelBulkFavDone` / `modelBulkUnfavDone` — 完了トースト
|
||||
- `modelBulkBadgeApply` / `modelBulkBadgeRemove` — +Badge / −Badge ボタンラベル
|
||||
- `modelBulkBadgeApplyDone` / `modelBulkBadgeRemoveDone` — 完了トースト
|
||||
- `modelBulkNoBadge` — バッジ未選択プレースホルダー
|
||||
|
||||
#### `static/css/main.css`
|
||||
|
||||
`.wfm-batch-*` スタイル一式を追加(Feeder タブの直前):
|
||||
- `.wfm-batch-layout` — flex 3 ペインレイアウト
|
||||
- `.wfm-batch-pane` / `.wfm-batch-left` / `.wfm-batch-center` / `.wfm-batch-right` — ペイン幅・ボーダー
|
||||
- `.wfm-batch-pane-header` / `.wfm-batch-toolbar` / `.wfm-batch-list` — 左ペイン構造
|
||||
- `.wfm-batch-inner-tab-nav` / `.wfm-batch-inner-tab` / `.wfm-batch-inner-content` — 中央ペイン内部タブ
|
||||
- `.wfm-batch-group-list` / `.wfm-batch-group-item` / `.wfm-batch-group-header` / `.wfm-batch-group-name` / `.wfm-batch-group-count` / `.wfm-batch-group-members` — グループリスト
|
||||
- `.wfm-batch-count` / `.wfm-batch-preview-list` / `.wfm-batch-preview-item` — 右ペイン(Batch Queue)
|
||||
|
||||
#### `README.md`
|
||||
|
||||
- バージョンバッジを `0.3.17` → `0.3.18` に更新
|
||||
- GenerateUI Tab: "4-tab" → "5-tab"、Checkpoint Batch の説明を簡略化、Batch タブの説明を追加
|
||||
- Models Tab: bulk operations の説明を全ボタン網羅に更新
|
||||
- Changelog に `v0.3.18` エントリを追加
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-31: v0.3.17 patch — SSLコンテキスト セキュリティ強化
|
||||
|
||||
### 概要
|
||||
|
||||
v0.3.17 のSSL修正で `CERT_NONE`(SSL検証無効)フォールバックがあり、MitM攻撃への脆弱性が指摘された。セキュリティレビューを経て当該フォールバックを削除し、SSL検証が常に維持されるよう修正。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `py/services/civitai_service.py`
|
||||
|
||||
- **`_make_ssl_context()`** のフォールバックロジックを変更
|
||||
- 変更前: 3段目フォールバックとして `ctx.verify_mode = ssl.CERT_NONE`(SSL検証無効)を設定していた
|
||||
- 変更後: `CERT_NONE` を削除。certifi・システムSSLの両方が失敗した場合は `None` を返し、`urlopen(context=None)` でPythonデフォルトのSSL検証(`ssl.create_default_context()` 相当)にフォールバック。SSL検証が無効になるパスを完全に排除
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-30: v0.3.17 — SSL証明書エラー修正・Lora Manager対応
|
||||
|
||||
### 概要
|
||||
|
||||
2つのバグ修正。CivitAI APIへのリクエストでSSL証明書の検証エラーが発生する問題(Windows Portable Python環境で再現)の修正と、ComfyUI-Lora-ManagerのLoRAローダーノードをGenerateUIタブで正しく変換・生成できるよう対応。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `py/services/civitai_service.py`
|
||||
|
||||
- **`_make_ssl_context()`** ヘルパー関数を追加
|
||||
1. `certifi` がインストールされていればそのCA束を使用
|
||||
2. `certifi` がなければシステムデフォルトのSSLコンテキストを使用
|
||||
3. いずれも失敗した場合(Windows Portable Python等でCA束が壊れている環境)は `CERT_NONE` でフォールバック(ログ警告を出力)
|
||||
- **`_get_ssl_context()`** — モジュールレベルでSSLコンテキストを1回だけ生成してキャッシュ
|
||||
- `fetch_by_hash()` および `download_image()` の `urlopen` 呼び出しに `context=_get_ssl_context()` を追加
|
||||
- 修正対象エラー: `SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed: certificate has expired`
|
||||
|
||||
#### `static/js/comfyui-workflow.js`
|
||||
|
||||
- **`convertUiToApi()`** — Lora Loader (LoraManager) ノードの特殊ウィジェットマッピングを追加
|
||||
- ノードの `properties.__lm_widget_ids`(LoRA Managerが設定するウィジェット識別子配列)が存在する場合、`widgets_values` をその配列のインデックスで直接マッピング
|
||||
- `loras` キーの値(UI形式: 配列 `[...]`)をAPI形式 `{"__value__": [...]}` にラップして出力
|
||||
- 修正前は `object_info` ベースのウィジェットマッピングが LoRA Manager の独自型(非 INT/FLOAT/STRING/BOOLEAN/COMBO)を認識できずスキップされていた
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-20: v0.3.16 — CivitAIプレビューフォールバック表示
|
||||
|
||||
### 概要
|
||||
|
||||
CivitAI情報を取得済みのモデルで、ローカルのプレビューファイルがない場合(バックエンドのダウンロード失敗時など)でも、CivitAIキャッシュの`images[0]`をブラウザが直接表示するフォールバックを追加。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `static/js/models-tab.js`
|
||||
|
||||
- **`loadPreviewImage()`** — `onerror` ハンドラーを拡張
|
||||
- APIプレビューが404の場合、`state.modelMetadata[modelName].sha256` → `state.civitaiCache[sha256].images[0]` を参照してブラウザから直接表示
|
||||
- CivitAI画像URLも取得できない場合のみ「プレビューなし」プレースホルダーを表示
|
||||
- **`fetchCivitaiForModel()`** — `preview_saved` に依存せず常に更新
|
||||
- CivitAI情報取得成功時は `preview_saved` の値に関わらずサイドパネルと `renderModelGrid()` を更新
|
||||
- ローカル保存なし(`preview_saved: false`)の場合もサイドパネルに `civitai.images[0]` を直接セット
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-20: v0.3.15 — サンプルワークフロー同梱・CivitAI自動プレビュー・Create Tagsオプション
|
||||
|
||||
### 概要
|
||||
|
||||
3つの機能追加。サンプルワークフローをパッケージに同梱、CivitAI情報取得時のプレビュー自動保存、AI TOOLタブのTOOLSペインにタグ作成タスクを追加。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `workflows/`(新規)
|
||||
|
||||
- SD1.5・SDXL・DWPose・Face Detailer・Image Editing の 13 ワークフロー(JSON + PNG サムネイル)を追加
|
||||
- Git 追跡対象に追加し、`comfy node publish` 時にパッケージへ同梱される
|
||||
|
||||
#### `py/services/civitai_service.py`
|
||||
|
||||
- **`download_image(url, save_path, timeout=15)`** 静的メソッドを追加
|
||||
- `urlopen` で画像バイナリを取得し `save_path` に保存。失敗時は `False` を返しログ出力
|
||||
|
||||
#### `py/routes/models_routes.py`
|
||||
|
||||
- **`handle_civitai_fetch`**(個別取得): CivitAI 情報取得成功後、`find_preview_image` でプレビューの有無を確認し、なければ `images[0]` を `{model_stem}.preview.png` として自動ダウンロード。レスポンスに `preview_saved: true/false` を追加
|
||||
- **`handle_civitai_batch`**(一括取得): バッチ完了後、CivitAI 情報があってプレビューのない各モデルに対して同様の自動ダウンロードを実行。サマリーに `preview_saved` 件数を追加
|
||||
|
||||
#### `static/js/models-tab.js`
|
||||
|
||||
- 個別取得成功時: `data.preview_saved` が `true` の場合、サイドパネルのプレビュー画像を即時更新(`&t=` キャッシュバスター付き URL を再セット)し `renderModelGrid()` を呼び出してカードを更新
|
||||
- 一括取得完了時: `done` イベントのトーストに `+N preview` を付記(`preview_saved > 0` の場合のみ)
|
||||
|
||||
#### `static/js/ai-tab.js`
|
||||
|
||||
- **`VLM_PROMPTS`** に `tags` キーを追加:
|
||||
`"Generate a list of descriptive tags for this image. Output only comma-separated tags in English, nothing else."`
|
||||
|
||||
#### `templates/index.html`
|
||||
|
||||
- SPA AI TOOL タブの `#wfm-ai-vlm-task` に `<option value="tags">Create tags</option>` を追加
|
||||
|
||||
#### `web/comfyui/node_sets_menu.js`
|
||||
|
||||
- Library A タブの `#wfm-nlp-ai-vlm-task` に `<option value="tags">Create tags</option>` を追加
|
||||
- ローカルの `VLM_PROMPTS` に `tags` キーを追加
|
||||
|
||||
#### `static/js/i18n.js`
|
||||
|
||||
- `helpModels5` (EN/JA/ZH): 「プレビューなしモデルに自動ダウンロード」の説明を追記
|
||||
- `helpAi3` (EN/JA/ZH): タスク一覧に「Create Tags / タグ作成 / 标签生成」を追加、ペイン名を「VLM サブタブ」→「TOOLS ペイン」に修正
|
||||
|
||||
#### `README.md`
|
||||
|
||||
- バージョンバッジを `0.3.14` → `0.3.15` に更新
|
||||
- Sample Workflows セクションを追加(Installation と Usage の間)
|
||||
- Models Tab Features: CivitAI 関連行にプレビュー自動保存の説明を追記
|
||||
- AI TOOL Tab Features: TOOLS ペインのタスクに `Create Tags` を追加
|
||||
- Changelog に `v0.3.15` エントリを追加
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-20: AI TOOL タブ 英語化(SPA・Libraryパネル)
|
||||
|
||||
### 概要
|
||||
|
||||
SPA の AI TOOL タブおよびサイドパネル(Library)の AI タブで日本語固定になっていた静的ラベルをすべて英語に統一。他タブと同じ「英語固定の静的 HTML + JS 動的部分のみ `t()`」方式に揃えた。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `templates/index.html`
|
||||
|
||||
- ペインヘッダー: `翻訳` → `Translation`、`設定` → `Settings`
|
||||
- 言語 option: `日本語 / 英語 / 中国語` → `Japanese / English / Chinese`
|
||||
- ボタン: `翻訳` → `Translate`、`コピー` → `Copy`、`実行` → `Run`、`接続テスト` → `Test connection`、`更新` → `Refresh`、`設定を保存` → `Save`
|
||||
- タスク option: `画像の解説` → `Describe image`、`プロンプト作成` → `Create prompt`
|
||||
- プレースホルダー・ラベル: `翻訳するテキストを入力...` → `Enter text to translate...`、`翻訳結果がここに表示されます...` → `Translation result...`、`実行結果がここに表示されます...` → `Result...` 等
|
||||
- ドロップ説明: `PNG / JPG / WebP をドロップまたはクリック` → `Drop or click PNG / JPG / WebP`
|
||||
- 設定ラベル: `バックエンド` → `Backend`、`接続設定` → `Connection`、`モデル選択` → `Model`、`Free 言語設定` → `Free language`、`入力言語` → `Source`、`翻訳言語` → `Target`
|
||||
|
||||
#### `web/comfyui/node_sets_menu.js`
|
||||
|
||||
- サブタブラベル: `翻訳` → `Translation`、**`VLM` → `TOOLS`**、`設定` → `Settings`
|
||||
- HTML 内ラベル: SPA と同内容をすべて英語化
|
||||
- JS 動的文字列: `翻訳中...` → `Translating...`、`接続中...` → `Connecting...`、`実行中...` → `Running...`、`設定を保存しました` → `Settings saved`、`コピーしました` → `Copied`、`モデルが見つかりません` → `No models found`、`画像をドロップしてください` → `Please drop an image` 等
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-19: v0.3.14 — AI TOOL タブ 3ペイン化・RAW JSON 文字色カスタマイズ
|
||||
|
||||
### 概要
|
||||
|
||||
AI タブの UI を刷新し、サブタブ廃止・3 ペイン同時表示レイアウトへ移行。また Settings タブに RAW JSON シンタックスハイライトの文字色カスタマイズ機能を追加。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `templates/index.html`
|
||||
|
||||
- タブボタンラベルを `"A"` → `"AI TOOL"` に変更
|
||||
- `<section id="wfm-tab-ai">` をサブタブ構成から **3 ペインレイアウト** に刷新
|
||||
- サブタブナビ(翻訳 / VLM / 設定ボタン)を削除
|
||||
- `<div class="wfm-ai-pane wfm-ai-pane-translate">` — 翻訳ペイン(flex: 4)
|
||||
- `<div class="wfm-ai-pane-divider">` — 縦区切り線
|
||||
- `<div class="wfm-ai-pane wfm-ai-pane-tools">` — TOOLS ペイン(flex: 4、旧 VLM)
|
||||
- `<div class="wfm-ai-pane-divider">` — 縦区切り線
|
||||
- `<div class="wfm-ai-pane wfm-ai-pane-settings">` — 設定ペイン(flex: 2)
|
||||
- 各ペインに `<div class="wfm-ai-pane-header">` を追加(翻訳 / TOOLS / 設定)
|
||||
- ヘルプタブ更新
|
||||
- `wfm-help-sidepanel-16`: 「AI TOOL tab: Translation and TOOLS (VLM) panes … 3-pane layout always visible」に変更
|
||||
- `wfm-help-ai-title`: "AI Tab (A)" → "AI TOOL Tab"
|
||||
- `wfm-help-ai-1`〜`5`: 3 ペインレイアウトの説明に書き直し(項目数 6→5)
|
||||
- `wfm-help-settings-12` 新規追加: RAW JSON Colors 設定の説明
|
||||
|
||||
#### `static/css/main.css`
|
||||
|
||||
- `#wfm-tab-ai` の `flex-direction` を `column` → `row` に変更
|
||||
- サブタブ関連 CSS を削除: `.wfm-ai-subtab-nav`、`.wfm-ai-subtab-btn`(`.active` 含む)、`.wfm-ai-subtab-content`
|
||||
- 3 ペイン用 CSS を追加:
|
||||
- `.wfm-ai-pane` — `display:flex; flex-direction:column; overflow:hidden; min-width:0`
|
||||
- `.wfm-ai-pane-translate { flex:4 }` / `.wfm-ai-pane-tools { flex:4 }` / `.wfm-ai-pane-settings { flex:2 }`
|
||||
- `.wfm-ai-pane-header` — ペイン見出し(uppercase、border-bottom)
|
||||
- `.wfm-ai-pane-divider` — 幅 1px の縦区切り線
|
||||
|
||||
#### `static/js/ai-tab.js`
|
||||
|
||||
- `initSubTabs()` 関数を削除(サブタブ切り替えロジック全体)
|
||||
- `initAiTab()` から `initSubTabs()` の呼び出しを削除
|
||||
- `initTranslateTab()`・`initVlmTab()`・`initSettingsTab()` はそのまま維持
|
||||
|
||||
#### `static/js/i18n.js`
|
||||
|
||||
- `tabAi` を `"A"` → `"AI TOOL"` に EN/JA/ZH 全言語で変更(`replace_all` で 3 箇所一括)
|
||||
|
||||
#### `static/js/settings-tab.js`
|
||||
|
||||
- **`JSON_COLOR_STYLE_ID`** 定数を追加 (`"wfm-json-color-style"`)
|
||||
- **`JSON_COLOR_DEFS`** 配列を追加(6 色定義: base / yellow / pink / green / cyan / red)
|
||||
- 各要素: `{ id, label: () => t(key) || fallback, def: "#xxxxxx" }`
|
||||
- **`export function applyJsonColors(colors)`** を追加
|
||||
- `<style id="wfm-json-color-style">` を動的生成・更新
|
||||
- `.wfm-json-highlight`・`.json-key-*`・`.json-val-*` の 6 クラスを上書き
|
||||
- `colors` が `undefined` のときはすべてデフォルト値を使用
|
||||
- 設定 HTML テンプレートに `<!-- RAW JSON Colors -->` セクションを追加
|
||||
- `<details>` アコーディオン、`<div id="wfm-json-color-grid">` に 6 個のカラーピッカー
|
||||
- `<button id="wfm-json-color-reset">` でデフォルト復元
|
||||
- イベントハンドラを追加
|
||||
- `#wfm-json-color-grid` の `input` イベント: 色変更を即時反映 + `jsonColors` キーとして localStorage 保存
|
||||
- `#wfm-json-color-reset` の `click` イベント: `jsonColors` キー削除・UI リセット・`applyJsonColors(undefined)` 呼び出し
|
||||
|
||||
#### `static/js/app.js`
|
||||
|
||||
- `import` に `applyJsonColors` を追加
|
||||
- 起動時ブロックに `applyJsonColors(_s.jsonColors)` を追加(テーマ・フォントサイズと同様に DOMContentLoaded 前に適用)
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-19: v0.3.13 — AI タブ(A)追加
|
||||
|
||||
### 概要
|
||||
|
||||
SPA および Workflow Studio Library サイドパネルの両方に AI タブ(A)を追加。Ollama・LM Studio をバックエンドとして翻訳・VLM(画像解析)機能を提供する。設定は `localStorage` 経由で両インターフェース間で共有。
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `templates/index.html`
|
||||
|
||||
- タブバーに `<button class="wfm-tab" data-tab="ai">A</button>` を右端に追加
|
||||
- `<section id="wfm-tab-ai">` を新規追加(3 サブタブ構成)
|
||||
- **翻訳サブタブ** (`wfm-ai-subtab-translate`): 入力テキストエリア・言語セレクター(日/英/中/Free)・⇄ 入替ボタン・翻訳ボタン・出力テキストエリア・コピーボタン・ステータス表示
|
||||
- **VLM サブタブ** (`wfm-ai-subtab-vlm`): ドロップゾーン(110px)・タスクドロップダウン(画像の解説/プロンプト作成)・実行ボタン・結果エリア・コピーボタン
|
||||
- **設定サブタブ** (`wfm-ai-subtab-settings`): バックエンド選択ラジオ・API URL 入力・接続テストボタン・モデル選択+更新ボタン・Free 言語入力(入力/出力)・保存ボタン
|
||||
- ヘルプタブにAI タブ説明カード追加、Sidepanel カードに `wfm-help-sidepanel-16` を追加
|
||||
|
||||
#### `static/js/ai-tab.js`(新規)
|
||||
|
||||
- `import { showToast } from "./app.js"` / `import { t } from "./i18n.js"`
|
||||
- **定数**: `SETTINGS_KEY = "wfm_ai_settings"`、`LANG_NAMES`、`VLM_PROMPTS`(describe / prompt)
|
||||
- **`isValidBackendUrl(url)`**: `new URL()` で `http:` / `https:` スキームのみ許可
|
||||
- **`fileToBase64(file)`**: FileReader → `{ base64, mimeType }`
|
||||
- **`callVLM()`**: Ollama は `images:[b64]`、LM Studio は `image_url` コンテンツブロック
|
||||
- **`callLLM()`**: テキスト翻訳用 LLM 呼び出し(Ollama / LM Studio)
|
||||
- **`fetchModels()`**: Ollama `/api/tags`、LM Studio `/v1/models` からモデル一覧取得
|
||||
- **`buildTranslationPrompt()`**: Free 言語設定対応の翻訳プロンプト生成
|
||||
- **`initSubTabs()`** / **`initTranslateTab()`** / **`initVlmTab()`** / **`initSettingsTab()`**
|
||||
- すべての動的文字列を `t()` 経由で i18n 対応済み
|
||||
- **`export function initAiTab()`**: 全 init 関数のエントリポイント
|
||||
|
||||
#### `static/js/app.js`
|
||||
|
||||
- `import { initAiTab } from "./ai-tab.js"` を追加
|
||||
- `DOMContentLoaded` 内に `initAiTab()` を追加
|
||||
- `tabMap` に `ai: "tabAi"` を追加
|
||||
- `applyI18nToHtml()` に AI タブの全要素 id マッピングを追加
|
||||
- サブタブボタン、言語セレクター option、placeholder、ボタンテキスト、セクションタイトル、ラベル
|
||||
- ヘルプタブ新規 id(`wfm-help-sidepanel-16`、`wfm-help-ai-title`、`wfm-help-ai-1`〜`6`)
|
||||
|
||||
#### `static/js/i18n.js`
|
||||
|
||||
- `tabAi: "A"` を EN/JA/ZH に追加(タブボタンラベル)
|
||||
- AI タブ全キーブロックを EN/JA/ZH に追加(計 3 言語 × 約 40 キー)
|
||||
- サブタブ名、言語オプション、placeholder、ボタンテキスト、ステータス文字列、トースト文字列
|
||||
- `aiToastNoText`、`aiToastNoModel`、`aiToastInvalidUrl`、`aiToastInvalidUrlInput`
|
||||
- `aiStatusTranslating`、`aiStatusRunning`、`aiStatusDone`、`aiStatusConnecting`、`aiStatusConnectOk`、`aiStatusConnectFail`
|
||||
- `aiToastTransFailed`、`aiToastNoCopyText`、`aiToastCopied`、`aiToastNoModels`、`aiToastModelsFailed`
|
||||
- `aiToastSettingsSaved`、`aiToastNoImage`、`aiToastVlmFailed`、`aiModels`
|
||||
- ヘルプキー: `helpSidepanel16`、`helpAiTitle`、`helpAi1`〜`helpAi6`
|
||||
- `ollamaSettings` を EN/JA/ZH で "(プロンプトタブ)" サフィックス付きに改名
|
||||
|
||||
#### `static/css/main.css`
|
||||
|
||||
- AI サブタブナビ: `.wfm-ai-subtab-nav`、`.wfm-ai-subtab-btn`(`.active` 状態含む)、`.wfm-ai-subtab-content`
|
||||
- 翻訳タブ: `.wfm-ai-trans-container`、`.wfm-ai-trans-lang-row`、`.wfm-ai-lang-select`、`.wfm-ai-swap-btn`、`.wfm-ai-trans-textarea`、`.wfm-ai-trans-output`、`.wfm-ai-trans-actions`、`.wfm-ai-trans-status`
|
||||
- ステータス色: `.wfm-ai-status-working`(amber)、`.wfm-ai-status-ok`(green)、`.wfm-ai-status-error`(red)
|
||||
- VLM タブ: `.wfm-ai-vlm-container`、`.wfm-ai-vlm-drop`(height: 110px、破線ボーダー、I タブと統一)、`.wfm-ai-vlm-label`、`.wfm-ai-vlm-preview`、`.wfm-ai-vlm-task-row`、`.wfm-ai-vlm-result`、`.wfm-ai-vlm-copy-btn`
|
||||
- 設定タブ: `.wfm-ai-settings-*` 各セクション
|
||||
|
||||
#### `web/comfyui/node_sets_menu.js`
|
||||
|
||||
- `state` に `aiSubTab: "ai-translate"` を追加
|
||||
- トップタブバーに `data-toptab="ai"` の A ボタンを I タブの右に追加
|
||||
- `rebuildSubTabs()`: AI ケースを追加(翻訳/VLM/設定 サブタブ)
|
||||
- `renderContent()`: `topTab === "ai"` 分岐を追加、検索バー非表示、`renderAiTab()` を呼び出し
|
||||
- 追加関数:
|
||||
- `isValidAiUrl()`: URL セキュリティ検証
|
||||
- `loadAiCfg()` / `saveAiCfg()`: `localStorage` への設定読み書き(SPA と共有)
|
||||
- `aiFileToBase64()` / `aiCallVLM()` / `aiCallLLM()` / `aiFetchModels()`: バックエンド API ラッパー
|
||||
- `renderAiTab(container)`: 初回のみ HTML を構築し `setupAiHandlers()` を呼び出す
|
||||
- `renderAiSubContent()`: サブタブに応じてペインを表示切替
|
||||
- `setupAiHandlers(container)`: 翻訳・VLM・設定の全イベントハンドラ
|
||||
- `injectStyles()`: AI タブ CSS を追加(VLM ドロップゾーン高さ 110px を含む)
|
||||
|
||||
#### `docs/6_ws_library.png`
|
||||
|
||||
- A タブ追加後の Library パネルスクリーンショットに更新
|
||||
|
||||
#### `README.md`
|
||||
|
||||
- バージョンバッジを `0.3.13` に更新
|
||||
- Features に **AI Tab (A)** セクションを追加
|
||||
- Workflow Studio Library のタブ説明を `W/N/P/M/I` → `W/N/P/M/I/A` に更新、A タブ説明を追加
|
||||
- Requirements — Optional に LM Studio を追記
|
||||
- Project Structure に `ai-tab.js` を追加
|
||||
- Changelog に v0.3.13 エントリを追加
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-18: v0.3.12 リリース — README スクリーンショット刷新 / workflow_analyzer 拡張
|
||||
|
||||
### 概要
|
||||
|
||||
@@ -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
|
||||
@@ -47,14 +47,18 @@ Browse, organize, and execute workflows directly from a dedicated studio interfa
|
||||
- **Auto-import** — the captured workflow is automatically imported and appears in the Workflow tab
|
||||
|
||||
### GenerateUI Tab (v0.3.5)
|
||||
- **4-tab layout** — Input / Model / Settings / Feeder tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
|
||||
- **5-tab layout** — Input / Model / Settings / Feeder / Batch tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
|
||||
- **Input tab** — Prompt (top) and Image drag-and-drop (bottom) in the left column; Raw JSON (540px) in the right column
|
||||
- **Model tab** — Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter; Raw JSON on the right
|
||||
- **Settings tab** — KSampler and Latent Image side by side at 50% width each; Raw JSON on the right
|
||||
- **Always-visible Raw JSON** — edit the API-format JSON directly from any tab with syntax highlighting; Apply button reloads the workflow; built-in **search bar** (always shown) finds all matches as you type with count display (`3/12`); navigate with ↑/↓ buttons or Enter / Shift+Enter; Escape or ✕ clears; current match highlighted in orange, other matches in yellow
|
||||
- **One-click generation** — queue prompts to ComfyUI without leaving the studio
|
||||
- **Seed control** — randomize, lock, or manually set seeds; seed input and mode selector stacked vertically for readability
|
||||
- **Checkpoint Batch** — enable via checkbox in the right panel to sequentially generate with every checkpoint model; select checkpoints by folder from the dropdown (check a folder to select all its files, expand with ▶ for individual file selection, supports any subfolder depth); Filter input to search; All / None buttons for quick selection; **Pause/Resume** suspends processing between models; Stop aborts after the current generation; amber progress bar tracks per-model progress
|
||||
- **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/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
|
||||
|
||||
@@ -103,9 +107,12 @@ 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)
|
||||
- **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
|
||||
- **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 prompts, Wildcard prompt and file editor, and Metadata prompt full preview; takes effect immediately and saved with Save Settings
|
||||
- **RAW JSON Colors** — customize the 6 syntax highlight colors for the Raw JSON editor in Generate UI: Default Text (base), Name/Scheduler (yellow), Title (pink), Width/Height (green), Prompt/Text (cyan), Image/File (red); changes apply immediately on color pick; Reset Defaults restores the original scheme; saved to `localStorage` under `wfm_settings.jsonColors` and applied on startup
|
||||
- **Wildcard Integration** — link the WFS wildcard directory to ComfyUI-Impact-Pack's `wildcards/` directory (directory junction on Windows, symlink on other OS); existing WFS wildcard files are automatically migrated; requires [ComfyUI-Impact-Pack](https://github.com/ltdrdata/ComfyUI-Impact-Pack)
|
||||
- **Language** — English / Japanese / Chinese
|
||||
|
||||
@@ -134,22 +141,33 @@ 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, view base model, trained words, tags, and model page link
|
||||
- **Batch CivitAI fetch** — one-click batch fetch for all models of a type with SSE progress streaming
|
||||
- **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)
|
||||
- **Group management** — create, rename, delete groups and assign/remove models; groups are scoped per model type (checkpoint groups only appear in the Checkpoint tab)
|
||||
- **Table view memo** — memo column displayed in table view for quick reference
|
||||
- **Preview images** — auto-detect `{model_stem}.preview.png` next to model files
|
||||
- **Enable / Disable models** — hide models from ComfyUI by renaming the file extension (`.disabled` suffix); toggle per card (⏸ button), per group (Enable All / Disable All), or filter by status (All / Enabled / Disabled)
|
||||
- **Multi-select & bulk operations** — enter selection mode to check multiple models; bulk action bar supports add/remove from groups and permanent file deletion (model file + preview images + sidecar files such as `.json` / `.info`)
|
||||
- **Multi-select & bulk operations** — enter selection mode to check multiple models; bulk action bar supports: **Deselect All** (clear all without exiting select mode), **★ Favorite / ☆ Unfavorite** (toggle favorites for all selected), **Add / Remove from Group**, **Create & Add** (new group), **+Badge / −Badge** (apply or remove a badge from all selected), and permanent **Delete Files** (model file + preview images + sidecar files such as `.json` / `.info`)
|
||||
|
||||
### AI TOOL Tab (v0.3.14)
|
||||
- **3-pane layout** — Translation (40%) | TOOLS (40%) | Settings (20%); all panes always visible simultaneously; no sub-tab switching required
|
||||
- **Translation pane** — translate text between Japanese, English, Chinese, or a custom Free language using Ollama or LM Studio; language selectors with ⇄ swap button (swaps both language selectors and text content); selections saved automatically
|
||||
- **TOOLS pane (VLM)** — drop an image into the 110px drop zone, select a task (Describe Image / Create Prompt / Create Tags), and click Run to analyze with a vision model; result shown in the output area with a Copy button
|
||||
- **Settings pane** — choose backend (Ollama / LM Studio), set the API URL, test connection, select a model (with refresh button), and configure Free language names for translation source and destination
|
||||
- **Settings shared** — settings saved to `localStorage` under `wfm_ai_settings`; shared with the Library panel's AI TOOL tab so configuration is consistent across both interfaces
|
||||
- **Backend support** — Ollama (`/api/generate` for text, `/api/tags` for model list); LM Studio OpenAI-compatible API (`/v1/chat/completions`, `/v1/models`); VLM images sent as base64 (`images:[]` for Ollama, `image_url` content block for LM Studio)
|
||||
- **URL security** — backend URL validated via `new URL()` to enforce `http://` or `https://` scheme
|
||||
|
||||
### Workflow Studio Library (ComfyUI Side Panel) (v0.3.9)
|
||||
- **Tab layout (W / N / P / M / I)** — compact single-letter tabs with full name shown on hover
|
||||
- **Tab layout (W / N / P / M / I / A)** — compact single-letter tabs with full name shown on hover
|
||||
- **W — Workflows tab** — browse favorite workflows (All / ★ Favorites / Groups / By Badge sub-tabs), ★ star shown for favorites in All view
|
||||
- **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
|
||||
@@ -157,6 +175,7 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
|
||||
- **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
|
||||
- **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
|
||||
- **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
|
||||
@@ -192,6 +211,22 @@ Restart ComfyUI after installation.
|
||||
|
||||
---
|
||||
|
||||
## Sample Workflows
|
||||
|
||||
Sample workflows are included in the `workflows/` folder. You can open them directly in ComfyUI via drag & drop, or load them from the Workflow tab.
|
||||
|
||||
> **Note:** Some sample workflows require additional custom nodes.
|
||||
> If a node is shown as missing (red/unknown) after loading, install the required custom nodes via **ComfyUI Manager** or by cloning the repository from GitHub into your `ComfyUI/custom_nodes/` directory.
|
||||
>
|
||||
> ```bash
|
||||
> cd ComfyUI/custom_nodes
|
||||
> git clone <repository-url>
|
||||
> ```
|
||||
>
|
||||
> After installation, restart ComfyUI to activate the new nodes.
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
### Launch
|
||||
@@ -226,7 +261,8 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
|
||||
|
||||
### Optional
|
||||
|
||||
- **[Ollama](https://ollama.com/)** — for AI chat assistant and translation features
|
||||
- **[Ollama](https://ollama.com/)** — for AI chat assistant, translation, and VLM features
|
||||
- **[LM Studio](https://lmstudio.ai/)** — alternative backend for translation and VLM (OpenAI-compatible API)
|
||||
- **[Eagle](https://eagle.cool/)** — for auto-saving generated images with metadata
|
||||
|
||||
---
|
||||
@@ -243,6 +279,66 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.3.22
|
||||
- **Card view removed** — Workflow tab and Models tab no longer offer Card view; Thumbnail and Table remain; if `"card"` was previously stored in localStorage it falls back to Thumbnail automatically
|
||||
- **Batch type selector** — replaced the Checkpoint Batch toggle with per-type checkboxes on the Batch Queue column headers (Checkpoint / Lora / Prompt / Workflow); radio behavior ensures only one type is active at a time; the Batch panel below Generate repurposed as a status display showing the active type, amber progress bar, and Pause/Resume / Stop controls
|
||||
- **4-type batch generation** — `_runBatchGenerate()` dispatches to Checkpoint (file-tree + group selection), Lora (group selection), Prompt (preset group items applied to positive/negative nodes), and Workflow (group selection, restores original workflow after batch); all types use the same generic `_runBatchLoop()` with pause/abort support
|
||||
- **Help updated** — EN / JA / ZH strings updated for `helpWf1`, `helpModels2`, `helpGen11`, `helpGen13`, `helpGen14`
|
||||
|
||||
### v0.3.21
|
||||
- **CivitAI Host setting** — new dropdown in Settings tab (CivitAI section): choose `civitai.com` (SFW only) or `civitai.red` (unrestricted); selection is saved to `settings.json` and synced to `localStorage` so the Models tab uses it immediately without extra server calls
|
||||
- **CivitAI panel — Info / Sample sub-tabs** — the CivitAI side panel is split into two sub-tabs; Info tab contains model details and actions; Sample tab shows all sample images (count displayed in label); images open full-size in a new browser tab on click
|
||||
- **Bug fix: model page URL for existing cache** — `modelId: null` entries (the majority of the cache) previously generated broken links (`/models?modelVersionId=…`); both the Python service and the JS renderer now fall back to `/{host}/model-versions/{versionId}` which redirects correctly to the model page; all 324 existing cache entries are fixed immediately without re-fetching
|
||||
- **Help updated** — Batch tab entries (gen-12 / gen-13 / gen-14) and Settings entries (settings-11 Text Size / settings-12 RAW JSON Colors / settings-13 CivitAI Host) are now fully localized in EN / JA / ZH; `helpGen3` updated to reflect 5-tab layout; `helpGen11` rewritten to describe the Batch toggle; JA/ZH translations no longer contain untranslated English terms (Filter, Pause/Resume, Stop)
|
||||
|
||||
### v0.3.20
|
||||
- **CivitAI panel — Type / Base Model / Hash display** — side panel CivitAI tab now shows a Type badge (e.g. CHECKPOINT, LORA), Base Model row, and Hash row (BLAKE3 preferred, SHA256 fallback from CivitAI API or local metadata); click the hash to copy the full value to clipboard
|
||||
- **CivitAI panel — images open in new tab** — sample images in the CivitAI tab are now wrapped in links; clicking an image opens the full-size version in a new browser tab
|
||||
- **CivitAI panel — 3-state UI** — the panel now distinguishes between "not yet checked" (blue fetch button), "checked but not found on CivitAI" (re-check button with a notice), and "found" (full info); no more ambiguity after running batch fetch
|
||||
- **CivitAI tab click refresh** — clicking the CivitAI tab in the side panel now re-renders its content, ensuring the latest fetch state is always shown without needing to reselect the model
|
||||
- **Bug fix: model page URL broken after batch fetch** — the batch `POST /model-versions/by-hash` endpoint can omit `model.id` inside the version object; `_extract_info` now falls back to the top-level `modelId` field so the model page link is always correct; existing cached entries with a broken URL are also fixed client-side from `modelId` + `versionId`
|
||||
- **CivitAI cache — `fileHashes` field added** — `_extract_info` now stores the primary file's full hash map (BLAKE3, SHA256, AutoV2, etc.) so the Hash row is populated for newly fetched or refreshed models
|
||||
|
||||
### v0.3.19
|
||||
- **CivitAI batch fetch — major speedup** — switched from one-by-one `GET` requests (0.5 s delay each) to `POST /model-versions/by-hash` batch endpoint; up to 100 hashes per request, reducing 100-model fetch from ~50 s to a few seconds
|
||||
- **Retry with exponential backoff** — `fetch_by_hash` and the new batch POST both retry on HTTP 429 / 500 / 502 / 503 / 504 with 1 s → 2 s → 4 s delays (max 3 attempts), as recommended in the CivitAI API docs
|
||||
- **CivitAI API key support** — optional Bearer token can be set in Settings tab (CivitAI API Key section); environment variable `CIVITAI_API_KEY` takes priority over the stored key; API keys are excluded from data exports
|
||||
- **Richer metadata** — `_extract_info` now captures `nsfwLevel` (numeric), `air` (AIR URN identifier), `stats` (download count, thumbs-up/down), `updatedAt`, `publishedAt`, image dimensions / per-image NSFW level (`imageDetails`), and primary file precision / format (`fileMeta`)
|
||||
- **Hash consistency** — cache keys use lowercase hex; API requests send uppercase hex as required by the CivitAI spec
|
||||
- **Bug fix: CivitAI tab blank after batch fetch** — the `done` SSE event now applies `data.hashes` directly to `state.modelMetadata` so the side-panel CivitAI tab renders correctly even when the subsequent `fetchModelMetadata()` call races ahead of the server flush
|
||||
|
||||
### v0.3.18
|
||||
- **Batch tab** — new 5th subtab in GenerateUI with a dedicated 3-pane layout for assembling checkpoint batch queues; left pane: file-tree checkpoint selection (filter, All/None, initially unchecked); center pane: group-based selection with inner tabs (Checkpoint / Lora / Prompt / Workflow — Lora/Prompt/Workflow coming soon); right pane: live Batch Queue preview combining both pane selections with duplicates removed
|
||||
- **Checkpoint selector moved** — the checkpoint dropdown is removed from the right panel; selection is now done exclusively in the Batch tab left and center panes; the right panel retains only the enable/disable toggle and progress display
|
||||
- **Group selection fix** — batch group selection now stores selected group names (not raw model names), so changes to group membership in the Models tab are always reflected in the queue without stale entries
|
||||
- **Models tab bulk operations expanded** — bulk action bar now includes: Deselect All (clear all selections without exiting select mode), ★ Favorite / ☆ Unfavorite, +Badge / −Badge (apply or remove a badge from all selected models); existing group and delete operations unchanged
|
||||
|
||||
### v0.3.17
|
||||
- **CivitAI SSL fix** — resolved `CERTIFICATE_VERIFY_FAILED` errors when fetching model info on Windows Portable Python environments; uses `certifi` CA bundle when available, falls back to system store, and disables verification only as a last resort with a warning log
|
||||
- **Lora Manager support** — `Lora Loader (LoraManager)` nodes (ComfyUI-Lora-Manager) are now correctly converted from UI format to API format in the GenerateUI tab; the `loras` widget array is wrapped to `{"__value__": [...]}` as required by the node, enabling generation with LoRA Manager workflows
|
||||
|
||||
### v0.3.16
|
||||
- **CivitAI preview fallback** — model cards and the detail panel's Info tab now display the first CivitAI image directly when no local preview file exists; if the backend download fails (e.g. network restriction server-side), the browser fetches the image URL from the CivitAI cache as a fallback so the preview is always shown after fetching
|
||||
|
||||
### v0.3.15
|
||||
- **Sample workflows** — added `workflows/` directory containing 13 sample workflows (SD1.5 / SDXL / DWPose / Face Detailer / Image Editing) with PNG thumbnails, bundled in the package
|
||||
- **CivitAI auto-preview** — when fetching CivitAI info (individual or batch), the first CivitAI image is automatically downloaded and saved as `{model_stem}.preview.png` if no preview exists; batch summary reports the count of auto-saved previews
|
||||
- **TOOLS pane — Create Tags** — new task option in the VLM dropdown (both SPA AI TOOL tab and Library A tab): generates a comma-separated list of descriptive English tags from the image
|
||||
|
||||
### v0.3.14
|
||||
- **AI TOOL tab redesign** — tab renamed from "A" to "AI TOOL"; sub-tab navigation removed in favor of a permanent 3-pane layout (Translation 40% | TOOLS 40% | Settings 20%) — all panes always visible simultaneously; "VLM" pane renamed to "TOOLS"
|
||||
- **Settings — RAW JSON Colors** — new accordion section with 6 color pickers to customize the 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 scheme; saved to `localStorage` under `wfm_settings.jsonColors` and applied on startup
|
||||
- **Help tab updated** — AI TOOL tab card rewritten; Settings card updated with RAW JSON Colors entry; Library panel sidepanel-16 entry updated
|
||||
|
||||
### v0.3.13
|
||||
- **AI Tab (A)** — new tab added to both the SPA and the Workflow Studio Library side panel (rightmost tab)
|
||||
- **Translation sub-tab** — translate text via Ollama or LM Studio between Japanese, English, Chinese, or a custom Free language; ⇄ swap button exchanges both language selectors and text content simultaneously; language selections persisted automatically
|
||||
- **VLM sub-tab** — drop zone (110px, matching the I tab) accepts images via drag & drop or click; task selector (Describe Image / Create Prompt); Run button streams result into output area with Copy button; Ollama uses `images:[base64]` payload, LM Studio uses `image_url` content block
|
||||
- **Settings sub-tab** — backend radio (Ollama / LM Studio), API URL input, connection test with live status, model selector with refresh, Free language name fields (source and destination); saved to `localStorage` key `wfm_ai_settings` and shared between SPA and Library panel
|
||||
- **URL security** — backend URL validated via `new URL()` to enforce `http://` or `https://` scheme before any network call
|
||||
- **Settings Tab — Ollama section renamed** — "Ollama 設定" → "Ollama 設定(プロンプトタブ)" to distinguish it from the new AI tab's settings
|
||||
- **Help Tab updated** — added AI Tab (A) feature card and Library panel A tab entry; i18n support in EN/JA/ZH
|
||||
|
||||
### v0.3.12
|
||||
- **GenerateUI — Raw JSON search** — always-visible search bar above the Raw JSON editor; finds all matches as you type with match count (`3/12`); navigate forward/back with ↑/↓ buttons, Enter / Shift+Enter, or Escape / ✕ to clear; current match highlighted in orange, other matches in yellow; search overlay syncs with editor scroll and stays updated while editing
|
||||
- **Workflow analyzer — extended model type detection** — added CLIPLoader `type` field mapping to model family (`flux`, `hidream_i`, `wan`, `cosmos`, `lumina`, `ovis`, etc.) via `_CLIP_TYPE_TO_MODEL`; subgraph nodes (`definitions.subgraphs`) now scanned for model detection; `UnetLoaderGGUF` and similar loaders matched via `"UnetLoader" in ntype`; new families added: NewBie, Ovis, HiDream, Wan, Cosmos, Lumina; model-name detection refactored into reusable `_detect_model_type_from_name()`
|
||||
@@ -446,7 +542,7 @@ ComfyUI-Workflow-Studio/
|
||||
│ ├── settings_service.py # Settings persistence
|
||||
│ └── png_extractor.py # PNG metadata extraction
|
||||
├── templates/
|
||||
│ └── index.html # SPA template (Workflow/GenerateUI/Prompt/Metadata/Gallery/Nodes/Models/Settings/Help)
|
||||
│ └── index.html # SPA template (Workflow/GenerateUI/Prompt/Metadata/Gallery/Nodes/Models/Settings/Help/AI)
|
||||
├── static/
|
||||
│ ├── favicon.svg # Browser tab icon (W+S Wave)
|
||||
│ ├── css/main.css # Styles
|
||||
@@ -461,6 +557,7 @@ ComfyUI-Workflow-Studio/
|
||||
│ ├── comfyui-client.js # ComfyUI WebSocket/API client
|
||||
│ ├── nodes-tab.js # Node browser & node sets
|
||||
│ ├── models-tab.js # Model browser & CivitAI integration
|
||||
│ ├── ai-tab.js # AI TOOL tab (Translation | TOOLS/VLM | Settings — Ollama / LM Studio)
|
||||
│ ├── comfyui-workflow.js # UI-to-API format conversion
|
||||
│ ├── comfyui-editor.js # Dynamic parameter editor
|
||||
│ ├── json-highlight.js # JSON syntax highlighting
|
||||
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 16 KiB |
@@ -150,10 +150,24 @@ async def handle_civitai_fetch(request: web.Request) -> web.Response:
|
||||
"message": "Model not found on CivitAI"
|
||||
})
|
||||
|
||||
# Auto-set preview if none exists and CivitAI has images
|
||||
preview_saved = False
|
||||
if info.get("images"):
|
||||
has_preview = await asyncio.to_thread(_service.find_preview_image, model_type, model_name)
|
||||
if not has_preview:
|
||||
image_url = info["images"][0]
|
||||
preview_path = file_path.parent / (file_path.stem + ".preview.png")
|
||||
preview_saved = await asyncio.to_thread(
|
||||
CivitaiService.download_image, image_url, preview_path
|
||||
)
|
||||
if preview_saved:
|
||||
logger.info("Auto-saved preview for %s from CivitAI", model_name)
|
||||
|
||||
return web.json_response({
|
||||
"status": "ok",
|
||||
"sha256": sha256,
|
||||
"civitai": info,
|
||||
"preview_saved": preview_saved,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error("CivitAI fetch error: %s", e)
|
||||
@@ -269,6 +283,28 @@ async def handle_civitai_batch(request: web.Request) -> web.Response:
|
||||
all_meta[mname]["sha256"] = sha
|
||||
_service._save_metadata(all_meta)
|
||||
|
||||
# Auto-set previews for models without preview image
|
||||
dirs = _get_model_dirs(model_type)
|
||||
preview_saved_count = 0
|
||||
for model_name, result in results.items():
|
||||
civitai = result.get("civitai")
|
||||
if not civitai or not civitai.get("images"):
|
||||
continue
|
||||
if _service.find_preview_image(model_type, model_name):
|
||||
continue
|
||||
model_file = None
|
||||
for d in dirs:
|
||||
p = d / model_name
|
||||
if p.is_file():
|
||||
model_file = p
|
||||
break
|
||||
if not model_file:
|
||||
continue
|
||||
preview_path = model_file.parent / (model_file.stem + ".preview.png")
|
||||
if CivitaiService.download_image(civitai["images"][0], preview_path):
|
||||
preview_saved_count += 1
|
||||
logger.info("Auto-saved preview for %s from CivitAI", model_name)
|
||||
|
||||
# Send final result
|
||||
summary = {
|
||||
"total": len(model_files),
|
||||
@@ -276,6 +312,7 @@ async def handle_civitai_batch(request: web.Request) -> web.Response:
|
||||
"not_found": sum(1 for r in results.values() if r.get("sha256") and not r.get("civitai")),
|
||||
"errors": sum(1 for r in results.values() if r.get("error")),
|
||||
"hashes": {name: r.get("sha256") for name, r in results.items() if r.get("sha256")},
|
||||
"preview_saved": preview_saved_count,
|
||||
}
|
||||
await response.write(send_sse("done", summary))
|
||||
await response.write_eof()
|
||||
|
||||
@@ -179,13 +179,20 @@ def _load_data_file(filename: str):
|
||||
return None
|
||||
|
||||
|
||||
# エクスポートから除外するsettings.jsonのキー(APIキーなどの機密情報)
|
||||
_SETTINGS_EXPORT_EXCLUDE = {"civitai_api_key"}
|
||||
|
||||
|
||||
def _build_export_bundle() -> dict:
|
||||
"""Collect all data files into a single export bundle."""
|
||||
bundle = {"__version": 1, "__source": "ComfyUI-Workflow-Studio"}
|
||||
for filename in _DATA_FILES:
|
||||
data = _load_data_file(filename)
|
||||
if data is not None:
|
||||
bundle[filename] = data
|
||||
if data is None:
|
||||
continue
|
||||
if filename == "settings.json" and isinstance(data, dict):
|
||||
data = {k: v for k, v in data.items() if k not in _SETTINGS_EXPORT_EXCLUDE}
|
||||
bundle[filename] = data
|
||||
return bundle
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import ssl
|
||||
import time
|
||||
from pathlib import Path
|
||||
from urllib.request import Request, urlopen
|
||||
from urllib.error import URLError, HTTPError
|
||||
@@ -11,9 +13,48 @@ from ..config import DATA_DIR
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _make_ssl_context():
|
||||
"""Return an SSL context with CA verification.
|
||||
|
||||
1. certifi CA bundle (available in virtually all ComfyUI envs via torch→requests→certifi)
|
||||
2. System default SSL context (OS certificate store)
|
||||
Returns None if both fail — callers fall back to urlopen without context
|
||||
(Python's own default, which also uses certifi when available).
|
||||
SSL verification is never disabled to avoid MitM exposure.
|
||||
"""
|
||||
try:
|
||||
import certifi
|
||||
return ssl.create_default_context(cafile=certifi.where())
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
return ssl.create_default_context()
|
||||
except Exception:
|
||||
pass
|
||||
logger.warning("CivitAI: could not build SSL context; falling back to urllib default")
|
||||
return None
|
||||
|
||||
|
||||
_SSL_CONTEXT = _make_ssl_context # lazy sentinel
|
||||
|
||||
|
||||
def _get_ssl_context():
|
||||
global _SSL_CONTEXT
|
||||
if callable(_SSL_CONTEXT):
|
||||
_SSL_CONTEXT = _make_ssl_context()
|
||||
return _SSL_CONTEXT
|
||||
|
||||
|
||||
CIVITAI_API_BASE = "https://civitai.com/api/v1"
|
||||
CIVITAI_CACHE_FILE = DATA_DIR / "civitai_cache.json"
|
||||
|
||||
# HTTPステータスコード: 指数バックオフでリトライする対象
|
||||
_RETRY_CODES = {429, 500, 502, 503, 504}
|
||||
_MAX_RETRIES = 3
|
||||
# POST /model-versions/by-hash は最大100件まで一括送信可能
|
||||
_BATCH_CHUNK_SIZE = 100
|
||||
|
||||
|
||||
class CivitaiService:
|
||||
"""Fetch and cache CivitAI model metadata."""
|
||||
@@ -21,6 +62,8 @@ class CivitaiService:
|
||||
def __init__(self):
|
||||
self._cache = None
|
||||
|
||||
# ── キャッシュ管理 ────────────────────────────────────────
|
||||
|
||||
def _load_cache(self):
|
||||
if self._cache is not None:
|
||||
return self._cache
|
||||
@@ -42,12 +85,37 @@ class CivitaiService:
|
||||
def get_cached(self, sha256_hash):
|
||||
"""Return cached CivitAI data for a given hash, or None."""
|
||||
cache = self._load_cache()
|
||||
return cache.get(sha256_hash)
|
||||
return cache.get(sha256_hash.lower())
|
||||
|
||||
def get_all_cached(self):
|
||||
"""Return the full cache dict."""
|
||||
return self._load_cache()
|
||||
|
||||
# ── APIキー / ヘッダー ────────────────────────────────────
|
||||
|
||||
@staticmethod
|
||||
def _get_api_key():
|
||||
"""Return CivitAI API key. Env var CIVITAI_API_KEY takes priority over settings.json."""
|
||||
import os
|
||||
env_key = os.environ.get("CIVITAI_API_KEY", "").strip()
|
||||
if env_key:
|
||||
return env_key
|
||||
try:
|
||||
from ..services.settings_service import SettingsService
|
||||
return SettingsService().load().get("civitai_api_key", "").strip() or None
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def _build_headers(self):
|
||||
"""Build request headers, optionally including Bearer token."""
|
||||
headers = {"User-Agent": "ComfyUI-Workflow-Studio/1.0"}
|
||||
api_key = self._get_api_key()
|
||||
if api_key:
|
||||
headers["Authorization"] = f"Bearer {api_key}"
|
||||
return headers
|
||||
|
||||
# ── ハッシュ計算 ──────────────────────────────────────────
|
||||
|
||||
@staticmethod
|
||||
def calculate_sha256(file_path, chunk_size=65536):
|
||||
"""Calculate SHA256 hash of a file."""
|
||||
@@ -61,43 +129,130 @@ class CivitaiService:
|
||||
if not chunk:
|
||||
break
|
||||
h.update(chunk)
|
||||
return h.hexdigest()
|
||||
return h.hexdigest() # 小文字16進数
|
||||
|
||||
# ── 単体フェッチ (GET) ────────────────────────────────────
|
||||
|
||||
def fetch_by_hash(self, sha256_hash):
|
||||
"""Fetch model version info from CivitAI by SHA256 hash.
|
||||
"""Fetch model version info from CivitAI by SHA256 hash (GET).
|
||||
|
||||
429/5xx は指数バックオフでリトライ。
|
||||
Returns dict with model info, or None if not found.
|
||||
Caches successful results.
|
||||
"""
|
||||
# Check cache first
|
||||
sha256_lower = sha256_hash.lower()
|
||||
cache = self._load_cache()
|
||||
if sha256_hash in cache:
|
||||
return cache[sha256_hash]
|
||||
if sha256_lower in cache:
|
||||
return cache[sha256_lower]
|
||||
|
||||
url = f"{CIVITAI_API_BASE}/model-versions/by-hash/{sha256_hash}"
|
||||
try:
|
||||
req = Request(url, headers={"User-Agent": "ComfyUI-Workflow-Studio/1.0"})
|
||||
with urlopen(req, timeout=15) as resp:
|
||||
data = json.loads(resp.read().decode("utf-8"))
|
||||
url = f"{CIVITAI_API_BASE}/model-versions/by-hash/{sha256_hash.upper()}"
|
||||
|
||||
if not data or "id" not in data:
|
||||
for attempt in range(_MAX_RETRIES):
|
||||
try:
|
||||
req = Request(url, headers=self._build_headers())
|
||||
with urlopen(req, timeout=15, context=_get_ssl_context()) as resp:
|
||||
data = json.loads(resp.read().decode("utf-8"))
|
||||
|
||||
if not data or "id" not in data:
|
||||
return None
|
||||
|
||||
info = self._extract_info(data)
|
||||
cache[sha256_lower] = info
|
||||
self._save_cache()
|
||||
return info
|
||||
|
||||
except HTTPError as e:
|
||||
if e.code == 404:
|
||||
logger.debug("CivitAI: model not found for hash %s", sha256_hash[:16])
|
||||
return None
|
||||
if e.code in _RETRY_CODES and attempt < _MAX_RETRIES - 1:
|
||||
wait = 2 ** attempt
|
||||
logger.warning("CivitAI %s: retrying in %ss (attempt %d/%d)",
|
||||
e.code, wait, attempt + 1, _MAX_RETRIES)
|
||||
time.sleep(wait)
|
||||
continue
|
||||
logger.warning("CivitAI API error: %s %s", e.code, e.reason)
|
||||
return None
|
||||
except (URLError, Exception) as e:
|
||||
if attempt < _MAX_RETRIES - 1:
|
||||
wait = 2 ** attempt
|
||||
logger.warning("CivitAI request failed: %s — retrying in %ss", e, wait)
|
||||
time.sleep(wait)
|
||||
continue
|
||||
logger.warning("CivitAI request failed: %s", e)
|
||||
return None
|
||||
|
||||
# Extract useful fields
|
||||
info = self._extract_info(data)
|
||||
cache[sha256_hash] = info
|
||||
self._save_cache()
|
||||
return info
|
||||
return None
|
||||
|
||||
except HTTPError as e:
|
||||
if e.code == 404:
|
||||
logger.debug("CivitAI: model not found for hash %s", sha256_hash[:16])
|
||||
return None
|
||||
logger.warning("CivitAI API error: %s %s", e.code, e.reason)
|
||||
return None
|
||||
except (URLError, Exception) as e:
|
||||
logger.warning("CivitAI request failed: %s", e)
|
||||
return None
|
||||
# ── 一括フェッチ (POST) ───────────────────────────────────
|
||||
|
||||
def _batch_fetch_post(self, sha256_hashes):
|
||||
"""POST /model-versions/by-hash でハッシュリストを一括取得(最大100件/リクエスト)。
|
||||
|
||||
レスポンスの files[].hashes.SHA256 でリクエストのハッシュと照合する。
|
||||
Returns: { sha256_lower: info_or_none }
|
||||
"""
|
||||
if not sha256_hashes:
|
||||
return {}
|
||||
|
||||
url = f"{CIVITAI_API_BASE}/model-versions/by-hash"
|
||||
results = {h.lower(): None for h in sha256_hashes}
|
||||
cache = self._load_cache()
|
||||
|
||||
for chunk_start in range(0, len(sha256_hashes), _BATCH_CHUNK_SIZE):
|
||||
chunk = sha256_hashes[chunk_start:chunk_start + _BATCH_CHUNK_SIZE]
|
||||
chunk_lower = {h.lower() for h in chunk}
|
||||
|
||||
for attempt in range(_MAX_RETRIES):
|
||||
try:
|
||||
body = json.dumps([h.upper() for h in chunk]).encode("utf-8")
|
||||
req = Request(
|
||||
url,
|
||||
data=body,
|
||||
headers={**self._build_headers(), "Content-Type": "application/json"},
|
||||
method="POST",
|
||||
)
|
||||
with urlopen(req, timeout=30, context=_get_ssl_context()) as resp:
|
||||
versions = json.loads(resp.read().decode("utf-8"))
|
||||
|
||||
# 各バージョンを files[].hashes.SHA256 でリクエストのハッシュと照合
|
||||
for version_data in versions:
|
||||
info = self._extract_info(version_data)
|
||||
matched = False
|
||||
for f in version_data.get("files", []):
|
||||
file_sha256 = f.get("hashes", {}).get("SHA256", "").lower()
|
||||
if file_sha256 in chunk_lower:
|
||||
cache[file_sha256] = info
|
||||
results[file_sha256] = info
|
||||
matched = True
|
||||
break
|
||||
if not matched:
|
||||
# files にハッシュがない場合は versionId で照合を試みる
|
||||
logger.debug("CivitAI: could not match version %s to a requested hash",
|
||||
version_data.get("id"))
|
||||
break # チャンク成功
|
||||
|
||||
except HTTPError as e:
|
||||
if e.code in _RETRY_CODES and attempt < _MAX_RETRIES - 1:
|
||||
wait = 2 ** attempt
|
||||
logger.warning("CivitAI batch POST %s: retrying in %ss", e.code, wait)
|
||||
time.sleep(wait)
|
||||
continue
|
||||
logger.warning("CivitAI batch POST error: %s %s", e.code, e.reason)
|
||||
break
|
||||
except (URLError, Exception) as e:
|
||||
if attempt < _MAX_RETRIES - 1:
|
||||
wait = 2 ** attempt
|
||||
logger.warning("CivitAI batch POST failed: %s — retrying in %ss", e, wait)
|
||||
time.sleep(wait)
|
||||
continue
|
||||
logger.warning("CivitAI batch POST failed: %s", e)
|
||||
break
|
||||
|
||||
self._save_cache()
|
||||
return results
|
||||
|
||||
# ── 情報抽出 ──────────────────────────────────────────────
|
||||
|
||||
@staticmethod
|
||||
def _extract_info(data):
|
||||
@@ -106,101 +261,170 @@ class CivitaiService:
|
||||
images = data.get("images", [])
|
||||
files = data.get("files", [])
|
||||
|
||||
# Get primary file info
|
||||
primary_file = None
|
||||
for f in files:
|
||||
if f.get("primary"):
|
||||
primary_file = f
|
||||
break
|
||||
# プライマリファイルを特定
|
||||
primary_file = next((f for f in files if f.get("primary")), None)
|
||||
if not primary_file and files:
|
||||
primary_file = files[0]
|
||||
|
||||
# Get image URLs (first 5)
|
||||
image_urls = []
|
||||
# 画像情報(URL・寸法・NSFWレベル)を最大5件取得
|
||||
image_list = []
|
||||
for img in images[:5]:
|
||||
url = img.get("url", "")
|
||||
if url:
|
||||
# Optimize for thumbnail
|
||||
optimized = url.replace("/original=true", "/width=450,optimized=true")
|
||||
image_urls.append(optimized)
|
||||
img_url = img.get("url", "")
|
||||
if not img_url:
|
||||
continue
|
||||
image_list.append({
|
||||
"url": img_url,
|
||||
"width": img.get("width"),
|
||||
"height": img.get("height"),
|
||||
"nsfwLevel": img.get("nsfwLevel", 0),
|
||||
})
|
||||
|
||||
# プライマリファイルのメタ情報(精度・フォーマット)
|
||||
file_meta = {}
|
||||
file_hashes = {}
|
||||
if primary_file:
|
||||
pm = primary_file.get("metadata", {})
|
||||
file_meta = {
|
||||
"fp": pm.get("fp"),
|
||||
"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", ""),
|
||||
"description": data.get("description") or model.get("description", ""),
|
||||
"tags": model.get("tags", []),
|
||||
"nsfw": model.get("nsfw", False),
|
||||
"nsfwLevel": data.get("nsfwLevel", 0),
|
||||
"air": data.get("air", ""),
|
||||
"creator": data.get("creator", {}).get("username", ""),
|
||||
"images": image_urls,
|
||||
# 後方互換のため URLリストを維持しつつ詳細情報も保存
|
||||
"images": [img["url"] for img in image_list],
|
||||
"imageDetails": image_list,
|
||||
"trainedWords": data.get("trainedWords", []),
|
||||
"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', '')}?modelVersionId={data.get('id', '')}",
|
||||
"modelUrl": (
|
||||
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),
|
||||
"thumbsUpCount": stats.get("thumbsUpCount", 0),
|
||||
"thumbsDownCount": stats.get("thumbsDownCount", 0),
|
||||
},
|
||||
"updatedAt": data.get("updatedAt", ""),
|
||||
"publishedAt": data.get("publishedAt", ""),
|
||||
}
|
||||
|
||||
# ── バッチフェッチ ────────────────────────────────────────
|
||||
|
||||
def batch_fetch(self, model_files, progress_callback=None):
|
||||
"""Batch fetch CivitAI info for multiple model files.
|
||||
|
||||
Phase 1: SHA256 計算("hashing")
|
||||
Phase 2: POST で一括取得("fetching")— キャッシュ済みはスキップ
|
||||
|
||||
Args:
|
||||
model_files: list of (model_name, file_path) tuples
|
||||
progress_callback: fn(current, total, model_name, status) called per model
|
||||
|
||||
Returns: dict of { model_name: { sha256, civitai_info_or_none } }
|
||||
"""
|
||||
import time
|
||||
|
||||
results = {}
|
||||
total = len(model_files)
|
||||
cache = self._load_cache()
|
||||
|
||||
# Phase 1: ハッシュ計算
|
||||
hashes_needed = [] # [(model_name, sha256_lower, original_index)]
|
||||
|
||||
for i, (model_name, file_path) in enumerate(model_files):
|
||||
if progress_callback:
|
||||
progress_callback(i, total, model_name, "hashing")
|
||||
|
||||
# Calculate hash
|
||||
sha256 = self.calculate_sha256(file_path)
|
||||
if not sha256:
|
||||
results[model_name] = {"sha256": None, "civitai": None, "error": "hash_failed"}
|
||||
continue
|
||||
|
||||
results[model_name] = {"sha256": sha256, "civitai": None}
|
||||
|
||||
# Check cache
|
||||
if sha256 in cache:
|
||||
results[model_name]["civitai"] = cache[sha256]
|
||||
if progress_callback:
|
||||
progress_callback(i, total, model_name, "cached")
|
||||
progress_callback(i + 1, total, model_name, "not_found")
|
||||
continue
|
||||
|
||||
# Fetch from API
|
||||
sha256_lower = sha256.lower()
|
||||
results[model_name] = {"sha256": sha256_lower, "civitai": None}
|
||||
|
||||
if sha256_lower in cache:
|
||||
results[model_name]["civitai"] = cache[sha256_lower]
|
||||
if progress_callback:
|
||||
progress_callback(i + 1, total, model_name, "cached")
|
||||
else:
|
||||
hashes_needed.append((model_name, sha256_lower, i))
|
||||
|
||||
# Phase 2: POST で一括取得(未キャッシュ分)
|
||||
if hashes_needed:
|
||||
if progress_callback:
|
||||
progress_callback(i, total, model_name, "fetching")
|
||||
progress_callback(len(results), total, "", "fetching")
|
||||
|
||||
info = self.fetch_by_hash(sha256)
|
||||
if info:
|
||||
results[model_name]["civitai"] = info
|
||||
# 同一ハッシュが複数モデルに対応する場合を考慮
|
||||
sha256_to_entries: dict[str, list] = {}
|
||||
for name, sha256_lower, idx in hashes_needed:
|
||||
sha256_to_entries.setdefault(sha256_lower, []).append((name, idx))
|
||||
|
||||
if progress_callback:
|
||||
status = "found" if info else "not_found"
|
||||
progress_callback(i, total, model_name, status)
|
||||
batch_results = self._batch_fetch_post(list(sha256_to_entries.keys()))
|
||||
|
||||
# Rate limit: small delay between API calls
|
||||
time.sleep(0.5)
|
||||
for sha256_lower, info in batch_results.items():
|
||||
for name, idx in sha256_to_entries.get(sha256_lower, []):
|
||||
results[name]["civitai"] = info
|
||||
if progress_callback:
|
||||
status = "found" if info else "not_found"
|
||||
progress_callback(idx + 1, total, name, status)
|
||||
|
||||
if progress_callback:
|
||||
progress_callback(total, total, "", "done")
|
||||
|
||||
return results
|
||||
|
||||
# ── 画像ダウンロード ──────────────────────────────────────
|
||||
|
||||
@staticmethod
|
||||
def download_image(url, save_path, timeout=15):
|
||||
"""Download an image from URL and save to save_path. Returns True on success."""
|
||||
try:
|
||||
req = Request(url, headers={"User-Agent": "ComfyUI-Workflow-Studio/1.0"})
|
||||
with urlopen(req, timeout=timeout, context=_get_ssl_context()) as resp:
|
||||
data = resp.read()
|
||||
with open(save_path, "wb") as f:
|
||||
f.write(data)
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.warning("Failed to download preview from %s: %s", url, e)
|
||||
return False
|
||||
|
||||
# ── キャッシュ操作 ────────────────────────────────────────
|
||||
|
||||
def clear_cache(self, sha256_hash=None):
|
||||
"""Clear cache for a specific hash or all."""
|
||||
cache = self._load_cache()
|
||||
if sha256_hash:
|
||||
cache.pop(sha256_hash, None)
|
||||
cache.pop(sha256_hash.lower(), None)
|
||||
else:
|
||||
cache.clear()
|
||||
self._save_cache()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-workflow-studio"
|
||||
description = "A comprehensive workflow management and generation UI plugin for ComfyUI. Browse, organize, and execute workflows from a dedicated studio interface."
|
||||
version = "0.3.7"
|
||||
version = "0.3.22"
|
||||
license = "MIT"
|
||||
requires-python = ">= 3.10"
|
||||
dependencies = ["jinja2"]
|
||||
|
||||
@@ -290,6 +290,7 @@ body {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wfm-card-thumb img {
|
||||
@@ -1045,58 +1046,42 @@ body {
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
Card View Mode (no thumbnail, compact)
|
||||
Batch Button
|
||||
============================================ */
|
||||
|
||||
.wfm-view-card {
|
||||
grid-template-columns: repeat(auto-fill, 220px) !important;
|
||||
grid-auto-rows: max-content !important;
|
||||
gap: 8px !important;
|
||||
justify-items: stretch !important;
|
||||
align-items: start !important;
|
||||
}
|
||||
|
||||
.wfm-view-card .wfm-card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 220px !important;
|
||||
min-width: 220px !important;
|
||||
min-height: 56px;
|
||||
}
|
||||
|
||||
.wfm-view-card .wfm-card-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
.wfm-view-card .wfm-fav-btn {
|
||||
flex-shrink: 0;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.wfm-view-card .wfm-card-title {
|
||||
margin-bottom: 2px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.wfm-card-io {
|
||||
font-size: 11px;
|
||||
.wfm-batch-btn {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 6px;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--wfm-text-secondary);
|
||||
margin-top: 4px;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
opacity: 0.5;
|
||||
transition: opacity 0.15s, color 0.15s;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.wfm-card-tags {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 4px;
|
||||
.wfm-batch-btn:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.wfm-batch-btn.active {
|
||||
color: #f0c040;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
.wfm-table-row .wfm-batch-btn,
|
||||
.wfm-models-table-row .wfm-batch-btn {
|
||||
position: static;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
|
||||
.wfm-tag {
|
||||
font-size: 10px;
|
||||
color: var(--wfm-primary);
|
||||
@@ -1798,6 +1783,9 @@ body {
|
||||
.wfm-pm-search {
|
||||
padding: 8px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
.wfm-pm-list {
|
||||
flex: 1;
|
||||
@@ -1866,6 +1854,10 @@ body {
|
||||
.wfm-pm-action-btn.fav-active {
|
||||
color: #ffd700;
|
||||
}
|
||||
.wfm-pm-action-btn.batch-active {
|
||||
color: #f0c040;
|
||||
opacity: 1;
|
||||
}
|
||||
.wfm-pm-empty {
|
||||
padding: 24px 16px;
|
||||
text-align: center;
|
||||
@@ -3634,14 +3626,6 @@ body {
|
||||
border-color: var(--wfm-accent);
|
||||
}
|
||||
|
||||
/* Model card (card view, no thumbnail) */
|
||||
.wfm-model-card {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wfm-model-card .wfm-card-body {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Badge: subdirectory (italic, muted) */
|
||||
.wfm-badge-dir {
|
||||
@@ -3822,12 +3806,6 @@ body {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* Card view: fav and toggle are flex siblings */
|
||||
.wfm-view-card .wfm-toggle-btn {
|
||||
position: static;
|
||||
flex-shrink: 0;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
/* Table view toggle cell */
|
||||
.wfm-table-td-toggle {
|
||||
@@ -3840,6 +3818,11 @@ body {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.wfm-table-td-batch {
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
/* Disabled badge in card title */
|
||||
.wfm-badge-disabled {
|
||||
background: rgba(255, 107, 107, 0.2);
|
||||
@@ -3877,7 +3860,6 @@ body {
|
||||
content: "✓";
|
||||
}
|
||||
.wfm-view-thumb .wfm-model-card.wfm-card-checked,
|
||||
.wfm-view-card .wfm-model-card.wfm-card-checked {
|
||||
outline: 2px solid #6c8ef5;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
@@ -3910,6 +3892,144 @@ body {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
/* ── Batch Tab ──────────────────────────────────────────────────── */
|
||||
.wfm-batch-layout {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
gap: 0;
|
||||
}
|
||||
.wfm-batch-pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
border-right: 1px solid var(--wfm-border);
|
||||
}
|
||||
.wfm-batch-pane:last-child { border-right: none; }
|
||||
.wfm-batch-left { width: 240px; flex-shrink: 0; }
|
||||
.wfm-batch-center { flex: 1; }
|
||||
.wfm-batch-right { flex: 1.2; min-width: 320px; flex-shrink: 0; }
|
||||
.wfm-batch-pane-header {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: var(--wfm-text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
padding: 6px 10px;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wfm-batch-toolbar {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
padding: 6px 8px;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
}
|
||||
.wfm-batch-toolbar input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 24px;
|
||||
padding: 2px 6px;
|
||||
font-size: 11px;
|
||||
}
|
||||
.wfm-batch-list { flex: 1; overflow-y: auto; }
|
||||
.wfm-batch-inner-tab-nav {
|
||||
display: flex;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wfm-batch-inner-tab {
|
||||
flex: 1;
|
||||
padding: 5px 6px;
|
||||
font-size: 11px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--wfm-text-secondary);
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
margin-bottom: -1px;
|
||||
transition: color 0.15s;
|
||||
}
|
||||
.wfm-batch-inner-tab:hover { color: var(--wfm-text-primary); background: var(--wfm-surface); }
|
||||
.wfm-batch-inner-tab.active { color: var(--wfm-primary); border-bottom-color: var(--wfm-primary); }
|
||||
.wfm-batch-inner-content {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wfm-batch-inner-content.active { display: flex; }
|
||||
.wfm-batch-group-list { flex: 1; overflow-y: auto; padding: 2px 0; }
|
||||
.wfm-batch-group-item { border-bottom: 1px solid rgba(255,255,255,0.04); }
|
||||
.wfm-batch-group-item:last-child { border-bottom: none; }
|
||||
.wfm-batch-group-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 5px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.wfm-batch-group-header:hover { background: rgba(255,255,255,0.05); }
|
||||
.wfm-batch-group-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.wfm-batch-group-count { font-size: 10px; color: var(--wfm-text-secondary); white-space: nowrap; }
|
||||
.wfm-batch-group-members { display: none; }
|
||||
.wfm-batch-group-item.open .wfm-batch-group-members { display: block; }
|
||||
.wfm-batch-count {
|
||||
font-size: 11px;
|
||||
color: var(--wfm-text-secondary);
|
||||
padding: 4px 10px;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wfm-batch-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 8px;
|
||||
font-size: 11px;
|
||||
color: var(--wfm-text-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wfm-batch-preview-item:hover { background: rgba(255,255,255,0.05); }
|
||||
|
||||
/* ── Feeder Tab ─────────────────────────────────────────────────── */
|
||||
.wfm-feeder-layout {
|
||||
display: flex;
|
||||
@@ -4441,3 +4561,272 @@ body {
|
||||
padding-top: 5px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
AI Tab
|
||||
============================================ */
|
||||
|
||||
#wfm-tab-ai {
|
||||
display: none;
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#wfm-tab-ai.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* 3-pane layout */
|
||||
.wfm-ai-pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.wfm-ai-pane-translate { flex: 4; }
|
||||
.wfm-ai-pane-tools { flex: 4; }
|
||||
.wfm-ai-pane-settings { flex: 2; }
|
||||
|
||||
.wfm-ai-pane-header {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--wfm-text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
padding: 8px 12px;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
background: var(--wfm-surface);
|
||||
}
|
||||
|
||||
.wfm-ai-pane-divider {
|
||||
width: 1px;
|
||||
background: var(--wfm-border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Translation tab */
|
||||
.wfm-ai-trans-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.wfm-ai-trans-lang-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.wfm-ai-lang-select {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.wfm-ai-swap-btn {
|
||||
flex-shrink: 0;
|
||||
padding: 6px 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.wfm-ai-trans-textarea {
|
||||
flex: 1;
|
||||
min-height: 120px;
|
||||
padding: 8px 10px;
|
||||
background: var(--wfm-bg);
|
||||
border: 1px solid var(--wfm-border);
|
||||
border-radius: var(--wfm-radius-sm);
|
||||
color: var(--wfm-text);
|
||||
font-size: 13px;
|
||||
font-family: inherit;
|
||||
resize: none;
|
||||
line-height: 1.5;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
|
||||
.wfm-ai-trans-textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--wfm-primary);
|
||||
}
|
||||
|
||||
.wfm-ai-trans-output {
|
||||
background: var(--wfm-bg-secondary);
|
||||
color: var(--wfm-text-secondary);
|
||||
}
|
||||
|
||||
.wfm-ai-trans-output:focus {
|
||||
border-color: var(--wfm-border);
|
||||
}
|
||||
|
||||
.wfm-ai-trans-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wfm-ai-trans-status {
|
||||
font-size: 12px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.wfm-ai-status-working { color: var(--wfm-warning); }
|
||||
.wfm-ai-status-ok { color: var(--wfm-success); }
|
||||
.wfm-ai-status-error { color: var(--wfm-danger); }
|
||||
|
||||
/* VLM placeholder */
|
||||
.wfm-ai-placeholder-msg {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
color: var(--wfm-text-secondary);
|
||||
font-size: 14px;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
/* Settings tab */
|
||||
.wfm-ai-settings-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
padding: 12px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.wfm-ai-settings-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid var(--wfm-border);
|
||||
}
|
||||
|
||||
.wfm-ai-settings-section:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.wfm-ai-settings-title {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--wfm-text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.wfm-ai-settings-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.wfm-ai-backend-row {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.wfm-ai-radio-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
color: var(--wfm-text);
|
||||
}
|
||||
|
||||
.wfm-ai-label {
|
||||
font-size: 12px;
|
||||
color: var(--wfm-text-secondary);
|
||||
white-space: nowrap;
|
||||
width: 60px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wfm-ai-url-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.wfm-ai-model-select {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.wfm-ai-test-result {
|
||||
font-size: 12px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
/* VLM Tab */
|
||||
.wfm-ai-vlm-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.wfm-ai-vlm-drop {
|
||||
height: 110px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 2px dashed var(--wfm-border);
|
||||
border-radius: var(--wfm-radius-sm);
|
||||
background: var(--wfm-bg);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
transition: border-color 0.15s, background 0.15s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wfm-ai-vlm-drop:hover,
|
||||
.wfm-ai-vlm-drop.drag-over {
|
||||
border-color: var(--wfm-primary);
|
||||
background: rgba(74, 158, 255, 0.05);
|
||||
}
|
||||
|
||||
.wfm-ai-vlm-label {
|
||||
font-size: 12px;
|
||||
color: var(--wfm-text-secondary);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.wfm-ai-vlm-task-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wfm-ai-vlm-task-row .wfm-select {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.wfm-ai-vlm-result {
|
||||
flex: 1;
|
||||
min-height: 80px;
|
||||
padding: 8px 10px;
|
||||
background: var(--wfm-bg-secondary);
|
||||
border: 1px solid var(--wfm-border);
|
||||
border-radius: var(--wfm-radius-sm);
|
||||
color: var(--wfm-text-secondary);
|
||||
font-size: 13px;
|
||||
font-family: inherit;
|
||||
resize: none;
|
||||
outline: none;
|
||||
line-height: 1.5;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.wfm-ai-vlm-copy-btn {
|
||||
align-self: flex-end;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,455 @@
|
||||
/**
|
||||
* AI Tab - Translation, VLM, Settings
|
||||
* Supports Ollama and LM Studio as backends
|
||||
*/
|
||||
|
||||
import { showToast } from "./app.js";
|
||||
import { t } from "./i18n.js";
|
||||
|
||||
const SETTINGS_KEY = "wfm_ai_settings";
|
||||
|
||||
const LANG_NAMES = {
|
||||
ja: "Japanese",
|
||||
en: "English",
|
||||
zh: "Chinese",
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// Settings persistence
|
||||
// ============================================
|
||||
|
||||
function loadAiSettings() {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(SETTINGS_KEY) || "{}");
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function saveAiSettings(patch) {
|
||||
const data = { ...loadAiSettings(), ...patch };
|
||||
localStorage.setItem(SETTINGS_KEY, JSON.stringify(data));
|
||||
return data;
|
||||
}
|
||||
|
||||
const VLM_PROMPTS = {
|
||||
describe: "Describe this image in detail.",
|
||||
prompt: "Create a detailed Stable Diffusion image generation prompt based on this image. Output only the prompt text, nothing else.",
|
||||
tags: "Generate a list of descriptive tags for this image. Output only comma-separated tags in English, nothing else.",
|
||||
};
|
||||
|
||||
function fileToBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = e => {
|
||||
const b64 = e.target.result.split(",")[1];
|
||||
resolve({ base64: b64, mimeType: file.type });
|
||||
};
|
||||
reader.onerror = reject;
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
async function callVLM(url, backend, model, prompt, base64Image, mimeType) {
|
||||
if (backend === "ollama") {
|
||||
const res = await fetch(`${url}/api/generate`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ model, prompt, images: [base64Image], stream: false }),
|
||||
});
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
return (await res.json()).response || "";
|
||||
} else {
|
||||
const res = await fetch(`${url}/v1/chat/completions`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
model,
|
||||
messages: [{ role: "user", content: [
|
||||
{ type: "text", text: prompt },
|
||||
{ type: "image_url", image_url: { url: `data:${mimeType};base64,${base64Image}` } },
|
||||
]}],
|
||||
stream: false,
|
||||
}),
|
||||
});
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
return (await res.json()).choices?.[0]?.message?.content || "";
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// URL validation
|
||||
// ============================================
|
||||
|
||||
function isValidBackendUrl(url) {
|
||||
try {
|
||||
const u = new URL(url);
|
||||
return u.protocol === "http:" || u.protocol === "https:";
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// API helpers
|
||||
// ============================================
|
||||
|
||||
async function fetchModels(url, backend) {
|
||||
if (backend === "ollama") {
|
||||
const res = await fetch(`${url}/api/tags`);
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
const data = await res.json();
|
||||
return (data.models || []).map((m) => m.name);
|
||||
} else {
|
||||
// LM Studio (OpenAI-compatible)
|
||||
const res = await fetch(`${url}/v1/models`);
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
const data = await res.json();
|
||||
return (data.data || []).map((m) => m.id);
|
||||
}
|
||||
}
|
||||
|
||||
async function testConnection(url, backend) {
|
||||
const models = await fetchModels(url, backend);
|
||||
return models.length;
|
||||
}
|
||||
|
||||
async function callLLM(url, backend, model, prompt) {
|
||||
if (backend === "ollama") {
|
||||
const res = await fetch(`${url}/api/generate`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ model, prompt, stream: false }),
|
||||
});
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
const data = await res.json();
|
||||
return data.response || "";
|
||||
} else {
|
||||
// LM Studio (OpenAI-compatible)
|
||||
const res = await fetch(`${url}/v1/chat/completions`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
model,
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
stream: false,
|
||||
}),
|
||||
});
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
const data = await res.json();
|
||||
return data.choices?.[0]?.message?.content || "";
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Translation prompt builder
|
||||
// ============================================
|
||||
|
||||
function buildTranslationPrompt(text, srcLang, dstLang, settings) {
|
||||
const srcName = srcLang === "free" ? (settings.freeSrcLang || "Auto") : LANG_NAMES[srcLang];
|
||||
const dstName = dstLang === "free" ? (settings.freeDstLang || "English") : LANG_NAMES[dstLang];
|
||||
const fromPart = srcLang === "free" ? "" : `from ${srcName} `;
|
||||
return `Translate the following text ${fromPart}to ${dstName}. Output only the translated text, nothing else.\n\n${text}`;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Translation tab
|
||||
// ============================================
|
||||
|
||||
function initTranslateTab() {
|
||||
const srcLangSel = document.getElementById("wfm-ai-src-lang");
|
||||
const dstLangSel = document.getElementById("wfm-ai-dst-lang");
|
||||
const swapBtn = document.getElementById("wfm-ai-trans-swap-btn");
|
||||
const inputEl = document.getElementById("wfm-ai-trans-input");
|
||||
const outputEl = document.getElementById("wfm-ai-trans-output");
|
||||
const transBtn = document.getElementById("wfm-ai-trans-btn");
|
||||
const copyBtn = document.getElementById("wfm-ai-trans-copy-btn");
|
||||
const statusEl = document.getElementById("wfm-ai-trans-status");
|
||||
|
||||
if (!transBtn) return;
|
||||
|
||||
// Restore saved language selections
|
||||
const saved = loadAiSettings();
|
||||
if (saved.srcLang && srcLangSel) srcLangSel.value = saved.srcLang;
|
||||
if (saved.dstLang && dstLangSel) dstLangSel.value = saved.dstLang;
|
||||
|
||||
// Persist language selections
|
||||
srcLangSel?.addEventListener("change", () => saveAiSettings({ srcLang: srcLangSel.value }));
|
||||
dstLangSel?.addEventListener("change", () => saveAiSettings({ dstLang: dstLangSel.value }));
|
||||
|
||||
// Swap languages
|
||||
swapBtn?.addEventListener("click", () => {
|
||||
const tmp = srcLangSel.value;
|
||||
srcLangSel.value = dstLangSel.value;
|
||||
dstLangSel.value = tmp;
|
||||
saveAiSettings({ srcLang: srcLangSel.value, dstLang: dstLangSel.value });
|
||||
// Swap text content too
|
||||
const tmpText = inputEl.value;
|
||||
inputEl.value = outputEl.value;
|
||||
outputEl.value = tmpText;
|
||||
});
|
||||
|
||||
// Translate
|
||||
transBtn.addEventListener("click", async () => {
|
||||
const text = inputEl.value.trim();
|
||||
if (!text) {
|
||||
showToast(t("aiToastNoText"), "error");
|
||||
return;
|
||||
}
|
||||
|
||||
const settings = loadAiSettings();
|
||||
const { backend = "ollama", backendUrl, model } = settings;
|
||||
const url = backendUrl || (backend === "ollama" ? "http://localhost:11434" : "http://localhost:1234");
|
||||
|
||||
if (!isValidBackendUrl(url)) {
|
||||
showToast(t("aiToastInvalidUrl"), "error");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!model) {
|
||||
showToast(t("aiToastNoModel"), "error");
|
||||
return;
|
||||
}
|
||||
|
||||
transBtn.disabled = true;
|
||||
statusEl.textContent = t("aiStatusTranslating");
|
||||
statusEl.className = "wfm-ai-trans-status wfm-ai-status-working";
|
||||
outputEl.value = "";
|
||||
|
||||
try {
|
||||
const prompt = buildTranslationPrompt(text, srcLangSel.value, dstLangSel.value, settings);
|
||||
const result = await callLLM(url, backend, model, prompt);
|
||||
outputEl.value = result.trim();
|
||||
statusEl.textContent = t("aiStatusDone");
|
||||
statusEl.className = "wfm-ai-trans-status wfm-ai-status-ok";
|
||||
} catch (err) {
|
||||
statusEl.textContent = `${t("aiStatusConnectFail")}${err.message}`;
|
||||
statusEl.className = "wfm-ai-trans-status wfm-ai-status-error";
|
||||
showToast(t("aiToastTransFailed") + err.message, "error");
|
||||
} finally {
|
||||
transBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Copy translated text
|
||||
copyBtn?.addEventListener("click", () => {
|
||||
const text = outputEl.value;
|
||||
if (!text) {
|
||||
showToast(t("aiToastNoCopyText"), "error");
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
showToast(t("aiToastCopied"), "success");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Settings tab
|
||||
// ============================================
|
||||
|
||||
async function refreshModels() {
|
||||
const settings = loadAiSettings();
|
||||
const backend = document.querySelector("input[name='wfm-ai-backend']:checked")?.value || "ollama";
|
||||
const url = document.getElementById("wfm-ai-backend-url")?.value?.trim() || "";
|
||||
const modelSel = document.getElementById("wfm-ai-model-select");
|
||||
const refreshBtn = document.getElementById("wfm-ai-model-refresh-btn");
|
||||
|
||||
if (!modelSel) return;
|
||||
|
||||
if (refreshBtn) refreshBtn.disabled = true;
|
||||
try {
|
||||
const models = await fetchModels(url, backend);
|
||||
modelSel.innerHTML = `<option value="">-- ${t("aiSettingsModelPlaceholder")} --</option>`;
|
||||
models.forEach((name) => {
|
||||
const opt = document.createElement("option");
|
||||
opt.value = name;
|
||||
opt.textContent = name;
|
||||
if (name === settings.model) opt.selected = true;
|
||||
modelSel.appendChild(opt);
|
||||
});
|
||||
if (models.length === 0) showToast(t("aiToastNoModels"), "error");
|
||||
} catch (err) {
|
||||
showToast(t("aiToastModelsFailed") + err.message, "error");
|
||||
} finally {
|
||||
if (refreshBtn) refreshBtn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function initSettingsTab() {
|
||||
const saved = loadAiSettings();
|
||||
|
||||
// Restore saved values
|
||||
const backendRadios = document.querySelectorAll("input[name='wfm-ai-backend']");
|
||||
backendRadios.forEach((r) => {
|
||||
if (r.value === (saved.backend || "ollama")) r.checked = true;
|
||||
});
|
||||
|
||||
const urlInput = document.getElementById("wfm-ai-backend-url");
|
||||
if (urlInput && saved.backendUrl) urlInput.value = saved.backendUrl;
|
||||
|
||||
// Update URL placeholder when backend changes
|
||||
backendRadios.forEach((r) => {
|
||||
r.addEventListener("change", () => {
|
||||
if (!urlInput) return;
|
||||
const defaultUrl = r.value === "ollama" ? "http://localhost:11434" : "http://localhost:1234";
|
||||
if (!saved.backendUrl) urlInput.value = defaultUrl;
|
||||
});
|
||||
});
|
||||
|
||||
// Connection test
|
||||
document.getElementById("wfm-ai-test-btn")?.addEventListener("click", async () => {
|
||||
const testBtn = document.getElementById("wfm-ai-test-btn");
|
||||
const resultEl = document.getElementById("wfm-ai-test-result");
|
||||
const backend = document.querySelector("input[name='wfm-ai-backend']:checked")?.value || "ollama";
|
||||
const url = urlInput?.value?.trim() || "";
|
||||
|
||||
if (!isValidBackendUrl(url)) {
|
||||
if (resultEl) {
|
||||
resultEl.textContent = t("aiToastInvalidUrlInput");
|
||||
resultEl.className = "wfm-ai-test-result wfm-ai-status-error";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (testBtn) testBtn.disabled = true;
|
||||
if (resultEl) {
|
||||
resultEl.textContent = t("aiStatusConnecting");
|
||||
resultEl.className = "wfm-ai-test-result wfm-ai-status-working";
|
||||
}
|
||||
|
||||
try {
|
||||
const count = await testConnection(url, backend);
|
||||
if (resultEl) {
|
||||
resultEl.textContent = `${t("aiStatusConnectOk")} (${count} ${t("aiModels")})`;
|
||||
resultEl.className = "wfm-ai-test-result wfm-ai-status-ok";
|
||||
}
|
||||
await refreshModels();
|
||||
} catch (err) {
|
||||
if (resultEl) {
|
||||
resultEl.textContent = `${t("aiStatusConnectFail")}${err.message}`;
|
||||
resultEl.className = "wfm-ai-test-result wfm-ai-status-error";
|
||||
}
|
||||
} finally {
|
||||
if (testBtn) testBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Model refresh
|
||||
document.getElementById("wfm-ai-model-refresh-btn")?.addEventListener("click", () => refreshModels());
|
||||
|
||||
// Free language inputs
|
||||
const freeSrcInput = document.getElementById("wfm-ai-free-src-lang");
|
||||
const freeDstInput = document.getElementById("wfm-ai-free-dst-lang");
|
||||
if (freeSrcInput && saved.freeSrcLang) freeSrcInput.value = saved.freeSrcLang;
|
||||
if (freeDstInput && saved.freeDstLang) freeDstInput.value = saved.freeDstLang;
|
||||
|
||||
// Save settings
|
||||
document.getElementById("wfm-ai-settings-save-btn")?.addEventListener("click", () => {
|
||||
const backend = document.querySelector("input[name='wfm-ai-backend']:checked")?.value || "ollama";
|
||||
const url = urlInput?.value?.trim() || "";
|
||||
const model = document.getElementById("wfm-ai-model-select")?.value || "";
|
||||
const freeSrcLang = freeSrcInput?.value?.trim() || "";
|
||||
const freeDstLang = freeDstInput?.value?.trim() || "";
|
||||
|
||||
if (url && !isValidBackendUrl(url)) {
|
||||
showToast(t("aiToastInvalidUrl"), "error");
|
||||
return;
|
||||
}
|
||||
|
||||
saveAiSettings({ backend, backendUrl: url, model, freeSrcLang, freeDstLang });
|
||||
showToast(t("aiToastSettingsSaved"), "success");
|
||||
});
|
||||
|
||||
// Load models on init if settings exist
|
||||
if (saved.backendUrl && saved.backend) {
|
||||
refreshModels().catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// VLM tab
|
||||
// ============================================
|
||||
|
||||
function initVlmTab() {
|
||||
const dropEl = document.getElementById("wfm-ai-vlm-drop");
|
||||
const previewEl = document.getElementById("wfm-ai-vlm-preview");
|
||||
const labelEl = document.getElementById("wfm-ai-vlm-label");
|
||||
const fileInput = document.getElementById("wfm-ai-vlm-file");
|
||||
const taskSel = document.getElementById("wfm-ai-vlm-task");
|
||||
const runBtn = document.getElementById("wfm-ai-vlm-run");
|
||||
const statusEl = document.getElementById("wfm-ai-vlm-status");
|
||||
const resultEl = document.getElementById("wfm-ai-vlm-result");
|
||||
const copyBtn = document.getElementById("wfm-ai-vlm-copy");
|
||||
|
||||
if (!dropEl) return;
|
||||
|
||||
let vlmImage = null; // { base64, mimeType }
|
||||
|
||||
const loadImage = async (file) => {
|
||||
if (!file || !file.type.startsWith("image/")) return;
|
||||
vlmImage = await fileToBase64(file);
|
||||
previewEl.src = `data:${vlmImage.mimeType};base64,${vlmImage.base64}`;
|
||||
previewEl.style.display = "block";
|
||||
labelEl.style.display = "none";
|
||||
};
|
||||
|
||||
dropEl.addEventListener("click", () => fileInput.click());
|
||||
fileInput.addEventListener("change", e => { if (e.target.files[0]) loadImage(e.target.files[0]); });
|
||||
dropEl.addEventListener("dragover", e => { e.preventDefault(); dropEl.classList.add("drag-over"); });
|
||||
dropEl.addEventListener("dragleave", () => dropEl.classList.remove("drag-over"));
|
||||
dropEl.addEventListener("drop", e => {
|
||||
e.preventDefault();
|
||||
dropEl.classList.remove("drag-over");
|
||||
if (e.dataTransfer.files[0]) loadImage(e.dataTransfer.files[0]);
|
||||
});
|
||||
|
||||
runBtn.addEventListener("click", async () => {
|
||||
if (!vlmImage) { showToast(t("aiToastNoImage"), "error"); return; }
|
||||
|
||||
const settings = loadAiSettings();
|
||||
const { backend = "ollama", backendUrl, model } = settings;
|
||||
const url = backendUrl || (backend === "ollama" ? "http://localhost:11434" : "http://localhost:1234");
|
||||
|
||||
if (!isValidBackendUrl(url)) {
|
||||
showToast(t("aiToastInvalidUrl"), "error");
|
||||
return;
|
||||
}
|
||||
if (!model) { showToast(t("aiToastNoModel"), "error"); return; }
|
||||
|
||||
const task = taskSel?.value || "describe";
|
||||
runBtn.disabled = true;
|
||||
statusEl.textContent = t("aiStatusRunning");
|
||||
statusEl.className = "wfm-ai-trans-status wfm-ai-status-working";
|
||||
resultEl.value = "";
|
||||
|
||||
try {
|
||||
const result = await callVLM(url, backend, model, VLM_PROMPTS[task], vlmImage.base64, vlmImage.mimeType);
|
||||
resultEl.value = result.trim();
|
||||
statusEl.textContent = t("aiStatusDone");
|
||||
statusEl.className = "wfm-ai-trans-status wfm-ai-status-ok";
|
||||
} catch (err) {
|
||||
statusEl.textContent = `${t("aiStatusConnectFail")}${err.message}`;
|
||||
statusEl.className = "wfm-ai-trans-status wfm-ai-status-error";
|
||||
showToast(t("aiToastVlmFailed") + err.message, "error");
|
||||
} finally {
|
||||
runBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
copyBtn.addEventListener("click", () => {
|
||||
const text = resultEl.value;
|
||||
if (!text) { showToast(t("aiToastNoCopyText"), "error"); return; }
|
||||
navigator.clipboard.writeText(text).then(() => showToast(t("aiToastCopied"), "success"));
|
||||
});
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Export
|
||||
// ============================================
|
||||
|
||||
export function initAiTab() {
|
||||
initTranslateTab();
|
||||
initVlmTab();
|
||||
initSettingsTab();
|
||||
}
|
||||
@@ -90,7 +90,7 @@ function initTabs() {
|
||||
|
||||
function applyI18nToHtml() {
|
||||
// Tab labels
|
||||
const tabMap = { workflow: "tabWorkflow", nodes: "tabNodes", models: "tabModels", generate: "tabGenerate", prompt: "tabPrompt", metadata: "tabMetadata", gallery: "tabGallery", settings: "tabSettings", help: "tabHelp" };
|
||||
const tabMap = { workflow: "tabWorkflow", nodes: "tabNodes", models: "tabModels", generate: "tabGenerate", prompt: "tabPrompt", metadata: "tabMetadata", gallery: "tabGallery", settings: "tabSettings", help: "tabHelp", ai: "tabAi" };
|
||||
document.querySelectorAll(".wfm-tab").forEach((tab) => {
|
||||
const key = tabMap[tab.dataset.tab];
|
||||
if (key) tab.textContent = t(key);
|
||||
@@ -224,6 +224,67 @@ function applyI18nToHtml() {
|
||||
const presetCopyNegBtn = document.getElementById("wfm-preset-copy-neg-btn");
|
||||
if (presetCopyNegBtn) presetCopyNegBtn.textContent = t("copyNegativePrompt");
|
||||
|
||||
// AI tab
|
||||
document.querySelectorAll(".wfm-ai-subtab-btn").forEach(btn => {
|
||||
if (btn.dataset.aiSubtab === "translate") btn.textContent = t("aiSubTabTranslate");
|
||||
if (btn.dataset.aiSubtab === "vlm") btn.textContent = t("aiSubTabVlm");
|
||||
if (btn.dataset.aiSubtab === "ai-settings") btn.textContent = t("aiSubTabSettings");
|
||||
});
|
||||
const aiLangMap = { ja: "aiLangJa", en: "aiLangEn", zh: "aiLangZh", free: "aiLangFree" };
|
||||
[document.getElementById("wfm-ai-src-lang"), document.getElementById("wfm-ai-dst-lang")].forEach(sel => {
|
||||
if (!sel) return;
|
||||
sel.querySelectorAll("option").forEach(opt => {
|
||||
const key = aiLangMap[opt.value];
|
||||
if (key) opt.textContent = t(key);
|
||||
});
|
||||
});
|
||||
const aiTransInput = document.getElementById("wfm-ai-trans-input");
|
||||
if (aiTransInput) aiTransInput.placeholder = t("aiTransInputPlaceholder");
|
||||
const aiTransOutput = document.getElementById("wfm-ai-trans-output");
|
||||
if (aiTransOutput) aiTransOutput.placeholder = t("aiTransOutputPlaceholder");
|
||||
const aiTransBtn = document.getElementById("wfm-ai-trans-btn");
|
||||
if (aiTransBtn) aiTransBtn.textContent = t("aiTranslateBtn");
|
||||
const aiTransCopyBtn = document.getElementById("wfm-ai-trans-copy-btn");
|
||||
if (aiTransCopyBtn) aiTransCopyBtn.textContent = t("aiCopyBtn");
|
||||
const aiVlmLabel = document.getElementById("wfm-ai-vlm-label");
|
||||
if (aiVlmLabel) aiVlmLabel.textContent = t("aiVlmDropLabel");
|
||||
const aiVlmTask = document.getElementById("wfm-ai-vlm-task");
|
||||
if (aiVlmTask) {
|
||||
aiVlmTask.querySelectorAll("option").forEach(opt => {
|
||||
if (opt.value === "describe") opt.textContent = t("aiVlmDescribe");
|
||||
if (opt.value === "prompt") opt.textContent = t("aiVlmPromptCreate");
|
||||
});
|
||||
}
|
||||
const aiVlmRunBtn = document.getElementById("wfm-ai-vlm-run");
|
||||
if (aiVlmRunBtn) aiVlmRunBtn.textContent = t("aiVlmRunBtn");
|
||||
const aiVlmResult = document.getElementById("wfm-ai-vlm-result");
|
||||
if (aiVlmResult) aiVlmResult.placeholder = t("aiVlmResultPlaceholder");
|
||||
const aiVlmCopyBtn = document.getElementById("wfm-ai-vlm-copy");
|
||||
if (aiVlmCopyBtn) aiVlmCopyBtn.textContent = t("aiCopyBtn");
|
||||
const aiBackendTitle = document.getElementById("wfm-ai-settings-backend-title");
|
||||
if (aiBackendTitle) aiBackendTitle.textContent = t("aiSettingsBackend");
|
||||
const aiConnTitle = document.getElementById("wfm-ai-settings-conn-title");
|
||||
if (aiConnTitle) aiConnTitle.textContent = t("aiSettingsConnection");
|
||||
const aiTestBtn = document.getElementById("wfm-ai-test-btn");
|
||||
if (aiTestBtn) aiTestBtn.textContent = t("aiSettingsTestBtn");
|
||||
const aiModelTitle = document.getElementById("wfm-ai-settings-model-title");
|
||||
if (aiModelTitle) aiModelTitle.textContent = t("aiSettingsModelSection");
|
||||
const aiModelSel = document.getElementById("wfm-ai-model-select");
|
||||
if (aiModelSel) {
|
||||
const firstOpt = aiModelSel.querySelector("option[value='']");
|
||||
if (firstOpt) firstOpt.textContent = t("aiSettingsModelPlaceholder");
|
||||
}
|
||||
const aiModelRefreshBtn = document.getElementById("wfm-ai-model-refresh-btn");
|
||||
if (aiModelRefreshBtn) aiModelRefreshBtn.textContent = t("aiSettingsRefreshBtn");
|
||||
const aiFreeLangTitle = document.getElementById("wfm-ai-settings-freelang-title");
|
||||
if (aiFreeLangTitle) aiFreeLangTitle.textContent = t("aiSettingsFreeLang");
|
||||
const aiFreeSrcLabel = document.getElementById("wfm-ai-free-src-label");
|
||||
if (aiFreeSrcLabel) aiFreeSrcLabel.textContent = t("aiSettingsInputLang");
|
||||
const aiFreeDstLabel = document.getElementById("wfm-ai-free-dst-label");
|
||||
if (aiFreeDstLabel) aiFreeDstLabel.textContent = t("aiSettingsOutputLang");
|
||||
const aiSaveBtn = document.getElementById("wfm-ai-settings-save-btn");
|
||||
if (aiSaveBtn) aiSaveBtn.textContent = t("aiSettingsSaveBtn");
|
||||
|
||||
// Group panel labels
|
||||
const propTitle = document.querySelector("#wfm-side-tab-group .wfm-group-section-title");
|
||||
if (propTitle) propTitle.textContent = t("properties");
|
||||
@@ -265,7 +326,8 @@ function applyI18nToHtml() {
|
||||
"wfm-help-gen-3": "helpGen3", "wfm-help-gen-4": "helpGen4",
|
||||
"wfm-help-gen-5": "helpGen5", "wfm-help-gen-6": "helpGen6", "wfm-help-gen-7": "helpGen7",
|
||||
"wfm-help-gen-8": "helpGen8", "wfm-help-gen-9": "helpGen9", "wfm-help-gen-10": "helpGen10",
|
||||
"wfm-help-gen-11": "helpGen11",
|
||||
"wfm-help-gen-11": "helpGen11", "wfm-help-gen-12": "helpGen12",
|
||||
"wfm-help-gen-13": "helpGen13", "wfm-help-gen-14": "helpGen14",
|
||||
"wfm-help-feeder-title": "helpFeederTitle",
|
||||
"wfm-help-feeder-desc": "helpFeederDesc",
|
||||
"wfm-help-feeder-1": "helpFeeder1", "wfm-help-feeder-2": "helpFeeder2",
|
||||
@@ -283,6 +345,8 @@ function applyI18nToHtml() {
|
||||
"wfm-help-settings-5": "helpSettings5", "wfm-help-settings-6": "helpSettings6",
|
||||
"wfm-help-settings-7": "helpSettings7", "wfm-help-settings-8": "helpSettings8",
|
||||
"wfm-help-settings-9": "helpSettings9", "wfm-help-settings-10": "helpSettings10",
|
||||
"wfm-help-settings-11": "helpSettings11", "wfm-help-settings-12": "helpSettings12",
|
||||
"wfm-help-settings-13": "helpSettings13",
|
||||
"wfm-help-nodes-1": "helpNodes1", "wfm-help-nodes-2": "helpNodes2",
|
||||
"wfm-help-nodes-3": "helpNodes3", "wfm-help-nodes-4": "helpNodes4",
|
||||
"wfm-help-nodes-5": "helpNodes5", "wfm-help-nodes-6": "helpNodes6",
|
||||
@@ -308,6 +372,10 @@ function applyI18nToHtml() {
|
||||
"wfm-help-sidepanel-11": "helpSidepanel11", "wfm-help-sidepanel-12": "helpSidepanel12",
|
||||
"wfm-help-sidepanel-13": "helpSidepanel13",
|
||||
"wfm-help-sidepanel-14": "helpSidepanel14", "wfm-help-sidepanel-15": "helpSidepanel15",
|
||||
"wfm-help-sidepanel-16": "helpSidepanel16",
|
||||
"wfm-help-ai-title": "helpAiTitle",
|
||||
"wfm-help-ai-1": "helpAi1", "wfm-help-ai-2": "helpAi2", "wfm-help-ai-3": "helpAi3",
|
||||
"wfm-help-ai-4": "helpAi4", "wfm-help-ai-5": "helpAi5", "wfm-help-ai-6": "helpAi6",
|
||||
"wfm-help-shortcuts-title": "helpShortcutsTitle",
|
||||
"wfm-help-shortcuts-1": "helpShortcuts1", "wfm-help-shortcuts-2": "helpShortcuts2",
|
||||
"wfm-help-shortcuts-3": "helpShortcuts3", "wfm-help-shortcuts-4": "helpShortcuts4",
|
||||
@@ -361,10 +429,11 @@ import { initWorkflowTab } from "./workflow-tab.js";
|
||||
import { initNodesTab } from "./nodes-tab.js";
|
||||
import { initGenerateTab } from "./generate-tab.js";
|
||||
import { initPromptTab } from "./prompt-tab.js";
|
||||
import { initSettingsTab, applyTheme, getSavedTheme, applyTextareaFontSize } from "./settings-tab.js";
|
||||
import { initSettingsTab, applyTheme, getSavedTheme, applyTextareaFontSize, applyJsonColors } from "./settings-tab.js";
|
||||
import { initModelsTab } from "./models-tab.js";
|
||||
import { initGalleryTab } from "./gallery-tab.js";
|
||||
import { initMetadataTab } from "./metadata-tab.js";
|
||||
import { initAiTab } from "./ai-tab.js";
|
||||
|
||||
// Apply saved theme immediately to prevent flash of default theme
|
||||
applyTheme(getSavedTheme());
|
||||
@@ -375,6 +444,12 @@ try {
|
||||
if (_s.textareaFontSize) applyTextareaFontSize(_s.textareaFontSize);
|
||||
} catch {}
|
||||
|
||||
// Apply saved JSON highlight colors
|
||||
try {
|
||||
const _s = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
applyJsonColors(_s.jsonColors);
|
||||
} catch {}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
applyI18nToHtml();
|
||||
initTabs();
|
||||
@@ -387,6 +462,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
initPromptTab();
|
||||
initMetadataTab();
|
||||
initGalleryTab();
|
||||
initAiTab();
|
||||
|
||||
console.log("Workflow Studio: App initialized");
|
||||
});
|
||||
|
||||
@@ -305,6 +305,21 @@ export const comfyWorkflow = {
|
||||
// 2. Map widgets_values to widget input names using object_info
|
||||
const widgets = node.widgets_values || [];
|
||||
if (widgets.length > 0) {
|
||||
// Lora Loader (LoraManager): use __lm_widget_ids from node properties
|
||||
// widgets_values: [autocomplete_meta_obj, text_str, loras_array]
|
||||
// API format: {__lm_autocomplete_meta_text: obj, text: str, loras: {__value__: arr}}
|
||||
const lmWidgetIds = node.properties?.__lm_widget_ids;
|
||||
if (lmWidgetIds && Array.isArray(lmWidgetIds)) {
|
||||
lmWidgetIds.forEach((name, idx) => {
|
||||
if (idx >= widgets.length || linkedInputNames.has(name)) return;
|
||||
let val = widgets[idx];
|
||||
if (name === "loras" && Array.isArray(val)) {
|
||||
val = { "__value__": val };
|
||||
}
|
||||
inputs[name] = val;
|
||||
});
|
||||
} else {
|
||||
|
||||
const widgetNames = _getWidgetInputNames(objectInfo, node.type);
|
||||
|
||||
if (widgetNames.length > 0) {
|
||||
@@ -374,6 +389,7 @@ export const comfyWorkflow = {
|
||||
});
|
||||
}
|
||||
}
|
||||
} // end else (non-LoraManager path)
|
||||
}
|
||||
|
||||
api[nodeId] = {
|
||||
|
||||
@@ -153,10 +153,11 @@ export async function loadWorkflowIntoEditor(workflow, filename) {
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Checkpoint Batch
|
||||
// Batch (multi-type: Checkpoint / Lora / Prompt / Workflow)
|
||||
// ============================================
|
||||
|
||||
const _ckptBatch = { aborted: false, paused: false, _resumeResolve: null };
|
||||
let _activeBatchType = null; // "checkpoint" | "lora" | "prompt" | "workflow" | null
|
||||
|
||||
async function _waitIfPaused() {
|
||||
if (!_ckptBatch.paused) return;
|
||||
@@ -171,27 +172,161 @@ function _setPauseBtnState(paused) {
|
||||
btn.style.color = paused ? "#fff" : "";
|
||||
}
|
||||
|
||||
function _updateBatchTypeLabel(running = false) {
|
||||
const el = document.getElementById("wfm-batch-type-label");
|
||||
if (!el) return;
|
||||
const labels = { checkpoint: "Checkpoint", lora: "Lora", prompt: "Prompt", workflow: "Workflow" };
|
||||
if (_activeBatchType) {
|
||||
el.textContent = labels[_activeBatchType];
|
||||
el.style.color = running ? "var(--wfm-primary)" : "";
|
||||
} else {
|
||||
el.textContent = "—";
|
||||
el.style.color = "";
|
||||
}
|
||||
}
|
||||
|
||||
// mode: "all" = 全選択, "some" = 一部選択, "none" = 全解除
|
||||
const _ckptState = { mode: "all", selected: new Set() };
|
||||
const _ckptState = { mode: "none", selected: new Set() };
|
||||
|
||||
// グループ選択状態(中央ペイン)
|
||||
// selectedGroups : グループ全体が選択済み(グループ名のSet)
|
||||
// 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: {},
|
||||
};
|
||||
|
||||
// 汎用: groupsData/selectedGroups/partialSelectionsからメンバーSetを返す
|
||||
function _getItemsFromGroupState(groupsData, selectedGroups, partialSelections) {
|
||||
const result = new Set();
|
||||
for (const [name, members] of Object.entries(groupsData)) {
|
||||
if (selectedGroups.has(name)) {
|
||||
members.forEach((m) => result.add(m));
|
||||
} else {
|
||||
const partial = partialSelections[name];
|
||||
if (partial) partial.forEach((m) => { if (members.includes(m)) result.add(m); });
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// 中央ペイン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 || [];
|
||||
if (_ckptState.mode === "all") return all;
|
||||
if (_ckptState.mode === "none") return [];
|
||||
return all.filter((m) => _ckptState.selected.has(m));
|
||||
// 左ペイン(ファイルツリー)選択
|
||||
let leftModels;
|
||||
if (_ckptState.mode === "all") leftModels = all;
|
||||
else if (_ckptState.mode === "none") leftModels = [];
|
||||
else leftModels = all.filter((m) => _ckptState.selected.has(m));
|
||||
|
||||
// 中央ペイン(グループ)選択を統合(重複排除)
|
||||
const seen = new Set(leftModels);
|
||||
const result = [...leftModels];
|
||||
for (const m of _getSelectedGroupModels()) {
|
||||
if (!seen.has(m)) { seen.add(m); result.push(m); }
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function _updateDropdownLabel() {
|
||||
const labelEl = document.getElementById("wfm-ckpt-dropdown-label");
|
||||
if (!labelEl) return;
|
||||
const total = (comfyEditor.models.checkpoints || []).length;
|
||||
if (_ckptState.mode === "all") {
|
||||
labelEl.textContent = total > 0 ? `All (${total})` : "All checkpoints";
|
||||
} else if (_ckptState.mode === "none") {
|
||||
labelEl.textContent = `0 / ${total} selected`;
|
||||
} else {
|
||||
labelEl.textContent = `${_ckptState.selected.size} / ${total} selected`;
|
||||
function _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"
|
||||
);
|
||||
}
|
||||
|
||||
// モデルパスリストをフォルダ → [modelPath, ...] のMapに変換
|
||||
@@ -323,8 +458,7 @@ function _rebuildCkptList() {
|
||||
const s = _getFolderCheckState(models);
|
||||
folderCb.checked = s === "checked";
|
||||
folderCb.indeterminate = s === "indeterminate";
|
||||
_updateDropdownLabel();
|
||||
_updateBatchInfo();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
itemLabel.appendChild(fileCb);
|
||||
@@ -337,8 +471,7 @@ function _rebuildCkptList() {
|
||||
_toggleFolderModels(models, folderCb.checked, all);
|
||||
folderCb.indeterminate = false;
|
||||
filesDiv.querySelectorAll("input[type=checkbox]").forEach((cb) => { cb.checked = folderCb.checked; });
|
||||
_updateDropdownLabel();
|
||||
_updateBatchInfo();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// フォルダ名 / トグル矢印クリックで展開・折りたたみ
|
||||
@@ -356,70 +489,428 @@ function _rebuildCkptList() {
|
||||
}
|
||||
}
|
||||
|
||||
function _updateBatchInfo() {
|
||||
const infoEl = document.getElementById("wfm-ckpt-batch-info");
|
||||
if (!infoEl) return;
|
||||
const n = _getSelectedCheckpoints().length;
|
||||
infoEl.textContent = `${n} checkpoint${n !== 1 ? "s" : ""} will be processed`;
|
||||
// ============================================
|
||||
// Batch Tab
|
||||
// ============================================
|
||||
|
||||
async function _loadBatchCheckpointGroups() {
|
||||
try {
|
||||
const res = await fetch("/api/wfm/models/groups?type=checkpoint");
|
||||
if (res.ok) _batchGroupState.groups = await res.json();
|
||||
else _batchGroupState.groups = {};
|
||||
} catch { _batchGroupState.groups = {}; }
|
||||
|
||||
// 削除されたグループを選択状態からも除去
|
||||
const currentNames = new Set(Object.keys(_batchGroupState.groups));
|
||||
for (const name of _batchGroupState.selectedGroups) {
|
||||
if (!currentNames.has(name)) _batchGroupState.selectedGroups.delete(name);
|
||||
}
|
||||
for (const name of Object.keys(_batchGroupState.partialSelections)) {
|
||||
if (!currentNames.has(name)) delete _batchGroupState.partialSelections[name];
|
||||
}
|
||||
|
||||
_renderBatchGroupList();
|
||||
_renderBatchPreview();
|
||||
}
|
||||
|
||||
function initCheckpointBatch() {
|
||||
const checkbox = document.getElementById("wfm-ckpt-batch-enabled");
|
||||
const body = document.getElementById("wfm-ckpt-batch-body");
|
||||
const wrap = document.getElementById("wfm-ckpt-dropdown-wrap");
|
||||
const btn = document.getElementById("wfm-ckpt-dropdown-btn");
|
||||
const panel = document.getElementById("wfm-ckpt-dropdown-panel");
|
||||
function _renderBatchGroupList() {
|
||||
const el = document.getElementById("wfm-batch-group-list");
|
||||
if (!el) return;
|
||||
const groups = _batchGroupState.groups;
|
||||
const names = Object.keys(groups).sort();
|
||||
|
||||
checkbox?.addEventListener("change", () => {
|
||||
if (body) body.style.display = checkbox.checked ? "block" : "none";
|
||||
if (checkbox.checked) {
|
||||
_updateDropdownLabel();
|
||||
_updateBatchInfo();
|
||||
if (names.length === 0) {
|
||||
el.innerHTML = `<p class="wfm-placeholder" style="font-size:12px;padding:16px;">No groups defined.<br>Create groups in the Models tab.</p>`;
|
||||
return;
|
||||
}
|
||||
|
||||
el.innerHTML = "";
|
||||
for (const name of names) {
|
||||
const members = groups[name] || [];
|
||||
|
||||
const groupDiv = document.createElement("div");
|
||||
groupDiv.className = "wfm-batch-group-item open";
|
||||
|
||||
const headerDiv = document.createElement("div");
|
||||
headerDiv.className = "wfm-batch-group-header";
|
||||
|
||||
const cb = document.createElement("input");
|
||||
cb.type = "checkbox";
|
||||
const selCount = _getGroupSelCount(name);
|
||||
cb.checked = members.length > 0 && selCount === members.length;
|
||||
cb.indeterminate = selCount > 0 && selCount < members.length;
|
||||
|
||||
const toggle = document.createElement("span");
|
||||
toggle.className = "wfm-ckpt-folder-toggle";
|
||||
toggle.textContent = "▶";
|
||||
|
||||
const nameSpan = document.createElement("span");
|
||||
nameSpan.className = "wfm-batch-group-name";
|
||||
nameSpan.textContent = name;
|
||||
|
||||
const countSpan = document.createElement("span");
|
||||
countSpan.className = "wfm-batch-group-count";
|
||||
countSpan.textContent = `${selCount}/${members.length}`;
|
||||
|
||||
const memberDiv = document.createElement("div");
|
||||
memberDiv.className = "wfm-batch-group-members";
|
||||
|
||||
for (const m of members) {
|
||||
const label = document.createElement("label");
|
||||
label.className = "wfm-ckpt-item wfm-ckpt-item--indented";
|
||||
|
||||
const fileCb = document.createElement("input");
|
||||
fileCb.type = "checkbox";
|
||||
fileCb.value = m;
|
||||
// 選択状態: グループ全体選択 or 部分選択に含まれる
|
||||
fileCb.checked = _batchGroupState.selectedGroups.has(name)
|
||||
|| !!(_batchGroupState.partialSelections[name]?.has(m));
|
||||
|
||||
const fileName = m.replace(/\\/g, "/").split("/").pop();
|
||||
const fileSpan = document.createElement("span");
|
||||
fileSpan.className = "wfm-ckpt-item-label";
|
||||
fileSpan.textContent = fileName;
|
||||
fileSpan.title = m;
|
||||
|
||||
fileCb.addEventListener("change", () => {
|
||||
if (_batchGroupState.selectedGroups.has(name)) {
|
||||
// グループ全体選択中に1つ外す → 部分選択に移行
|
||||
_batchGroupState.selectedGroups.delete(name);
|
||||
const partial = new Set(members);
|
||||
partial.delete(m);
|
||||
if (partial.size > 0) _batchGroupState.partialSelections[name] = partial;
|
||||
} else {
|
||||
if (!_batchGroupState.partialSelections[name]) {
|
||||
_batchGroupState.partialSelections[name] = new Set();
|
||||
}
|
||||
if (fileCb.checked) _batchGroupState.partialSelections[name].add(m);
|
||||
else _batchGroupState.partialSelections[name].delete(m);
|
||||
// 全員選択 → selectedGroups に昇格
|
||||
if (members.every((x) => _batchGroupState.partialSelections[name].has(x))) {
|
||||
_batchGroupState.selectedGroups.add(name);
|
||||
delete _batchGroupState.partialSelections[name];
|
||||
}
|
||||
// 空になった → partial削除
|
||||
if (_batchGroupState.partialSelections[name]?.size === 0) {
|
||||
delete _batchGroupState.partialSelections[name];
|
||||
}
|
||||
}
|
||||
const sc = _getGroupSelCount(name);
|
||||
cb.checked = sc === members.length && members.length > 0;
|
||||
cb.indeterminate = sc > 0 && sc < members.length;
|
||||
countSpan.textContent = `${sc}/${members.length}`;
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
label.appendChild(fileCb);
|
||||
label.appendChild(fileSpan);
|
||||
memberDiv.appendChild(label);
|
||||
}
|
||||
|
||||
cb.addEventListener("change", () => {
|
||||
if (cb.checked) {
|
||||
_batchGroupState.selectedGroups.add(name);
|
||||
delete _batchGroupState.partialSelections[name];
|
||||
} else {
|
||||
_batchGroupState.selectedGroups.delete(name);
|
||||
delete _batchGroupState.partialSelections[name];
|
||||
}
|
||||
memberDiv.querySelectorAll("input[type=checkbox]").forEach((c) => { c.checked = cb.checked; });
|
||||
countSpan.textContent = `${cb.checked ? members.length : 0}/${members.length}`;
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
[toggle, nameSpan].forEach((el) => {
|
||||
el.addEventListener("click", () => groupDiv.classList.toggle("open"));
|
||||
});
|
||||
|
||||
headerDiv.appendChild(cb);
|
||||
headerDiv.appendChild(toggle);
|
||||
headerDiv.appendChild(nameSpan);
|
||||
headerDiv.appendChild(countSpan);
|
||||
groupDiv.appendChild(headerDiv);
|
||||
groupDiv.appendChild(memberDiv);
|
||||
el.appendChild(groupDiv);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 汎用グループリストレンダリング
|
||||
// displayFn: (memberValue) => 表示文字列
|
||||
// ============================================
|
||||
function _renderAnyGroupList(listEl, groupsData, selectedGroups, partialSelections, displayFn, onPreviewChange) {
|
||||
if (!listEl) return;
|
||||
const names = Object.keys(groupsData).sort();
|
||||
if (names.length === 0) {
|
||||
listEl.innerHTML = `<p class="wfm-placeholder" style="font-size:12px;padding:16px;">No groups defined.</p>`;
|
||||
return;
|
||||
}
|
||||
listEl.innerHTML = "";
|
||||
for (const name of names) {
|
||||
const members = groupsData[name] || [];
|
||||
const groupDiv = document.createElement("div");
|
||||
groupDiv.className = "wfm-batch-group-item open";
|
||||
|
||||
const headerDiv = document.createElement("div");
|
||||
headerDiv.className = "wfm-batch-group-header";
|
||||
|
||||
const cb = document.createElement("input");
|
||||
cb.type = "checkbox";
|
||||
const getSelCount = () => _getGroupSelCountFrom(name, groupsData, selectedGroups, partialSelections);
|
||||
let selCount = getSelCount();
|
||||
cb.checked = members.length > 0 && selCount === members.length;
|
||||
cb.indeterminate = selCount > 0 && selCount < members.length;
|
||||
|
||||
const toggle = document.createElement("span");
|
||||
toggle.className = "wfm-ckpt-folder-toggle";
|
||||
toggle.textContent = "▶";
|
||||
|
||||
const nameSpan = document.createElement("span");
|
||||
nameSpan.className = "wfm-batch-group-name";
|
||||
nameSpan.textContent = name;
|
||||
|
||||
const countSpan = document.createElement("span");
|
||||
countSpan.className = "wfm-batch-group-count";
|
||||
countSpan.textContent = `${selCount}/${members.length}`;
|
||||
|
||||
const memberDiv = document.createElement("div");
|
||||
memberDiv.className = "wfm-batch-group-members";
|
||||
|
||||
for (const m of members) {
|
||||
const label = document.createElement("label");
|
||||
label.className = "wfm-ckpt-item wfm-ckpt-item--indented";
|
||||
|
||||
const fileCb = document.createElement("input");
|
||||
fileCb.type = "checkbox";
|
||||
fileCb.value = m;
|
||||
fileCb.checked = selectedGroups.has(name) || !!(partialSelections[name]?.has(m));
|
||||
|
||||
const fileSpan = document.createElement("span");
|
||||
fileSpan.className = "wfm-ckpt-item-label";
|
||||
fileSpan.textContent = displayFn(m);
|
||||
fileSpan.title = m;
|
||||
|
||||
fileCb.addEventListener("change", () => {
|
||||
if (selectedGroups.has(name)) {
|
||||
selectedGroups.delete(name);
|
||||
const partial = new Set(members);
|
||||
partial.delete(m);
|
||||
if (partial.size > 0) partialSelections[name] = partial;
|
||||
} else {
|
||||
if (!partialSelections[name]) partialSelections[name] = new Set();
|
||||
if (fileCb.checked) partialSelections[name].add(m);
|
||||
else partialSelections[name].delete(m);
|
||||
if (members.every((x) => partialSelections[name].has(x))) {
|
||||
selectedGroups.add(name);
|
||||
delete partialSelections[name];
|
||||
}
|
||||
if (partialSelections[name]?.size === 0) delete partialSelections[name];
|
||||
}
|
||||
const sc = getSelCount();
|
||||
cb.checked = sc === members.length && members.length > 0;
|
||||
cb.indeterminate = sc > 0 && sc < members.length;
|
||||
countSpan.textContent = `${sc}/${members.length}`;
|
||||
onPreviewChange();
|
||||
});
|
||||
|
||||
label.appendChild(fileCb);
|
||||
label.appendChild(fileSpan);
|
||||
memberDiv.appendChild(label);
|
||||
}
|
||||
|
||||
cb.addEventListener("change", () => {
|
||||
if (cb.checked) {
|
||||
selectedGroups.add(name);
|
||||
delete partialSelections[name];
|
||||
} else {
|
||||
selectedGroups.delete(name);
|
||||
delete partialSelections[name];
|
||||
}
|
||||
memberDiv.querySelectorAll("input[type=checkbox]").forEach((c) => { c.checked = cb.checked; });
|
||||
countSpan.textContent = `${cb.checked ? members.length : 0}/${members.length}`;
|
||||
onPreviewChange();
|
||||
});
|
||||
|
||||
[toggle, nameSpan].forEach((el) => {
|
||||
el.addEventListener("click", () => groupDiv.classList.toggle("open"));
|
||||
});
|
||||
|
||||
headerDiv.appendChild(cb);
|
||||
headerDiv.appendChild(toggle);
|
||||
headerDiv.appendChild(nameSpan);
|
||||
headerDiv.appendChild(countSpan);
|
||||
groupDiv.appendChild(headerDiv);
|
||||
groupDiv.appendChild(memberDiv);
|
||||
listEl.appendChild(groupDiv);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Lora グループ
|
||||
// ============================================
|
||||
async function _loadBatchLoraGroups() {
|
||||
try {
|
||||
const res = await fetch("/api/wfm/models/groups?type=lora");
|
||||
if (res.ok) _batchGroupState.loraGroups = await res.json();
|
||||
else _batchGroupState.loraGroups = {};
|
||||
} catch { _batchGroupState.loraGroups = {}; }
|
||||
|
||||
const currentNames = new Set(Object.keys(_batchGroupState.loraGroups));
|
||||
for (const name of _batchGroupState.loraSelectedGroups) {
|
||||
if (!currentNames.has(name)) _batchGroupState.loraSelectedGroups.delete(name);
|
||||
}
|
||||
for (const name of Object.keys(_batchGroupState.loraPartialSelections)) {
|
||||
if (!currentNames.has(name)) delete _batchGroupState.loraPartialSelections[name];
|
||||
}
|
||||
|
||||
_renderBatchLoraGroupList();
|
||||
_renderBatchPreview();
|
||||
}
|
||||
|
||||
function _renderBatchLoraGroupList() {
|
||||
const el = document.getElementById("wfm-batch-lora-group-list");
|
||||
_renderAnyGroupList(
|
||||
el,
|
||||
_batchGroupState.loraGroups,
|
||||
_batchGroupState.loraSelectedGroups,
|
||||
_batchGroupState.loraPartialSelections,
|
||||
(m) => m.replace(/\\/g, "/").split("/").pop(),
|
||||
_renderBatchPreview
|
||||
);
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Prompt グループ
|
||||
// ============================================
|
||||
async function _loadPromptGroupsForBatch() {
|
||||
try {
|
||||
const res = await fetch("/api/wfm/prompts");
|
||||
_batchGroupState.promptPresets = res.ok ? await res.json() : [];
|
||||
} catch { _batchGroupState.promptPresets = []; }
|
||||
try {
|
||||
_batchGroupState.promptGroups = JSON.parse(localStorage.getItem("wfm_prompt_preset_groups") || "{}");
|
||||
} catch { _batchGroupState.promptGroups = {}; }
|
||||
|
||||
const validIds = new Set(_batchGroupState.promptPresets.map((p) => p.id));
|
||||
for (const g of Object.keys(_batchGroupState.promptGroups)) {
|
||||
_batchGroupState.promptGroups[g] = (_batchGroupState.promptGroups[g] || []).filter((id) => validIds.has(id));
|
||||
}
|
||||
|
||||
const currentNames = new Set(Object.keys(_batchGroupState.promptGroups));
|
||||
for (const name of _batchGroupState.promptSelectedGroups) {
|
||||
if (!currentNames.has(name)) _batchGroupState.promptSelectedGroups.delete(name);
|
||||
}
|
||||
for (const name of Object.keys(_batchGroupState.promptPartialSelections)) {
|
||||
if (!currentNames.has(name)) delete _batchGroupState.promptPartialSelections[name];
|
||||
}
|
||||
|
||||
_renderBatchPromptGroupList();
|
||||
_renderBatchPreview();
|
||||
}
|
||||
|
||||
function _renderBatchPromptGroupList() {
|
||||
const el = document.getElementById("wfm-batch-prompt-group-list");
|
||||
const presetsMap = new Map(_batchGroupState.promptPresets.map((p) => [p.id, p]));
|
||||
_renderAnyGroupList(
|
||||
el,
|
||||
_batchGroupState.promptGroups,
|
||||
_batchGroupState.promptSelectedGroups,
|
||||
_batchGroupState.promptPartialSelections,
|
||||
(id) => presetsMap.get(id)?.name || id,
|
||||
_renderBatchPreview
|
||||
);
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Workflow グループ
|
||||
// ============================================
|
||||
function _loadWorkflowGroupsForBatch() {
|
||||
try {
|
||||
_batchGroupState.wfGroups = JSON.parse(localStorage.getItem("wfm_groups") || "{}");
|
||||
} catch { _batchGroupState.wfGroups = {}; }
|
||||
|
||||
const currentNames = new Set(Object.keys(_batchGroupState.wfGroups));
|
||||
for (const name of _batchGroupState.wfSelectedGroups) {
|
||||
if (!currentNames.has(name)) _batchGroupState.wfSelectedGroups.delete(name);
|
||||
}
|
||||
for (const name of Object.keys(_batchGroupState.wfPartialSelections)) {
|
||||
if (!currentNames.has(name)) delete _batchGroupState.wfPartialSelections[name];
|
||||
}
|
||||
|
||||
_renderBatchWfGroupList();
|
||||
_renderBatchPreview();
|
||||
}
|
||||
|
||||
function _renderBatchWfGroupList() {
|
||||
const el = document.getElementById("wfm-batch-wf-group-list");
|
||||
_renderAnyGroupList(
|
||||
el,
|
||||
_batchGroupState.wfGroups,
|
||||
_batchGroupState.wfSelectedGroups,
|
||||
_batchGroupState.wfPartialSelections,
|
||||
(f) => f.replace(/\.json$/i, "").replace(/\\/g, "/").split("/").pop(),
|
||||
_renderBatchPreview
|
||||
);
|
||||
}
|
||||
|
||||
function initBatchTab() {
|
||||
// 内部タブ切り替え(タブ表示時に対応するグループを読み込む)
|
||||
document.querySelectorAll(".wfm-batch-inner-tab").forEach((btn) => {
|
||||
btn.addEventListener("click", () => {
|
||||
document.querySelectorAll(".wfm-batch-inner-tab").forEach((b) => b.classList.remove("active"));
|
||||
btn.classList.add("active");
|
||||
const tabId = btn.dataset.batchInner;
|
||||
document.querySelectorAll(".wfm-batch-inner-content").forEach((c) => c.classList.remove("active"));
|
||||
document.getElementById(`wfm-batch-inner-${tabId}`)?.classList.add("active");
|
||||
if (tabId === "checkpoint") _loadBatchCheckpointGroups();
|
||||
else if (tabId === "lora") _loadBatchLoraGroups();
|
||||
else if (tabId === "prompt") _loadPromptGroupsForBatch();
|
||||
else if (tabId === "workflow") _loadWorkflowGroupsForBatch();
|
||||
});
|
||||
});
|
||||
|
||||
// ドロップダウン開閉
|
||||
btn?.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
const isOpen = panel.style.display !== "none";
|
||||
if (isOpen) {
|
||||
panel.style.display = "none";
|
||||
wrap.classList.remove("open");
|
||||
} else {
|
||||
_rebuildCkptList();
|
||||
panel.style.display = "block";
|
||||
wrap.classList.add("open");
|
||||
document.getElementById("wfm-ckpt-search")?.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// 外側クリックで閉じる
|
||||
document.addEventListener("click", (e) => {
|
||||
if (panel && panel.style.display !== "none" && !wrap?.contains(e.target)) {
|
||||
panel.style.display = "none";
|
||||
wrap?.classList.remove("open");
|
||||
}
|
||||
});
|
||||
|
||||
// 検索フィルター
|
||||
// 検索フィルター(左ペイン)
|
||||
document.getElementById("wfm-ckpt-search")?.addEventListener("input", _rebuildCkptList);
|
||||
|
||||
// 全選択
|
||||
// 全選択 / 全解除(左ペイン)
|
||||
document.getElementById("wfm-ckpt-select-all")?.addEventListener("click", () => {
|
||||
_ckptState.mode = "all";
|
||||
_ckptState.selected.clear();
|
||||
_rebuildCkptList();
|
||||
_updateDropdownLabel();
|
||||
_updateBatchInfo();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// 全解除
|
||||
document.getElementById("wfm-ckpt-deselect-all")?.addEventListener("click", () => {
|
||||
_ckptState.mode = "none";
|
||||
_ckptState.selected.clear();
|
||||
_rebuildCkptList();
|
||||
_updateDropdownLabel();
|
||||
_updateBatchInfo();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// Batch タブが表示されたときに全グループを読み込む
|
||||
document.querySelector('[data-subtab="batch"]')?.addEventListener("click", () => {
|
||||
_rebuildCkptList();
|
||||
_loadBatchCheckpointGroups();
|
||||
_loadBatchLoraGroups();
|
||||
_loadPromptGroupsForBatch();
|
||||
_loadWorkflowGroupsForBatch();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
}
|
||||
|
||||
function initCheckpointBatch() {
|
||||
// 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
|
||||
@@ -516,39 +1007,26 @@ async function _coreGenerate(silent = false) {
|
||||
// Batch generation loop
|
||||
// ============================================
|
||||
|
||||
async function _runBatchGenerate() {
|
||||
const ckptNodes = comfyUI.currentAnalysis?.checkpoint_nodes || [];
|
||||
if (ckptNodes.length === 0) {
|
||||
showToast("No checkpoint node found in workflow", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
const list = _getSelectedCheckpoints();
|
||||
|
||||
if (list.length === 0) {
|
||||
showToast("No checkpoints selected", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
const batchProgress = document.getElementById("wfm-ckpt-batch-progress");
|
||||
// 汎用バッチループ: items を順に applyFn(item) → _coreGenerate() で処理する
|
||||
async function _runBatchLoop(items, applyFn, labelFn = (x) => String(x)) {
|
||||
const batchProgress = document.getElementById("wfm-ckpt-batch-progress");
|
||||
const batchCurrentName = document.getElementById("wfm-ckpt-batch-current-name");
|
||||
const batchCount = document.getElementById("wfm-ckpt-batch-count");
|
||||
const batchBar = document.getElementById("wfm-ckpt-batch-bar");
|
||||
const progressText = document.getElementById("wfm-gen-progress-text");
|
||||
const batchCount = document.getElementById("wfm-ckpt-batch-count");
|
||||
const batchBar = document.getElementById("wfm-ckpt-batch-bar");
|
||||
const progressText = document.getElementById("wfm-gen-progress-text");
|
||||
const pauseBtn = document.getElementById("wfm-ckpt-batch-pause-btn");
|
||||
|
||||
if (batchProgress) batchProgress.style.display = "block";
|
||||
const pauseBtn = document.getElementById("wfm-ckpt-batch-pause-btn");
|
||||
if (pauseBtn) { pauseBtn.style.display = "block"; pauseBtn.disabled = false; }
|
||||
_setPauseBtnState(false);
|
||||
_updateBatchTypeLabel(true);
|
||||
|
||||
let completed = 0;
|
||||
let failed = 0;
|
||||
let completed = 0, failed = 0;
|
||||
|
||||
try {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if (_ckptBatch.aborted) break;
|
||||
|
||||
// 一時停止中は次のモデルへ進む前に待機
|
||||
if (_ckptBatch.paused) {
|
||||
if (batchCurrentName) batchCurrentName.textContent = "Paused...";
|
||||
if (progressText) progressText.textContent = "Paused";
|
||||
@@ -556,25 +1034,21 @@ async function _runBatchGenerate() {
|
||||
await _waitIfPaused();
|
||||
if (_ckptBatch.aborted) break;
|
||||
|
||||
const model = list[i];
|
||||
if (batchCurrentName) batchCurrentName.textContent = model;
|
||||
if (batchCount) batchCount.textContent = `${i + 1} / ${list.length}`;
|
||||
if (batchBar) batchBar.style.width = `${((i / list.length) * 100).toFixed(1)}%`;
|
||||
if (progressText) progressText.textContent = `[${i + 1}/${list.length}] Loading...`;
|
||||
|
||||
for (const node of ckptNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id]) {
|
||||
comfyUI.currentWorkflow[node.id].inputs.ckpt_name = model;
|
||||
}
|
||||
}
|
||||
const item = items[i];
|
||||
const label = labelFn(item);
|
||||
if (batchCurrentName) batchCurrentName.textContent = label;
|
||||
if (batchCount) batchCount.textContent = `${i + 1} / ${items.length}`;
|
||||
if (batchBar) batchBar.style.width = `${((i / items.length) * 100).toFixed(1)}%`;
|
||||
if (progressText) progressText.textContent = `[${i + 1}/${items.length}] Loading...`;
|
||||
|
||||
try {
|
||||
await applyFn(item);
|
||||
await _coreGenerate(true);
|
||||
completed++;
|
||||
} catch (err) {
|
||||
if (_ckptBatch.aborted) break;
|
||||
failed++;
|
||||
showToast(`[${i + 1}/${list.length}] Failed: ${err.message}`, "error");
|
||||
showToast(`[${i + 1}/${items.length}] Failed: ${err.message}`, "error");
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
@@ -585,6 +1059,7 @@ async function _runBatchGenerate() {
|
||||
_ckptBatch._resumeResolve = null;
|
||||
}
|
||||
_setPauseBtnState(false);
|
||||
_updateBatchTypeLabel(false);
|
||||
}
|
||||
|
||||
if (batchBar) batchBar.style.width = "100%";
|
||||
@@ -594,12 +1069,84 @@ async function _runBatchGenerate() {
|
||||
showToast(`Batch stopped — ${completed} completed, ${failed} failed`, "info");
|
||||
} else {
|
||||
showToast(
|
||||
`Batch complete: ${completed}/${list.length}${failed > 0 ? ` (${failed} failed)` : ""}`,
|
||||
`Batch complete: ${completed}/${items.length}${failed > 0 ? ` (${failed} failed)` : ""}`,
|
||||
failed > 0 ? "error" : "success"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// アクティブなバッチタイプに応じてバッチを実行するディスパッチャ
|
||||
async function _runBatchGenerate() {
|
||||
switch (_activeBatchType) {
|
||||
case "checkpoint": {
|
||||
const ckptNodes = comfyUI.currentAnalysis?.checkpoint_nodes || [];
|
||||
if (ckptNodes.length === 0) { showToast("No checkpoint node found in workflow", "error"); return; }
|
||||
const list = _getSelectedCheckpoints();
|
||||
if (list.length === 0) { showToast("No checkpoints selected", "error"); return; }
|
||||
await _runBatchLoop(list, (model) => {
|
||||
for (const node of ckptNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
comfyUI.currentWorkflow[node.id].inputs.ckpt_name = model;
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
case "lora": {
|
||||
const loraNodes = comfyUI.currentAnalysis?.lora_nodes || [];
|
||||
if (loraNodes.length === 0) { showToast("No LoRA node found in workflow", "error"); return; }
|
||||
const list = [..._getSelectedLoraGroupItems()];
|
||||
if (list.length === 0) { showToast("No LoRAs selected", "error"); return; }
|
||||
await _runBatchLoop(list, (loraName) => {
|
||||
for (const node of loraNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
comfyUI.currentWorkflow[node.id].inputs.lora_name = loraName;
|
||||
}
|
||||
}, (name) => name.replace(/\.[^.]+$/, ""));
|
||||
break;
|
||||
}
|
||||
case "prompt": {
|
||||
const positiveNodes = (comfyUI.currentAnalysis?.prompt_nodes || []).filter((n) => n.role === "positive");
|
||||
const negativeNodes = (comfyUI.currentAnalysis?.prompt_nodes || []).filter((n) => n.role === "negative");
|
||||
if (positiveNodes.length === 0 && negativeNodes.length === 0) {
|
||||
showToast("No prompt node found in workflow", "error"); return;
|
||||
}
|
||||
// _getSelectedPromptGroupItems() はすでにプリセットオブジェクトの配列を返す
|
||||
const list = _getSelectedPromptGroupItems();
|
||||
if (list.length === 0) { showToast("No prompts selected", "error"); return; }
|
||||
await _runBatchLoop(list, (preset) => {
|
||||
for (const node of positiveNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
comfyUI.currentWorkflow[node.id].inputs[node.textKey || "text"] = preset.text || "";
|
||||
}
|
||||
for (const node of negativeNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
comfyUI.currentWorkflow[node.id].inputs[node.textKey || "text"] = preset.negText || "";
|
||||
}
|
||||
}, (preset) => preset.name || preset.id);
|
||||
break;
|
||||
}
|
||||
case "workflow": {
|
||||
const list = [..._getSelectedWfGroupItems()];
|
||||
if (list.length === 0) { showToast("No workflows selected", "error"); return; }
|
||||
const savedWorkflow = comfyUI.currentWorkflow ? JSON.stringify(comfyUI.currentWorkflow) : null;
|
||||
const savedFilename = document.getElementById("wfm-gen-workflow-name")?.textContent || "";
|
||||
try {
|
||||
await _runBatchLoop(list, async (filename) => {
|
||||
const resp = await fetch(`/api/wfm/workflows/${encodeURIComponent(filename)}`);
|
||||
if (!resp.ok) throw new Error(`Failed to load: ${filename}`);
|
||||
const data = await resp.json();
|
||||
await loadWorkflowIntoEditor(data, filename);
|
||||
}, (filename) => filename.replace(/\.json$/, ""));
|
||||
} finally {
|
||||
if (savedWorkflow) {
|
||||
try { await loadWorkflowIntoEditor(JSON.parse(savedWorkflow), savedFilename); } catch {}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Generate entry point
|
||||
// ============================================
|
||||
@@ -622,7 +1169,7 @@ async function handleGenerate() {
|
||||
_ckptBatch.paused = false;
|
||||
_ckptBatch._resumeResolve = null;
|
||||
|
||||
const batchEnabled = document.getElementById("wfm-ckpt-batch-enabled")?.checked;
|
||||
const batchEnabled = _activeBatchType !== null;
|
||||
|
||||
try {
|
||||
if (batchEnabled) {
|
||||
@@ -669,8 +1216,7 @@ export async function initGenerateTab() {
|
||||
comfyEditor.renderAll(comfyUI.currentAnalysis, comfyUI.currentWorkflow);
|
||||
}
|
||||
showToast("Model lists refreshed", "success");
|
||||
_updateDropdownLabel();
|
||||
_updateBatchInfo();
|
||||
_renderBatchPreview();
|
||||
});
|
||||
|
||||
// Generate button
|
||||
@@ -693,7 +1239,7 @@ export async function initGenerateTab() {
|
||||
function moveRawJsonToTab(tabKey) {
|
||||
const widget = document.getElementById("wfm-gen-rawjson-widget");
|
||||
if (!widget) return;
|
||||
if (tabKey === "feeder") {
|
||||
if (tabKey === "feeder" || tabKey === "batch") {
|
||||
widget.style.display = "none";
|
||||
return;
|
||||
}
|
||||
@@ -865,6 +1411,9 @@ export async function initGenerateTab() {
|
||||
// Checkpoint batch UI
|
||||
initCheckpointBatch();
|
||||
|
||||
// Batch tab
|
||||
initBatchTab();
|
||||
|
||||
// Feeder tab
|
||||
await initFeederTab();
|
||||
|
||||
@@ -873,8 +1422,7 @@ export async function initGenerateTab() {
|
||||
updateStatus(connected);
|
||||
if (connected) {
|
||||
await comfyEditor.loadModelLists();
|
||||
_updateDropdownLabel();
|
||||
_updateBatchInfo();
|
||||
_renderBatchPreview();
|
||||
}
|
||||
|
||||
// Auto-load default workflow (doesn't require ComfyUI connection)
|
||||
|
||||
@@ -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",
|
||||
@@ -295,12 +300,30 @@ const LANGUAGES = {
|
||||
modelBulkDeleteConfirm: "Permanently delete {count} model file(s) and their preview images? This cannot be undone.",
|
||||
modelBulkDeleteDone: "model file(s) deleted",
|
||||
modelBulkDeleteError: "Failed to delete some models",
|
||||
modelBulkDeselectAll: "Deselect All",
|
||||
modelBulkFavAdd: "★ Favorite",
|
||||
modelBulkFavRemove: "☆ Unfavorite",
|
||||
modelBulkFavDone: "models favorited",
|
||||
modelBulkUnfavDone: "models unfavorited",
|
||||
modelBulkBadgeApply: "+Badge",
|
||||
modelBulkBadgeRemove: "−Badge",
|
||||
modelBulkBadgeApplyDone: "badge applied to models",
|
||||
modelBulkBadgeRemoveDone: "badge removed from models",
|
||||
modelBulkNoBadge: "Select badge...",
|
||||
civitaiFetchDesc: "Fetch model information from CivitAI using SHA256 hash.",
|
||||
civitaiFetch: "Fetch from CivitAI",
|
||||
civitaiHashing: "Calculating hash... (may take a while for large files)",
|
||||
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",
|
||||
@@ -309,6 +332,19 @@ const LANGUAGES = {
|
||||
civitaiHashing2: "Hashing...",
|
||||
civitaiFetching: "Fetching...",
|
||||
civitaiBatchDone: (found, notFound) => `CivitAI: ${found} found, ${notFound} not found`,
|
||||
civitaiApiKeySetting: "CivitAI API Key",
|
||||
civitaiApiKeyHint: "Optional. Enables authenticated access. Obtain at civitai.com → Account Settings → API Keys.",
|
||||
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",
|
||||
@@ -324,6 +360,52 @@ const LANGUAGES = {
|
||||
galleryOutputDirLabel: "Output Folder Path",
|
||||
galleryOutputDirHint: "Set the ComfyUI output folder to browse in the Gallery tab. Leave blank to use ComfyUI's default output directory.",
|
||||
|
||||
tabAi: "AI TOOL",
|
||||
|
||||
// -- AI Tab --
|
||||
aiSubTabTranslate: "Translate",
|
||||
aiSubTabVlm: "VLM",
|
||||
aiSubTabSettings: "Settings",
|
||||
aiLangJa: "Japanese", aiLangEn: "English", aiLangZh: "Chinese", aiLangFree: "Free",
|
||||
aiTransInputPlaceholder: "Enter text to translate...",
|
||||
aiTransOutputPlaceholder: "Translation result will appear here...",
|
||||
aiTranslateBtn: "Translate",
|
||||
aiCopyBtn: "Copy",
|
||||
aiVlmDropLabel: "Drop PNG / JPG / WebP here or click",
|
||||
aiVlmDescribe: "Describe Image",
|
||||
aiVlmPromptCreate: "Create Prompt",
|
||||
aiVlmRunBtn: "Run",
|
||||
aiVlmResultPlaceholder: "Result will appear here...",
|
||||
aiSettingsBackend: "Backend",
|
||||
aiSettingsConnection: "Connection",
|
||||
aiSettingsTestBtn: "Test Connection",
|
||||
aiSettingsModelSection: "Model",
|
||||
aiSettingsRefreshBtn: "Refresh",
|
||||
aiSettingsModelPlaceholder: "-- Select Model --",
|
||||
aiSettingsFreeLang: "Free Language",
|
||||
aiSettingsInputLang: "Input",
|
||||
aiSettingsOutputLang: "Output",
|
||||
aiSettingsSaveBtn: "Save Settings",
|
||||
aiToastNoText: "Please enter text",
|
||||
aiToastNoModel: "Please select a model in the Settings tab",
|
||||
aiToastInvalidUrl: "URL must start with http:// or https://",
|
||||
aiToastInvalidUrlInput: "Please enter a URL starting with http:// or https://",
|
||||
aiStatusTranslating: "Translating...",
|
||||
aiStatusRunning: "Running...",
|
||||
aiStatusDone: "Done",
|
||||
aiStatusConnecting: "Connecting...",
|
||||
aiStatusConnectOk: "Connected",
|
||||
aiStatusConnectFail: "Connection failed: ",
|
||||
aiToastTransFailed: "Translation failed: ",
|
||||
aiToastNoCopyText: "No text to copy",
|
||||
aiToastCopied: "Copied",
|
||||
aiToastNoModels: "No models found",
|
||||
aiToastModelsFailed: "Failed to fetch models: ",
|
||||
aiToastSettingsSaved: "Settings saved",
|
||||
aiToastNoImage: "Please drop an image",
|
||||
aiToastVlmFailed: "VLM failed: ",
|
||||
aiModels: "models",
|
||||
|
||||
// -- Help & Support --
|
||||
tabHelp: "Help",
|
||||
helpManualTitle: "Features",
|
||||
@@ -331,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",
|
||||
@@ -340,7 +422,7 @@ const LANGUAGES = {
|
||||
helpWf7: "Badge management: add, rename, delete badges with custom colors shared with the Models tab (⚙ Badge button)",
|
||||
helpGen1: "Connect/disconnect ComfyUI and check connection status",
|
||||
helpGen2: "Load workflows from Workflow tab (App format .app.json not supported)",
|
||||
helpGen3: "4-tab layout — Input (Prompt + Image), Model, Settings, Feeder — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing",
|
||||
helpGen3: "5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing",
|
||||
helpGen4: "Input tab: Prompt (top) and Image drag-and-drop (bottom) in the left column",
|
||||
helpGen5: "Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter",
|
||||
helpGen6: "Settings tab: KSampler and Latent Image side by side, each at 50% width",
|
||||
@@ -348,7 +430,10 @@ const LANGUAGES = {
|
||||
helpGen8: "Seed control: random, fixed, increment, decrement",
|
||||
helpGen9: "Generate, progress display, stop, and view results",
|
||||
helpGen10: "Eagle integration: auto-save generated images to Eagle",
|
||||
helpGen11: "Checkpoint Batch: select checkpoints by folder from the dropdown — check a folder to select all its files, or expand with ▶ to check individual files; use Filter to search; Pause/Resume suspends and continues between models; Stop aborts after the current generation",
|
||||
helpGen11: "Batch type selector: check one of the column header checkboxes in the Batch Queue pane (Checkpoint / Lora / Prompt / Workflow) to activate that batch type — only one type can be active at a time; the Batch panel below Generate shows the active type, progress, and Pause/Resume/Stop controls",
|
||||
helpGen12: "Batch tab — 3-pane layout: Left pane (file tree) selects checkpoints by folder; use Filter to narrow the list, All/None buttons to select or clear all; initial state is all unchecked",
|
||||
helpGen13: "Batch tab — Center pane: group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint/Lora groups come from the Models tab, Prompt groups from the Prompt tab, Workflow groups from the Workflow tab — check a group header to select all its members, or expand ▶ to select individually",
|
||||
helpGen14: "Batch tab — Right pane (Batch Queue): shows items queued for each batch type; column headers (Checkpoint / Lora / Prompt / Workflow) each have a checkbox — check one to activate that batch type (radio behavior: only one at a time); count shown at top",
|
||||
helpFeederTitle: "GenerateUI Tab — Feeder subtab",
|
||||
helpFeederDesc: "Requires the comfyui-image-feeder custom node. Controls ImageFeeder nodes and runs continuous generation loops over an image library stored in user/default/image-loop-data/.",
|
||||
helpFeeder1: "Left pane — Node settings: select the target ImageFeeder node from the dropdown; edit all node parameters (Directory, Sort Mode, Index, Start/End Index, Batch Size, Seed, Use Selection); click Apply to write changes to the loaded workflow",
|
||||
@@ -379,6 +464,9 @@ const LANGUAGES = {
|
||||
helpSettings8: "Data Management: export all plugin data (settings, metadata, prompts, etc.) to a JSON file, or import to restore. After importing, restart ComfyUI.",
|
||||
helpSettings9: "All sections are collapsible accordion panels",
|
||||
helpSettings10: "Wildcard Integration: link WFS wildcard dir to ComfyUI-Impact-Pack wildcards (directory junction on Windows / symlink on other OS); existing files migrated automatically",
|
||||
helpSettings11: "Text Size: one slider (10–28 px) adjusts font size for all prompt and chat textareas at once — Generate UI positive/negative prompts, AI Assistant chat input, Preset positive/negative, Wildcard prompt and file editor, and Metadata prompt full preview; takes effect immediately and saved with Save Settings",
|
||||
helpSettings12: "RAW JSON Colors: customize the 6 syntax highlight colors for the Raw JSON editor in Generate UI — Default Text, Name/Scheduler, Title, Width/Height, Prompt/Text, Image/File; changes apply immediately on color pick; Reset Defaults restores the original color scheme",
|
||||
helpSettings13: "CivitAI Host: choose between civitai.com (SFW only) and civitai.red (unrestricted) — determines which site opens when clicking a model link in the Models tab CivitAI panel",
|
||||
helpNodes1: "Node Browser: search by name/description/alias/tag, filter by category, package, tag, group, favorites",
|
||||
helpNodes2: "Card and Table view modes with pagination",
|
||||
helpNodes3: "Favorite nodes and add custom tags for organization",
|
||||
@@ -386,10 +474,10 @@ 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",
|
||||
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",
|
||||
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)",
|
||||
@@ -424,6 +512,14 @@ const LANGUAGES = {
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
helpAi2: "Language selectors for source and destination with ⇄ swap button; text content is also swapped; selections are saved automatically",
|
||||
helpAi3: "TOOLS pane: drop an image into the drop zone and select a task — Describe Image, Create Prompt, or Create Tags — then click Run to analyze with a vision model",
|
||||
helpAi4: "VLM result is displayed in the output area with a Copy button",
|
||||
helpAi5: "Settings sub-tab: choose backend (Ollama / LM Studio), set the API URL, test connection, select model, and configure Free language names for translation",
|
||||
helpAi6: "Settings are saved to localStorage and shared with the Library panel's A tab",
|
||||
helpShortcutsTitle: "Keyboard Shortcuts",
|
||||
helpShortcuts1: "Escape: Close modal/panel",
|
||||
helpShortcuts2: "Enter: Confirm rename, send chat",
|
||||
@@ -459,7 +555,7 @@ const LANGUAGES = {
|
||||
comfyuiUrlHint: "When running as ComfyUI plugin, leave empty to use same origin. Only set if ComfyUI is on a different server.",
|
||||
connectedCheck: "Connected \u2713",
|
||||
failedConnect: "Failed to connect \u2717",
|
||||
ollamaSettings: "Ollama Settings",
|
||||
ollamaSettings: "Ollama Settings (Prompt Tab)",
|
||||
ollamaUrl: "Ollama API URL",
|
||||
ollamaDefaultModel: "Default Model",
|
||||
selectModel: "Select model...",
|
||||
@@ -813,6 +909,10 @@ const LANGUAGES = {
|
||||
modelsBadges: "バッジ",
|
||||
modelsInfo: "情報",
|
||||
modelsFavorite: "お気に入り",
|
||||
modelsBatch: "バッチ",
|
||||
modelsBatchClear: "バッチ一括解除",
|
||||
promptBatchClear: "バッチプリセットを一括解除しました",
|
||||
wfBatchClear: "バッチワークフローを一括解除しました",
|
||||
modelsMemo: "メモ",
|
||||
modelsMemoPlaceholder: "このモデルについてのメモ...",
|
||||
modelsSave: "保存",
|
||||
@@ -846,6 +946,7 @@ const LANGUAGES = {
|
||||
modelsGroupExists: "同名のグループが既に存在します",
|
||||
modelsRenamePrompt: "新しいグループ名を入力:",
|
||||
modelsDeleteGroupConfirm: "グループ「{name}」を削除しますか?",
|
||||
modelsGroupReserved: "このグループは予約済みのため削除・名前変更できません。",
|
||||
modelEnable: "有効化",
|
||||
modelDisable: "無効化",
|
||||
modelDisabled: "無効",
|
||||
@@ -868,12 +969,30 @@ const LANGUAGES = {
|
||||
modelBulkDeleteConfirm: "{count}件のモデルファイルとプレビュー画像を完全に削除しますか?この操作は取り消せません。",
|
||||
modelBulkDeleteDone: "件のモデルファイルを削除しました",
|
||||
modelBulkDeleteError: "一部のモデルの削除に失敗しました",
|
||||
modelBulkDeselectAll: "選択解除",
|
||||
modelBulkFavAdd: "★ お気に入り追加",
|
||||
modelBulkFavRemove: "☆ お気に入り解除",
|
||||
modelBulkFavDone: "件をお気に入りに追加しました",
|
||||
modelBulkUnfavDone: "件のお気に入りを解除しました",
|
||||
modelBulkBadgeApply: "+バッジ",
|
||||
modelBulkBadgeRemove: "−バッジ",
|
||||
modelBulkBadgeApplyDone: "件のモデルにバッジを適用しました",
|
||||
modelBulkBadgeRemoveDone: "件のモデルからバッジを削除しました",
|
||||
modelBulkNoBadge: "バッジを選択...",
|
||||
civitaiFetchDesc: "SHA256ハッシュを使用してCivitAIからモデル情報を取得します。",
|
||||
civitaiFetch: "CivitAIから取得",
|
||||
civitaiHashing: "ハッシュ計算中...(大きいファイルは時間がかかります)",
|
||||
civitaiFound: "CivitAI情報を取得しました",
|
||||
civitaiNotFound: "CivitAIにモデルが見つかりません",
|
||||
civitaiNotFoundDesc: "確認済みですが、このモデルはCivitAIに見つかりませんでした。",
|
||||
civitaiRefetchBtn: "再確認する",
|
||||
civitaiError: "CivitAIからの取得エラー",
|
||||
civitaiType: "タイプ",
|
||||
civitaiBaseModel: "ベースモデル",
|
||||
civitaiHashLabel: "ハッシュ",
|
||||
civitaiCopyHash: "クリックでハッシュをコピー",
|
||||
civitaiHashCopied: "ハッシュをコピーしました",
|
||||
civitaiOpenImage: "画像を別タブで開く",
|
||||
civitaiTriggerWords: "トリガーワード",
|
||||
civitaiCopyWord: "クリックでコピー",
|
||||
civitaiWordCopied: "トリガーワードをコピーしました",
|
||||
@@ -882,6 +1001,19 @@ const LANGUAGES = {
|
||||
civitaiHashing2: "ハッシュ計算中...",
|
||||
civitaiFetching: "取得中...",
|
||||
civitaiBatchDone: (found, notFound) => `CivitAI: ${found}件取得, ${notFound}件未登録`,
|
||||
civitaiApiKeySetting: "CivitAI APIキー",
|
||||
civitaiApiKeyHint: "省略可。認証済みアクセスが有効になります。civitai.com → アカウント設定 → API Keys で取得。",
|
||||
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",
|
||||
@@ -897,6 +1029,52 @@ const LANGUAGES = {
|
||||
galleryOutputDirLabel: "Outputフォルダのパス",
|
||||
galleryOutputDirHint: "ギャラリータブで参照するComfyUIのoutputフォルダを設定します。空欄の場合はComfyUIのデフォルトoutputディレクトリを使用します。",
|
||||
|
||||
tabAi: "AI TOOL",
|
||||
|
||||
// -- AI Tab --
|
||||
aiSubTabTranslate: "翻訳",
|
||||
aiSubTabVlm: "VLM",
|
||||
aiSubTabSettings: "設定",
|
||||
aiLangJa: "日本語", aiLangEn: "英語", aiLangZh: "中国語", aiLangFree: "Free",
|
||||
aiTransInputPlaceholder: "翻訳するテキストを入力...",
|
||||
aiTransOutputPlaceholder: "翻訳結果がここに表示されます...",
|
||||
aiTranslateBtn: "翻訳",
|
||||
aiCopyBtn: "コピー",
|
||||
aiVlmDropLabel: "PNG / JPG / WebP をドロップまたはクリック",
|
||||
aiVlmDescribe: "画像の解説",
|
||||
aiVlmPromptCreate: "プロンプト作成",
|
||||
aiVlmRunBtn: "実行",
|
||||
aiVlmResultPlaceholder: "実行結果がここに表示されます...",
|
||||
aiSettingsBackend: "バックエンド",
|
||||
aiSettingsConnection: "接続設定",
|
||||
aiSettingsTestBtn: "接続テスト",
|
||||
aiSettingsModelSection: "モデル選択",
|
||||
aiSettingsRefreshBtn: "更新",
|
||||
aiSettingsModelPlaceholder: "-- モデルを選択 --",
|
||||
aiSettingsFreeLang: "Free 言語設定",
|
||||
aiSettingsInputLang: "入力言語",
|
||||
aiSettingsOutputLang: "翻訳言語",
|
||||
aiSettingsSaveBtn: "設定を保存",
|
||||
aiToastNoText: "テキストを入力してください",
|
||||
aiToastNoModel: "設定タブでモデルを選択してください",
|
||||
aiToastInvalidUrl: "URLは http:// または https:// で始まる必要があります",
|
||||
aiToastInvalidUrlInput: "http:// または https:// で始まるURLを入力してください",
|
||||
aiStatusTranslating: "翻訳中...",
|
||||
aiStatusRunning: "実行中...",
|
||||
aiStatusDone: "完了",
|
||||
aiStatusConnecting: "接続中...",
|
||||
aiStatusConnectOk: "接続成功",
|
||||
aiStatusConnectFail: "接続失敗: ",
|
||||
aiToastTransFailed: "翻訳に失敗しました: ",
|
||||
aiToastNoCopyText: "コピーするテキストがありません",
|
||||
aiToastCopied: "コピーしました",
|
||||
aiToastNoModels: "モデルが見つかりません",
|
||||
aiToastModelsFailed: "モデル取得失敗: ",
|
||||
aiToastSettingsSaved: "設定を保存しました",
|
||||
aiToastNoImage: "画像をドロップしてください",
|
||||
aiToastVlmFailed: "VLM実行失敗: ",
|
||||
aiModels: "モデル",
|
||||
|
||||
// -- Help & Support --
|
||||
tabHelp: "ヘルプ",
|
||||
helpManualTitle: "機能一覧",
|
||||
@@ -904,7 +1082,7 @@ const LANGUAGES = {
|
||||
helpAboutDesc: "ComfyUIのワークフローJSONファイルの管理、API接続による画像生成、プロンプト作成支援、ノードの閲覧・整理を行う集中コントロールUIです。",
|
||||
helpAbout1: "ComfyUIマネージャーからインストール、またはcustom_nodesフォルダへgit clone",
|
||||
helpAbout2: "ComfyUIツールバーのWorkflow Studioボタンから起動、またはhttp://127.0.0.1:8188/wfmを開く",
|
||||
helpWf1: "サムネイル / カード / テーブルの表示モード切り替え",
|
||||
helpWf1: "サムネイル / テーブルの表示モード切り替え",
|
||||
helpWf2: "テキスト検索、カテゴリフィルタ、お気に入りフィルタ、グループフィルタ",
|
||||
helpWf3: "グループの作成・名前変更・削除、ワークフローの割り当て・解除",
|
||||
helpWf4: "JSON/PNGファイルのインポート(ボタンまたはドラッグ&ドロップ)",
|
||||
@@ -913,7 +1091,7 @@ const LANGUAGES = {
|
||||
helpWf7: "バッジ管理:バッジの追加・名前変更・削除、カスタム色設定(Modelsタブと共有)— ⚙ Badgeボタン",
|
||||
helpGen1: "ComfyUIの接続・切断、接続状態の確認",
|
||||
helpGen2: "Workflowタブからワークフローを読み込み(App形式 .app.json は非対応)",
|
||||
helpGen3: "4タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder — Input/Model/SettingsタブにはRaw JSON列を常時表示",
|
||||
helpGen3: "5タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder、Batch — Input/Model/SettingsタブにはRaw JSON列を常時表示",
|
||||
helpGen4: "Inputタブ:左列にPrompt(上段)+ Image ドラッグ&ドロップ(下段)",
|
||||
helpGen5: "Modelタブ:Checkpoint/VAE/LoRA/ControlNet/UNET/TextEncoderのセレクタ(フィルタ検索付き)",
|
||||
helpGen6: "Settingsタブ:KSamplerとLatent Imageを横並び(各50%幅)",
|
||||
@@ -921,7 +1099,10 @@ const LANGUAGES = {
|
||||
helpGen8: "シード管理:ランダム / 固定 / 増加 / 減少",
|
||||
helpGen9: "画像生成、進捗表示、生成停止、結果表示",
|
||||
helpGen10: "Eagle連携:生成画像をEagleへ自動保存",
|
||||
helpGen11: "Checkpoint Batch:ドロップダウンのフォルダツリーからチェックポイントを選択 — フォルダにチェックでそのフォルダ内を一括選択、▶で展開して個別選択も可能;Filterで絞り込み;Pause/Resumeでモデル間の処理を一時停止・再開;Stopで現在の生成完了後に中断",
|
||||
helpGen11: "バッチタイプ選択:Batchキュー右ペインのカラムヘッダーチェックボックス(Checkpoint / Lora / Prompt / Workflow)で実行タイプを選択 — 同時に1種類のみ有効;Generateボタン下のBatchパネルで有効タイプ・進捗・一時停止/再開・停止を操作可能",
|
||||
helpGen12: "Batchタブ — 3ペインレイアウト:左ペイン(ファイルツリー)でフォルダ単位にチェックポイントを選択;フィルタで絞り込み、All/Noneボタンで一括選択・解除;初期状態は全てチェックなし",
|
||||
helpGen13: "Batchタブ — 中央ペイン:グループ選択(Checkpoint | Lora | Prompt | Workflowの内部タブ);Checkpoint/LoraグループはModelsタブ、PromptグループはPromptタブ、WorkflowグループはWorkflowタブの定義を反映 — グループヘッダーにチェックで全メンバーを選択、▶で展開して個別選択も可能",
|
||||
helpGen14: "Batchタブ — 右ペイン(バッチキュー):各バッチタイプのキュー項目を表示;カラムヘッダー(Checkpoint / Lora / Prompt / Workflow)のチェックボックスで実行タイプを選択(ラジオ動作:1種類のみ);上部に件数を表示",
|
||||
helpFeederTitle: "GenerateUI Tab — Feeder サブタブ",
|
||||
helpFeederDesc: "comfyui-image-feeder カスタムノードが必要です。ImageFeeder ノードを操作し、user/default/image-loop-data/ に保存された画像ライブラリを使って連続生成ループを実行します。",
|
||||
helpFeeder1: "左ペイン — ノード設定:ドロップダウンで対象 ImageFeeder ノードを選択;Directory・Sort Mode・Index・Start/End Index・Batch Size・Seed・Use Selection の各パラメータを編集;Apply で読み込み済みワークフローに反映",
|
||||
@@ -952,6 +1133,9 @@ const LANGUAGES = {
|
||||
helpSettings8: "データ管理:設定・メタデータ・プロンプトなど全データをJSONにエクスポート、またはインポートして復元。インポート後はComfyUIを再起動してください。",
|
||||
helpSettings9: "各セクションはアコーディオン式で折りたたみ可能",
|
||||
helpSettings10: "Wildcard Integration:WFSのワイルドカードディレクトリをComfyUI-Impact-Packのwildcardsディレクトリへリンク(Windowsはジャンクション、他OSはシンボリックリンク)。既存ファイルは自動で移行されます",
|
||||
helpSettings11: "テキストサイズ:スライダー1本(10〜28px)でプロンプト・チャット全テキストエリアのフォントサイズを一括調整 — GenerateUI ポジティブ/ネガティブプロンプト、AIアシスタントチャット入力、プリセット ポジティブ/ネガティブ、ワイルドカードプロンプト・ファイルエディタ、メタデータプロンプト全文プレビュー;即時反映・保存で確定",
|
||||
helpSettings12: "RAW JSON カラー:GenerateUI の Raw JSON エディタの構文ハイライト色(6色)をカスタマイズ — デフォルトテキスト・名前/スケジューラー・タイトル・幅/高さ・プロンプト/テキスト・画像/ファイル;カラーピッカーで即時反映;「デフォルトにリセット」で元の配色に戻す",
|
||||
helpSettings13: "CivitAI ホスト:civitai.com(SFWのみ)と civitai.red(制限なし)を切り替え — ModelsタブのCivitAIパネルでモデルリンクをクリックしたときに開くサイトを指定",
|
||||
helpNodes1: "ノードブラウザ:名前/説明/エイリアス/タグで検索、カテゴリ・パッケージ・タグ・グループ・お気に入りフィルタ",
|
||||
helpNodes2: "カード / テーブル表示モード切り替え(ページネーション付き)",
|
||||
helpNodes3: "ノードのお気に入り登録、カスタムタグの追加で整理",
|
||||
@@ -959,10 +1143,10 @@ const LANGUAGES = {
|
||||
helpNodes5: "サイドパネル:詳細(クラス名、パッケージ、カテゴリ、説明、フラグ)、I/O仕様(入出力の型・デフォルト値)、グループ管理",
|
||||
helpNodes6: "ノードセット:再利用可能なノードコレクションの作成(説明、タグ、ノード間リンク定義付き)",
|
||||
helpModels1: "インストール済みモデルの閲覧:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embeddingをサブタブで切り替え",
|
||||
helpModels2: "サムネイル / カード / テーブル表示モード切り替え(ページネーション付き)",
|
||||
helpModels2: "サムネイル / テーブル表示モード切り替え(ページネーション付き)",
|
||||
helpModels3: "検索、タグフィルタ、グループフィルタ、お気に入りフィルタ、ステータスフィルタ(すべて / 有効のみ / 無効のみ)",
|
||||
helpModels4: "サイドパネル:基本情報(ファイルパス、タグ、メモ)、グループ管理、CivitAI連携",
|
||||
helpModels5: "CivitAI連携:SHA256ハッシュでモデル情報取得、モデルタイプごとの一括取得",
|
||||
helpModels5: "CivitAI連携:SHA256ハッシュでモデル情報取得、モデルタイプごとの一括取得;プレビュー画像がない場合は自動でダウンロード・保存",
|
||||
helpModels6: "詳細モーダル:プレビュー画像、CivitAI情報(ベースモデル、トリガーワード、タグ)、サムネイル変更",
|
||||
helpModels7: "グループ管理:グループの作成・名前変更・削除、モデルの割り当て・解除",
|
||||
helpModels8: "GenUI Modelボタン:選択モデルをGenerateUIの現在のワークフローの該当ノードに直接適用(Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
@@ -997,6 +1181,14 @@ const LANGUAGES = {
|
||||
helpSidepanel13: "I タブ(Information):ComfyUI の PNG / WebP / JSON をドロップするとサイドパネル内でモデル・LoRA・プロンプトのメタデータを確認可能 — サブタブ: model / lora / Prompts;UnetLoaderGGUF・QuadrupleCLIPLoader ノードタイプに対応",
|
||||
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 ノードを配置;クリックで全文表示・コピー可能",
|
||||
helpSidepanel16: "A タブ(AI ツール):翻訳・VLM サブタブ;設定(バックエンド・URL・モデル)は SPA の AI タブと localStorage で共有される",
|
||||
helpAiTitle: "AI タブ(A)",
|
||||
helpAi1: "翻訳サブタブ:Ollama または LM Studio を使って日本語・英語・中国語・カスタム言語(Free)間でテキストを翻訳",
|
||||
helpAi2: "入力言語・出力言語セレクターと ⇄ 入替ボタン付き;テキスト内容も同時に入替;選択は自動保存",
|
||||
helpAi3: "TOOLS ペイン:画像をドロップゾーンにドロップしてタスクを選択(画像の解説 / プロンプト作成 / タグ作成)し、実行ボタンでビジョンモデルに解析させる",
|
||||
helpAi4: "VLM の結果は出力エリアに表示され、コピーボタンでクリップボードに取得可能",
|
||||
helpAi5: "設定サブタブ:バックエンド(Ollama / LM Studio)・API URL・接続テスト・モデル選択・翻訳の Free 言語名を設定",
|
||||
helpAi6: "設定は localStorage に保存され、Library パネルの A タブと共有される",
|
||||
helpShortcutsTitle: "キーボード操作",
|
||||
helpShortcuts1: "Escape:モーダル・パネルを閉じる",
|
||||
helpShortcuts2: "Enter:名前変更の確定、チャット送信",
|
||||
@@ -1032,7 +1224,7 @@ const LANGUAGES = {
|
||||
comfyuiUrlHint: "ComfyUIプラグインとして動作する場合は空欄(同一オリジン推奨)。別サーバーの場合のみ設定してください。",
|
||||
connectedCheck: "接続成功 \u2713",
|
||||
failedConnect: "接続失敗 \u2717",
|
||||
ollamaSettings: "Ollama 設定",
|
||||
ollamaSettings: "Ollama 設定(プロンプトタブ)",
|
||||
ollamaUrl: "Ollama API URL",
|
||||
ollamaDefaultModel: "デフォルトモデル",
|
||||
selectModel: "モデルを選択...",
|
||||
@@ -1382,6 +1574,10 @@ const LANGUAGES = {
|
||||
modelsBadges: "标签",
|
||||
modelsInfo: "信息",
|
||||
modelsFavorite: "收藏",
|
||||
modelsBatch: "批次",
|
||||
modelsBatchClear: "清空批次",
|
||||
promptBatchClear: "已清空批次预设",
|
||||
wfBatchClear: "已清空批次工作流",
|
||||
modelsMemo: "备注",
|
||||
modelsMemoPlaceholder: "关于此模型的备注...",
|
||||
modelsSave: "保存",
|
||||
@@ -1415,6 +1611,7 @@ const LANGUAGES = {
|
||||
modelsGroupExists: "同名分组已存在",
|
||||
modelsRenamePrompt: "输入新分组名称:",
|
||||
modelsDeleteGroupConfirm: "删除分组「{name}」?",
|
||||
modelsGroupReserved: "此分组为系统保留分组,无法删除或重命名。",
|
||||
modelEnable: "启用",
|
||||
modelDisable: "禁用",
|
||||
modelDisabled: "已禁用",
|
||||
@@ -1437,12 +1634,30 @@ const LANGUAGES = {
|
||||
modelBulkDeleteConfirm: "永久删除 {count} 个模型文件及其预览图?此操作无法撤销。",
|
||||
modelBulkDeleteDone: "个模型文件已删除",
|
||||
modelBulkDeleteError: "部分模型删除失败",
|
||||
modelBulkDeselectAll: "取消全选",
|
||||
modelBulkFavAdd: "★ 收藏",
|
||||
modelBulkFavRemove: "☆ 取消收藏",
|
||||
modelBulkFavDone: "个模型已收藏",
|
||||
modelBulkUnfavDone: "个模型已取消收藏",
|
||||
modelBulkBadgeApply: "+徽章",
|
||||
modelBulkBadgeRemove: "−徽章",
|
||||
modelBulkBadgeApplyDone: "个模型已应用徽章",
|
||||
modelBulkBadgeRemoveDone: "个模型已移除徽章",
|
||||
modelBulkNoBadge: "选择徽章...",
|
||||
civitaiFetchDesc: "使用SHA256哈希从CivitAI获取模型信息。",
|
||||
civitaiFetch: "从CivitAI获取",
|
||||
civitaiHashing: "计算哈希中...(大文件可能需要较长时间)",
|
||||
civitaiFound: "已加载CivitAI信息",
|
||||
civitaiNotFound: "在CivitAI上未找到该模型",
|
||||
civitaiNotFoundDesc: "已检查,但在CivitAI上未找到此模型。",
|
||||
civitaiRefetchBtn: "重新检查",
|
||||
civitaiError: "从CivitAI获取时出错",
|
||||
civitaiType: "类型",
|
||||
civitaiBaseModel: "基础模型",
|
||||
civitaiHashLabel: "哈希",
|
||||
civitaiCopyHash: "点击复制哈希",
|
||||
civitaiHashCopied: "哈希已复制",
|
||||
civitaiOpenImage: "在新标签页中打开图片",
|
||||
civitaiTriggerWords: "触发词",
|
||||
civitaiCopyWord: "点击复制",
|
||||
civitaiWordCopied: "触发词已复制",
|
||||
@@ -1451,6 +1666,19 @@ const LANGUAGES = {
|
||||
civitaiHashing2: "计算哈希中...",
|
||||
civitaiFetching: "获取中...",
|
||||
civitaiBatchDone: (found, notFound) => `CivitAI: ${found}个已找到, ${notFound}个未找到`,
|
||||
civitaiApiKeySetting: "CivitAI API密钥",
|
||||
civitaiApiKeyHint: "可选。启用认证访问。在 civitai.com → 账户设置 → API Keys 获取。",
|
||||
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",
|
||||
@@ -1466,6 +1694,52 @@ const LANGUAGES = {
|
||||
galleryOutputDirLabel: "输出文件夹路径",
|
||||
galleryOutputDirHint: "设置图库标签页浏览的ComfyUI输出文件夹。留空则使用ComfyUI默认输出目录。",
|
||||
|
||||
tabAi: "AI TOOL",
|
||||
|
||||
// -- AI Tab --
|
||||
aiSubTabTranslate: "翻译",
|
||||
aiSubTabVlm: "VLM",
|
||||
aiSubTabSettings: "设置",
|
||||
aiLangJa: "日语", aiLangEn: "英语", aiLangZh: "中文", aiLangFree: "Free",
|
||||
aiTransInputPlaceholder: "输入要翻译的文字...",
|
||||
aiTransOutputPlaceholder: "翻译结果将显示在这里...",
|
||||
aiTranslateBtn: "翻译",
|
||||
aiCopyBtn: "复制",
|
||||
aiVlmDropLabel: "拖放 PNG / JPG / WebP 或点击",
|
||||
aiVlmDescribe: "图像说明",
|
||||
aiVlmPromptCreate: "生成提示词",
|
||||
aiVlmRunBtn: "执行",
|
||||
aiVlmResultPlaceholder: "执行结果将显示在这里...",
|
||||
aiSettingsBackend: "后端",
|
||||
aiSettingsConnection: "连接设置",
|
||||
aiSettingsTestBtn: "连接测试",
|
||||
aiSettingsModelSection: "选择模型",
|
||||
aiSettingsRefreshBtn: "刷新",
|
||||
aiSettingsModelPlaceholder: "-- 请选择模型 --",
|
||||
aiSettingsFreeLang: "Free 语言设置",
|
||||
aiSettingsInputLang: "输入语言",
|
||||
aiSettingsOutputLang: "翻译语言",
|
||||
aiSettingsSaveBtn: "保存设置",
|
||||
aiToastNoText: "请输入文字",
|
||||
aiToastNoModel: "请在设置标签中选择模型",
|
||||
aiToastInvalidUrl: "URL必须以 http:// 或 https:// 开头",
|
||||
aiToastInvalidUrlInput: "请输入以 http:// 或 https:// 开头的URL",
|
||||
aiStatusTranslating: "翻译中...",
|
||||
aiStatusRunning: "执行中...",
|
||||
aiStatusDone: "完成",
|
||||
aiStatusConnecting: "连接中...",
|
||||
aiStatusConnectOk: "连接成功",
|
||||
aiStatusConnectFail: "连接失败:",
|
||||
aiToastTransFailed: "翻译失败:",
|
||||
aiToastNoCopyText: "没有可复制的文字",
|
||||
aiToastCopied: "已复制",
|
||||
aiToastNoModels: "未找到模型",
|
||||
aiToastModelsFailed: "获取模型失败:",
|
||||
aiToastSettingsSaved: "设置已保存",
|
||||
aiToastNoImage: "请拖放图像",
|
||||
aiToastVlmFailed: "VLM执行失败:",
|
||||
aiModels: "个模型",
|
||||
|
||||
// -- Help & Support --
|
||||
tabHelp: "帮助",
|
||||
helpManualTitle: "功能列表",
|
||||
@@ -1473,7 +1747,7 @@ const LANGUAGES = {
|
||||
helpAboutDesc: "用于管理ComfyUI工作流JSON文件、通过API生成图片、辅助提示词创作、浏览和整理节点的集中控制UI。",
|
||||
helpAbout1: "通过ComfyUI Manager安装,或git clone到custom_nodes文件夹",
|
||||
helpAbout2: "从ComfyUI工具栏的Workflow Studio按钮启动,或打开http://127.0.0.1:8188/wfm",
|
||||
helpWf1: "切换缩略图/卡片/表格视图模式",
|
||||
helpWf1: "切换缩略图/表格视图模式",
|
||||
helpWf2: "文本搜索、分类筛选、收藏筛选、分组筛选",
|
||||
helpWf3: "创建、重命名、删除分组,分配/移除工作流",
|
||||
helpWf4: "通过按钮或拖放导入JSON/PNG文件",
|
||||
@@ -1482,7 +1756,7 @@ const LANGUAGES = {
|
||||
helpWf7: "徽章管理:添加、重命名、删除徽章并自定义颜色(与Models标签共享)— ⚙ Badge按钮",
|
||||
helpGen1: "连接/断开ComfyUI,检查连接状态",
|
||||
helpGen2: "从工作流标签页加载工作流(不支持App格式.app.json)",
|
||||
helpGen3: "4标签布局 — Input(提示词+图片)、Model、Settings、Feeder — Input/Model/Settings标签各含Raw JSON列实时预览",
|
||||
helpGen3: "5标签布局 — Input(提示词+图像)、Model、Settings、Feeder、Batch — Input/Model/Settings各含实时预览和直接编辑的Raw JSON列",
|
||||
helpGen4: "Input标签:左列为Prompt(上)+ Image拖放(下)",
|
||||
helpGen5: "Model标签:Checkpoint/VAE/LoRA/ControlNet/UNET/TextEncoder选择器(含筛选)",
|
||||
helpGen6: "Settings标签:KSampler与Latent Image并排显示(各占50%宽度)",
|
||||
@@ -1490,7 +1764,10 @@ const LANGUAGES = {
|
||||
helpGen8: "种子管理:随机/固定/递增/递减",
|
||||
helpGen9: "生成图片、进度显示、停止生成、查看结果",
|
||||
helpGen10: "Eagle集成:自动保存生成图片到Eagle",
|
||||
helpGen11: "Checkpoint Batch:从下拉框文件夹树中选择检查点 — 勾选文件夹可一键选中该文件夹内的所有文件,▶展开后也可单独选择;使用Filter筛选;Pause/Resume可在模型之间暂停和继续;Stop在当前生成完成后中止",
|
||||
helpGen11: "批次类型选择:勾选批次队列右窗格列标题复选框(Checkpoint / Lora / Prompt / Workflow)激活对应批次类型 — 每次只能激活一种;Generate按钮下方的Batch面板显示当前类型、进度及暂停/继续/停止控制",
|
||||
helpGen12: "Batch标签 — 3窗格布局:左窗格(文件树)按文件夹选择检查点;使用筛选器缩小列表,All/None按钮全选或清除;初始状态全部未勾选",
|
||||
helpGen13: "Batch标签 — 中央窗格:基于组的选择(含Checkpoint | Lora | Prompt | Workflow内部标签);Checkpoint/Lora组来自Models标签,Prompt组来自Prompt标签,Workflow组来自Workflow标签 — 勾选组标题选中所有成员,▶展开后也可单独选择",
|
||||
helpGen14: "Batch标签 — 右窗格(批量队列):显示各批次类型的队列项目;列标题(Checkpoint / Lora / Prompt / Workflow)各有复选框 — 勾选一个激活该类型(单选行为);顶部显示数量",
|
||||
helpFeederTitle: "GenerateUI Tab — Feeder 子标签",
|
||||
helpFeederDesc: "需要 comfyui-image-feeder 自定义节点。用于操控 ImageFeeder 节点,并对存储在 user/default/image-loop-data/ 中的图片库执行连续生成循环。",
|
||||
helpFeeder1: "左侧面板 — 节点设置:从下拉框选择目标 ImageFeeder 节点;编辑所有节点参数(Directory、Sort Mode、Index、Start/End Index、Batch Size、Seed、Use Selection);点击 Apply 将更改写入当前工作流",
|
||||
@@ -1521,6 +1798,9 @@ const LANGUAGES = {
|
||||
helpSettings8: "数据管理:将所有插件数据(设置、元数据、提示词等)导出为JSON文件,或导入以恢复。导入后请重启ComfyUI。",
|
||||
helpSettings9: "各部分可折叠展开",
|
||||
helpSettings10: "Wildcard Integration:将WFS通配符目录链接到ComfyUI-Impact-Pack的wildcards目录(Windows为目录联结,其他OS为符号链接);现有文件自动迁移",
|
||||
helpSettings11: "文字大小:单个滑块(10–28 px)可一次性调整所有提示词和聊天文本框的字体大小 — GenerateUI正/负向提示词、AI助手聊天输入、预设正/负向提示、通配符提示和文件编辑器、元数据提示词全文预览;即时生效并通过「保存设置」保存",
|
||||
helpSettings12: "RAW JSON 配色:自定义GenerateUI中Raw JSON编辑器的6种语法高亮颜色 — 默认文本、名称/调度器、标题、宽度/高度、提示词/文本、图像/文件;颜色选择即时生效;「重置默认」恢复原始配色",
|
||||
helpSettings13: "CivitAI 站点:在 civitai.com(仅SFW)和 civitai.red(无限制)之间切换 — 决定在Models标签CivitAI面板中点击模型链接时打开的站点",
|
||||
helpNodes1: "节点浏览器:按名称/描述/别名/标签搜索,按分类、包、标签、组、收藏筛选",
|
||||
helpNodes2: "卡片和表格视图模式切换(带分页)",
|
||||
helpNodes3: "收藏节点,添加自定义标签进行整理",
|
||||
@@ -1528,10 +1808,10 @@ const LANGUAGES = {
|
||||
helpNodes5: "侧面板:详情(类名、包、分类、描述、标志)、I/O规格(输入输出类型和默认值)、组管理",
|
||||
helpNodes6: "节点集:创建可复用的节点集合(含描述、标签、节点间链接定义)",
|
||||
helpModels1: "浏览已安装模型:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embedding,通过子标签切换",
|
||||
helpModels2: "缩略图、卡片和表格视图模式切换(带分页)",
|
||||
helpModels2: "缩略图和表格视图模式切换(带分页)",
|
||||
helpModels3: "搜索、标签筛选、分组筛选、收藏筛选、状态筛选(全部 / 仅启用 / 仅禁用)",
|
||||
helpModels4: "侧面板:基本信息(文件路径、标签、备注)、分组管理、CivitAI集成",
|
||||
helpModels5: "CivitAI集成:通过SHA256哈希获取模型信息,按模型类型批量获取",
|
||||
helpModels5: "CivitAI集成:通过SHA256哈希获取模型信息,按模型类型批量获取;无预览图时自动下载并保存",
|
||||
helpModels6: "详情弹窗:预览图片、CivitAI信息(基础模型、触发词、标签)、缩略图更改",
|
||||
helpModels7: "分组管理:创建、重命名、删除分组,分配/移除模型",
|
||||
helpModels8: "GenUI Model按钮:将选中模型直接应用到GenerateUI当前工作流的对应节点(Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)",
|
||||
@@ -1566,6 +1846,14 @@ const LANGUAGES = {
|
||||
helpSidepanel13: "I 标签(Information):拖放 ComfyUI PNG/WebP/JSON 即可在侧面板内查看模型、LoRA 和提示词元数据 — 子标签:model / lora / Prompts;支持 UnetLoaderGGUF 和 QuadrupleCLIPLoader 节点类型",
|
||||
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 节点;点击可查看全文并复制",
|
||||
helpSidepanel16: "A 标签(AI 工具):翻译子标签和 VLM 子标签;设置(后端、URL、模型)通过 localStorage 与 SPA 的 AI 标签共享",
|
||||
helpAiTitle: "AI 标签页(A)",
|
||||
helpAi1: "翻译子标签:使用 Ollama 或 LM Studio 在日语、英语、中文或自定义语言(Free)之间翻译文本",
|
||||
helpAi2: "源语言和目标语言选择器,带 ⇄ 互换按钮;文本内容也同时互换;选择自动保存",
|
||||
helpAi3: "TOOLS 面板:将图像拖放到投放区域,选择任务(图像描述 / 提示词生成 / 标签生成),点击执行按钮用视觉模型进行分析",
|
||||
helpAi4: "VLM 结果显示在输出区域,可通过复制按钮复制到剪贴板",
|
||||
helpAi5: "设置子标签:选择后端(Ollama / LM Studio)、设置 API URL、测试连接、选择模型、配置翻译的 Free 语言名称",
|
||||
helpAi6: "设置保存至 localStorage,并与 Library 面板的 A 标签共享",
|
||||
helpShortcutsTitle: "键盘操作",
|
||||
helpShortcuts1: "Escape:关闭弹窗/面板",
|
||||
helpShortcuts2: "Enter:确认重命名、发送聊天",
|
||||
@@ -1601,7 +1889,7 @@ const LANGUAGES = {
|
||||
comfyuiUrlHint: "作为ComfyUI插件运行时留空(推荐同源)。仅在不同服务器时设置。",
|
||||
connectedCheck: "已连接 \u2713",
|
||||
failedConnect: "连接失败 \u2717",
|
||||
ollamaSettings: "Ollama 设置",
|
||||
ollamaSettings: "Ollama 设置(提示词标签页)",
|
||||
ollamaUrl: "Ollama API URL",
|
||||
ollamaDefaultModel: "默认模型",
|
||||
selectModel: "选择模型...",
|
||||
|
||||
@@ -8,6 +8,10 @@ import { t } from "./i18n.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { comfyEditor } from "./comfyui-editor.js";
|
||||
|
||||
// ── Constants ─────────────────────────────────────────────
|
||||
const RESERVED_GROUPS = ["Batch"];
|
||||
const BATCH_MODEL_TYPES = ["checkpoint", "lora"];
|
||||
|
||||
// ── State ─────────────────────────────────────────────────
|
||||
|
||||
const state = {
|
||||
@@ -35,7 +39,8 @@ const state = {
|
||||
groupFilter: "",
|
||||
statusFilter: "all", // "all" | "enabled" | "disabled"
|
||||
showFavoritesOnly: false,
|
||||
viewMode: localStorage.getItem("wfm_models_view") || "thumb",
|
||||
showBatchOnly: false,
|
||||
viewMode: localStorage.getItem("wfm_models_view") === "table" ? "table" : "thumb",
|
||||
activeModelType: "checkpoint",
|
||||
selectedModel: null,
|
||||
loaded: {},
|
||||
@@ -169,6 +174,7 @@ function previewUrl(modelName, modelType) {
|
||||
/**
|
||||
* Load preview image. Uses img onload/onerror instead of HEAD request
|
||||
* (aiohttp add_get does not auto-handle HEAD method).
|
||||
* Falls back to CivitAI cached image if no local preview exists.
|
||||
*/
|
||||
function loadPreviewImage(imgEl, placeholderEl, modelName, modelType) {
|
||||
const url = previewUrl(modelName, modelType);
|
||||
@@ -177,8 +183,23 @@ function loadPreviewImage(imgEl, placeholderEl, modelName, modelType) {
|
||||
if (placeholderEl) placeholderEl.style.display = "none";
|
||||
};
|
||||
imgEl.onerror = () => {
|
||||
imgEl.style.display = "none";
|
||||
if (placeholderEl) placeholderEl.style.display = "";
|
||||
// Fallback: use CivitAI cached image if available
|
||||
const meta = state.modelMetadata[modelName] || {};
|
||||
const sha256 = meta.sha256;
|
||||
const civitai = sha256 && state.civitaiCache[sha256];
|
||||
const civitaiImg = civitai && civitai.images && civitai.images[0];
|
||||
if (civitaiImg) {
|
||||
imgEl.onerror = () => {
|
||||
imgEl.style.display = "none";
|
||||
if (placeholderEl) placeholderEl.style.display = "";
|
||||
};
|
||||
imgEl.src = civitaiImg;
|
||||
imgEl.style.display = "";
|
||||
if (placeholderEl) placeholderEl.style.display = "none";
|
||||
} else {
|
||||
imgEl.style.display = "none";
|
||||
if (placeholderEl) placeholderEl.style.display = "";
|
||||
}
|
||||
};
|
||||
imgEl.src = url;
|
||||
}
|
||||
@@ -256,20 +277,39 @@ function renderBulkActionBar() {
|
||||
? `<option value="">${t("modelsNoGroupAvailable")}</option>`
|
||||
: groupNames.map((g) => `<option value="${escapeHtml(g)}">${escapeHtml(g)}</option>`).join("");
|
||||
|
||||
const palette = getBadgePalette();
|
||||
const badgeLabels = Object.keys(palette).sort();
|
||||
const noBadges = badgeLabels.length === 0;
|
||||
const badgeOptions = noBadges
|
||||
? `<option value="">${t("modelBulkNoBadge")}</option>`
|
||||
: badgeLabels.map((b) => `<option value="${escapeHtml(b)}">${escapeHtml(b)}</option>`).join("");
|
||||
|
||||
bar.style.display = "flex";
|
||||
bar.innerHTML = `
|
||||
<span class="wfm-bulk-count">${count} ${t("modelSelected")}</span>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-deselect-all-btn">${t("modelBulkDeselectAll")}</button>
|
||||
<span class="wfm-bulk-sep">|</span>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-fav-add-btn" title="${t("modelBulkFavAdd")}">${t("modelBulkFavAdd")}</button>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-fav-remove-btn" title="${t("modelBulkFavRemove")}">${t("modelBulkFavRemove")}</button>
|
||||
<span class="wfm-bulk-sep">|</span>
|
||||
<select id="wfm-bulk-group-select" class="wfm-select" style="font-size:12px;">${groupOptions}</select>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="wfm-bulk-add-btn"${noGroups ? " disabled" : ""}>${t("modelBulkAddGroup")}</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-remove-btn"${noGroups ? " disabled" : ""}>${t("modelBulkRemoveGroup")}</button>
|
||||
<span class="wfm-bulk-sep">|</span>
|
||||
<input type="text" id="wfm-bulk-new-group-input" class="wfm-search-input" style="width:120px;font-size:12px;" placeholder="${t("modelsGroupName")}">
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-create-add-btn">${t("modelBulkCreateAdd")}</button>
|
||||
<span class="wfm-bulk-sep">|</span>
|
||||
<select id="wfm-bulk-badge-select" class="wfm-select" style="font-size:12px;">${badgeOptions}</select>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="wfm-bulk-badge-apply-btn"${noBadges ? " disabled" : ""}>${t("modelBulkBadgeApply")}</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-badge-remove-btn"${noBadges ? " disabled" : ""}>${t("modelBulkBadgeRemove")}</button>
|
||||
<span class="wfm-bulk-sep">|</span>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-bulk-clear-btn" title="Clear selection">×</button>
|
||||
<span class="wfm-bulk-sep" style="margin-left:8px;"></span>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-delete-btn">${t("modelBulkDelete")}</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-bulk-delete-btn" style="margin-left:4px;">${t("modelBulkDelete")}</button>
|
||||
`;
|
||||
|
||||
document.getElementById("wfm-bulk-deselect-all-btn")?.addEventListener("click", clearSelection);
|
||||
document.getElementById("wfm-bulk-fav-add-btn")?.addEventListener("click", () => bulkSetFavorite(true));
|
||||
document.getElementById("wfm-bulk-fav-remove-btn")?.addEventListener("click", () => bulkSetFavorite(false));
|
||||
document.getElementById("wfm-bulk-add-btn")?.addEventListener("click", () => {
|
||||
const g = document.getElementById("wfm-bulk-group-select")?.value;
|
||||
if (g) bulkAddToGroup(g);
|
||||
@@ -285,6 +325,14 @@ function renderBulkActionBar() {
|
||||
if (state.modelGroups[name]) { showToast(t("modelsGroupExists"), "warning"); return; }
|
||||
bulkAddToGroup(name);
|
||||
});
|
||||
document.getElementById("wfm-bulk-badge-apply-btn")?.addEventListener("click", () => {
|
||||
const label = document.getElementById("wfm-bulk-badge-select")?.value;
|
||||
if (label) bulkApplyBadge(label, true);
|
||||
});
|
||||
document.getElementById("wfm-bulk-badge-remove-btn")?.addEventListener("click", () => {
|
||||
const label = document.getElementById("wfm-bulk-badge-select")?.value;
|
||||
if (label) bulkApplyBadge(label, false);
|
||||
});
|
||||
document.getElementById("wfm-bulk-clear-btn")?.addEventListener("click", clearSelection);
|
||||
document.getElementById("wfm-bulk-delete-btn")?.addEventListener("click", bulkDeleteModels);
|
||||
}
|
||||
@@ -312,6 +360,44 @@ async function bulkRemoveFromGroup(groupName) {
|
||||
renderBulkActionBar();
|
||||
}
|
||||
|
||||
async function bulkSetFavorite(isFav) {
|
||||
const models = [...state.selectedModels];
|
||||
let count = 0;
|
||||
for (const mn of models) {
|
||||
const meta = state.modelMetadata[mn] || {};
|
||||
if (meta.favorite === isFav) continue;
|
||||
await saveModelMetadata(mn, { favorite: isFav });
|
||||
count++;
|
||||
}
|
||||
if (count > 0) {
|
||||
showToast(`${count} ${isFav ? t("modelBulkFavDone") : t("modelBulkUnfavDone")}`, "success");
|
||||
renderModelGrid();
|
||||
}
|
||||
}
|
||||
|
||||
async function bulkApplyBadge(badgeLabel, add) {
|
||||
const models = [...state.selectedModels];
|
||||
let count = 0;
|
||||
for (const mn of models) {
|
||||
const meta = state.modelMetadata[mn] || {};
|
||||
const badges = [...(meta.badges || [])];
|
||||
if (add) {
|
||||
if (badges.includes(badgeLabel)) continue;
|
||||
badges.push(badgeLabel);
|
||||
} else {
|
||||
const idx = badges.indexOf(badgeLabel);
|
||||
if (idx === -1) continue;
|
||||
badges.splice(idx, 1);
|
||||
}
|
||||
await saveModelMetadata(mn, { badges });
|
||||
count++;
|
||||
}
|
||||
if (count > 0) {
|
||||
showToast(`${count} ${add ? t("modelBulkBadgeApplyDone") : t("modelBulkBadgeRemoveDone")}`, "success");
|
||||
renderModelGrid();
|
||||
}
|
||||
}
|
||||
|
||||
async function bulkDeleteModels() {
|
||||
const count = state.selectedModels.size;
|
||||
if (count === 0) return;
|
||||
@@ -473,6 +559,11 @@ function filterModels() {
|
||||
});
|
||||
}
|
||||
|
||||
if (state.showBatchOnly) {
|
||||
const batchMembers = state.modelGroups["Batch"] || [];
|
||||
models = models.filter((m) => batchMembers.includes(m));
|
||||
}
|
||||
|
||||
if (state.tagFilter) {
|
||||
models = models.filter((m) => {
|
||||
const meta = state.modelMetadata[m];
|
||||
@@ -659,17 +750,8 @@ function renderGroupFilter() {
|
||||
const select = document.getElementById("wfm-models-group-filter");
|
||||
if (!select) return;
|
||||
|
||||
// Collect groups across all types with type labels
|
||||
const options = [];
|
||||
const typeOrder = Object.keys(TYPE_LABELS);
|
||||
typeOrder.forEach((type) => {
|
||||
const groups = state.allModelGroups[type];
|
||||
if (!groups) return;
|
||||
const names = Object.keys(groups).sort();
|
||||
names.forEach((g) => {
|
||||
options.push({ type, name: g });
|
||||
});
|
||||
});
|
||||
const groups = state.allModelGroups[state.activeModelType] || {};
|
||||
const names = Object.keys(groups).sort();
|
||||
|
||||
const currentValue = state.groupFilter
|
||||
? `${state.activeModelType}::${state.groupFilter}`
|
||||
@@ -677,11 +759,10 @@ function renderGroupFilter() {
|
||||
|
||||
select.innerHTML =
|
||||
`<option value="">${t("modelsAllGroups")}</option>` +
|
||||
options.map(({ type, name }) => {
|
||||
const typeLabel = TYPE_LABELS[type] || type;
|
||||
const value = `${type}::${name}`;
|
||||
names.map((name) => {
|
||||
const value = `${state.activeModelType}::${name}`;
|
||||
const isActive = value === currentValue;
|
||||
return `<option value="${escapeHtml(value)}"${isActive ? " selected" : ""}>[${typeLabel}] ${escapeHtml(name)}</option>`;
|
||||
return `<option value="${escapeHtml(value)}"${isActive ? " selected" : ""}>${escapeHtml(name)}</option>`;
|
||||
}).join("");
|
||||
}
|
||||
|
||||
@@ -748,8 +829,6 @@ function renderModelGrid() {
|
||||
|
||||
if (state.viewMode === "table") {
|
||||
renderTableView(grid, filtered);
|
||||
} else if (state.viewMode === "card") {
|
||||
renderCardView(grid, filtered);
|
||||
} else {
|
||||
renderThumbView(grid, filtered);
|
||||
}
|
||||
@@ -767,6 +846,8 @@ function renderThumbView(grid, models) {
|
||||
const tagsHtml = (meta.tags || []).map((tag) => `<span class="wfm-badge wfm-badge-sm">${escapeHtml(tag)}</span>`).join("");
|
||||
const favStar = meta.favorite ? "\u2605" : "\u2606";
|
||||
const favClass = meta.favorite ? "wfm-fav-btn active" : "wfm-fav-btn";
|
||||
const inBatch = isInBatch(modelName);
|
||||
const batchClass = inBatch ? "wfm-batch-btn active" : "wfm-batch-btn";
|
||||
|
||||
const card = document.createElement("div");
|
||||
card.className = "wfm-card";
|
||||
@@ -784,6 +865,7 @@ function renderThumbView(grid, models) {
|
||||
<div class="wfm-card-title" title="${escapeHtml(modelName)}">${escapeHtml(getStem(name))}</div>
|
||||
<div class="wfm-card-meta">${userBadges} ${tagsHtml}</div>
|
||||
</div>
|
||||
<button class="${batchClass}" title="${t("modelsBatch")}">B</button>
|
||||
<button class="${favClass}" title="${t("modelsFavorite")}">${favStar}</button>
|
||||
<button class="wfm-toggle-btn${disabled ? " wfm-toggle-disabled" : ""}" title="${disabled ? t("modelEnable") : t("modelDisable")}">${disabled ? "▶" : "⏸"}</button>`;
|
||||
|
||||
@@ -792,6 +874,10 @@ function renderThumbView(grid, models) {
|
||||
const placeholder = card.querySelector(".wfm-card-thumb-placeholder");
|
||||
loadPreviewImage(img, placeholder, modelName);
|
||||
|
||||
card.querySelector(".wfm-batch-btn").addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleBatch(modelName);
|
||||
});
|
||||
card.querySelector(".wfm-fav-btn").addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleFavorite(modelName);
|
||||
@@ -807,7 +893,7 @@ function renderThumbView(grid, models) {
|
||||
checkEl.className = "wfm-select-check" + (isChecked ? " checked" : "");
|
||||
card.appendChild(checkEl);
|
||||
card.addEventListener("click", (e) => {
|
||||
if (e.target.closest(".wfm-fav-btn, .wfm-toggle-btn")) return;
|
||||
if (e.target.closest(".wfm-batch-btn, .wfm-fav-btn, .wfm-toggle-btn")) return;
|
||||
toggleModelSelection(modelName);
|
||||
});
|
||||
} else {
|
||||
@@ -818,61 +904,6 @@ function renderThumbView(grid, models) {
|
||||
});
|
||||
}
|
||||
|
||||
// ── Card View (no thumbnail, compact) ─────────────────────
|
||||
|
||||
function renderCardView(grid, models) {
|
||||
grid.innerHTML = "";
|
||||
models.forEach((modelName) => {
|
||||
const meta = state.modelMetadata[modelName] || {};
|
||||
const { dir, name } = parseModelPath(modelName);
|
||||
const ext = getExtension(name);
|
||||
const disabled = isModelDisabled(modelName);
|
||||
const userBadges = modelBadgesHtml(modelName);
|
||||
const tagsHtml = (meta.tags || []).map((tag) => `<span class="wfm-badge wfm-badge-sm">${escapeHtml(tag)}</span>`).join("");
|
||||
const favStar = meta.favorite ? "\u2605" : "\u2606";
|
||||
const favClass = meta.favorite ? "wfm-fav-btn active" : "wfm-fav-btn";
|
||||
|
||||
const card = document.createElement("div");
|
||||
card.className = "wfm-card wfm-model-card";
|
||||
if (disabled) card.classList.add("wfm-model-disabled");
|
||||
if (state.selectedModel === modelName) card.classList.add("wfm-card-selected");
|
||||
card.dataset.modelName = modelName;
|
||||
|
||||
card.innerHTML = `
|
||||
<div class="wfm-card-body">
|
||||
<div class="wfm-card-title" title="${escapeHtml(modelName)}">${escapeHtml(name)}${disabled ? ` <span class="wfm-badge wfm-badge-disabled">${t("modelDisabled")}</span>` : ""}</div>
|
||||
<div class="wfm-card-meta">
|
||||
${userBadges} ${tagsHtml}
|
||||
</div>
|
||||
</div>
|
||||
<button class="${favClass}" title="${t("modelsFavorite")}">${favStar}</button>
|
||||
<button class="wfm-toggle-btn${disabled ? " wfm-toggle-disabled" : ""}" title="${disabled ? t("modelEnable") : t("modelDisable")}">${disabled ? "▶" : "⏸"}</button>`;
|
||||
|
||||
card.querySelector(".wfm-fav-btn").addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleFavorite(modelName);
|
||||
});
|
||||
card.querySelector(".wfm-toggle-btn").addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleModelEnable(modelName);
|
||||
});
|
||||
if (state.selectMode) {
|
||||
const isChecked = state.selectedModels.has(modelName);
|
||||
card.classList.toggle("wfm-card-checked", isChecked);
|
||||
const checkEl = document.createElement("div");
|
||||
checkEl.className = "wfm-select-check" + (isChecked ? " checked" : "");
|
||||
card.appendChild(checkEl);
|
||||
card.addEventListener("click", (e) => {
|
||||
if (e.target.closest(".wfm-fav-btn, .wfm-toggle-btn")) return;
|
||||
toggleModelSelection(modelName);
|
||||
});
|
||||
} else {
|
||||
card.addEventListener("click", () => showSidePanel(modelName));
|
||||
card.addEventListener("dblclick", (e) => { e.stopPropagation(); openDetailModal(modelName); });
|
||||
}
|
||||
grid.appendChild(card);
|
||||
});
|
||||
}
|
||||
|
||||
// ── Table View ────────────────────────────────────────────
|
||||
|
||||
@@ -885,6 +916,7 @@ function renderTableView(grid, models) {
|
||||
const disabled = isModelDisabled(modelName);
|
||||
const isChecked = state.selectMode && state.selectedModels.has(modelName);
|
||||
const favIcon = meta.favorite ? "★" : "☆";
|
||||
const batchIcon = isInBatch(modelName) ? `<button class="wfm-batch-btn active" title="${t("modelsBatch")}">B</button>` : `<button class="wfm-batch-btn" title="${t("modelsBatch")}">B</button>`;
|
||||
const tagsStr = (meta.tags || []).join(", ");
|
||||
const memo = meta.memo || "";
|
||||
const toggleLabel = disabled ? t("modelEnable") : t("modelDisable");
|
||||
@@ -902,6 +934,7 @@ function renderTableView(grid, models) {
|
||||
<td>${escapeHtml(tagsStr)}</td>
|
||||
<td class="wfm-table-td-memo" title="${escapeHtml(memo)}">${escapeHtml(memo)}</td>
|
||||
<td class="wfm-table-td-toggle"><button class="wfm-toggle-btn${disabled ? " wfm-toggle-disabled" : ""}" title="${toggleLabel}">${toggleIcon}</button></td>
|
||||
<td class="wfm-table-td-batch">${batchIcon}</td>
|
||||
</tr>`;
|
||||
})
|
||||
.join("");
|
||||
@@ -917,6 +950,7 @@ function renderTableView(grid, models) {
|
||||
<th>${t("modelsTags")}</th>
|
||||
<th>${t("modelsMemo")}</th>
|
||||
<th style="width:50px;"></th>
|
||||
<th style="width:30px;">B</th>
|
||||
</tr></thead><tbody>${rows}</tbody></table>`;
|
||||
|
||||
grid.querySelectorAll(".wfm-models-table-row").forEach((row) => {
|
||||
@@ -926,7 +960,7 @@ function renderTableView(grid, models) {
|
||||
|
||||
if (state.selectMode) {
|
||||
row.addEventListener("click", (e) => {
|
||||
if (e.target.closest(".wfm-models-table-fav, .wfm-toggle-btn")) return;
|
||||
if (e.target.closest(".wfm-models-table-fav, .wfm-toggle-btn, .wfm-batch-btn")) return;
|
||||
toggleModelSelection(mn);
|
||||
});
|
||||
} else {
|
||||
@@ -941,9 +975,45 @@ function renderTableView(grid, models) {
|
||||
e.stopPropagation();
|
||||
toggleModelEnable(mn);
|
||||
});
|
||||
row.querySelector(".wfm-batch-btn").addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
toggleBatch(mn);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ── Batch group helpers ───────────────────────────────────
|
||||
|
||||
function isInBatch(modelName) {
|
||||
return (state.modelGroups["Batch"] || []).includes(modelName);
|
||||
}
|
||||
|
||||
async function toggleBatch(modelName) {
|
||||
const batch = state.modelGroups["Batch"] || [];
|
||||
const idx = batch.indexOf(modelName);
|
||||
if (idx >= 0) {
|
||||
batch.splice(idx, 1);
|
||||
} else {
|
||||
batch.push(modelName);
|
||||
}
|
||||
state.modelGroups["Batch"] = batch;
|
||||
state.allModelGroups[state.activeModelType] = state.modelGroups;
|
||||
await saveModelGroups(state.modelGroups);
|
||||
renderModelGrid();
|
||||
}
|
||||
|
||||
async function clearBatchGroup() {
|
||||
state.modelGroups["Batch"] = [];
|
||||
state.allModelGroups[state.activeModelType] = state.modelGroups;
|
||||
await saveModelGroups(state.modelGroups);
|
||||
if (state.showBatchOnly) {
|
||||
state.showBatchOnly = false;
|
||||
document.getElementById("wfm-models-batch-filter-btn")?.classList.remove("active");
|
||||
}
|
||||
renderModelGrid();
|
||||
showToast(t("modelsBatchClear"), "success");
|
||||
}
|
||||
|
||||
// ── Favorite toggle ───────────────────────────────────────
|
||||
|
||||
async function toggleFavorite(modelName) {
|
||||
@@ -1358,6 +1428,10 @@ function renderSideGroup(modelName) {
|
||||
const sel = document.getElementById("wfm-models-group-manage-select");
|
||||
const oldName = sel?.value;
|
||||
if (!oldName) return;
|
||||
if (RESERVED_GROUPS.includes(oldName)) {
|
||||
showToast(t("modelsGroupReserved"), "warning");
|
||||
return;
|
||||
}
|
||||
const newName = prompt(t("modelsRenamePrompt"), oldName);
|
||||
if (!newName || newName === oldName) return;
|
||||
if (state.modelGroups[newName]) {
|
||||
@@ -1377,6 +1451,10 @@ function renderSideGroup(modelName) {
|
||||
const sel = document.getElementById("wfm-models-group-manage-select");
|
||||
const g = sel?.value;
|
||||
if (!g) return;
|
||||
if (RESERVED_GROUPS.includes(g)) {
|
||||
showToast(t("modelsGroupReserved"), "warning");
|
||||
return;
|
||||
}
|
||||
if (!confirm(t("modelsDeleteGroupConfirm").replace("{name}", g))) return;
|
||||
delete state.modelGroups[g];
|
||||
saveModelGroups(state.modelGroups).then(() => {
|
||||
@@ -1415,6 +1493,21 @@ function renderSideCivitai(modelName) {
|
||||
|
||||
if (cached) {
|
||||
renderCivitaiInfo(el, cached, modelName);
|
||||
} else if (sha256) {
|
||||
// SHA256 is known but model was not found on CivitAI
|
||||
el.innerHTML = `
|
||||
<div style="padding:0 4px;text-align:center;">
|
||||
<p style="color:var(--wfm-text-secondary);font-size:13px;margin-bottom:12px;">
|
||||
${t("civitaiNotFoundDesc")}
|
||||
</p>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-civitai-fetch-btn">
|
||||
${t("civitaiRefetchBtn")}
|
||||
</button>
|
||||
<div id="wfm-civitai-status" style="margin-top:8px;font-size:12px;color:var(--wfm-text-secondary);"></div>
|
||||
</div>`;
|
||||
document.getElementById("wfm-civitai-fetch-btn")?.addEventListener("click", () => {
|
||||
fetchCivitaiForModel(modelName, el);
|
||||
});
|
||||
} else {
|
||||
el.innerHTML = `
|
||||
<div style="padding:0 4px;text-align:center;">
|
||||
@@ -1456,6 +1549,23 @@ async function fetchCivitaiForModel(modelName, el) {
|
||||
}
|
||||
renderCivitaiInfo(el, data.civitai, modelName);
|
||||
showToast(t("civitaiFound"), "success");
|
||||
// Always refresh preview: local file if saved, otherwise civitai image as fallback
|
||||
const sidePanel = document.getElementById("wfm-models-side-panel");
|
||||
if (sidePanel) {
|
||||
const sideImg = sidePanel.querySelector(".wfm-side-thumb-img-wrap img");
|
||||
const sidePh = sidePanel.querySelector(".wfm-side-thumb-placeholder");
|
||||
if (sideImg) {
|
||||
if (data.preview_saved) {
|
||||
sideImg.src = previewUrl(modelName) + "&t=" + Date.now();
|
||||
} else {
|
||||
const civitaiImg = data.civitai.images && data.civitai.images[0];
|
||||
if (civitaiImg) sideImg.src = civitaiImg;
|
||||
}
|
||||
sideImg.style.display = "";
|
||||
if (sidePh) sidePh.style.display = "none";
|
||||
}
|
||||
}
|
||||
renderModelGrid();
|
||||
} else if (data.status === "not_found") {
|
||||
if (statusEl) statusEl.textContent = t("civitaiNotFound");
|
||||
if (fetchBtn) fetchBtn.disabled = false;
|
||||
@@ -1471,9 +1581,47 @@ async function fetchCivitaiForModel(modelName, el) {
|
||||
}
|
||||
|
||||
function renderCivitaiInfo(el, info, modelName) {
|
||||
const imagesHtml = (info.images || []).map((url) =>
|
||||
`<img src="${escapeHtml(url)}" style="width:100%;border-radius:4px;margin-bottom:6px;" loading="lazy" />`
|
||||
).join("");
|
||||
// URL: ユーザー設定ホスト(localStorage)を使用、modelId なし時は /model-versions/ にフォールバック
|
||||
const civitaiHost = localStorage.getItem("wfm_civitai_host") || "civitai.com";
|
||||
const modelUrl = info.modelId && info.versionId
|
||||
? `https://${civitaiHost}/models/${info.modelId}?modelVersionId=${info.versionId}`
|
||||
: info.versionId
|
||||
? `https://${civitaiHost}/model-versions/${info.versionId}`
|
||||
: (info.modelUrl || "#");
|
||||
|
||||
// Hash: BLAKE3 優先、なければ SHA256
|
||||
const fileHashes = info.fileHashes || {};
|
||||
const blake3 = fileHashes.BLAKE3 || fileHashes.Blake3 || "";
|
||||
const sha256 = fileHashes.SHA256 || (state.modelMetadata[modelName] || {}).sha256 || "";
|
||||
const hashType = blake3 ? "BLAKE3" : (sha256 ? "SHA256" : "");
|
||||
const hashFull = blake3 || sha256;
|
||||
|
||||
// Detail rows
|
||||
const ROW = "display:flex;align-items:center;font-size:12px;margin-bottom:5px;";
|
||||
const LABEL = "color:var(--wfm-text-secondary);min-width:80px;flex-shrink:0;";
|
||||
|
||||
const typeRow = info.type ? `
|
||||
<div style="${ROW}">
|
||||
<span style="${LABEL}">${t("civitaiType")}</span>
|
||||
<span style="font-size:10px;font-weight:700;background:var(--wfm-bg-tertiary,rgba(255,255,255,0.1));padding:2px 7px;border-radius:3px;letter-spacing:0.6px;">${escapeHtml(info.type.toUpperCase())}</span>
|
||||
</div>` : "";
|
||||
|
||||
const baseModelRow = info.baseModel ? `
|
||||
<div style="${ROW}">
|
||||
<span style="${LABEL}">${t("civitaiBaseModel")}</span>
|
||||
<span>${escapeHtml(info.baseModel)}</span>
|
||||
</div>` : "";
|
||||
|
||||
const hashRow = hashFull ? `
|
||||
<div style="${ROW}">
|
||||
<span style="${LABEL}">${t("civitaiHashLabel")}</span>
|
||||
<code class="wfm-hash-value" data-hash="${escapeHtml(hashFull)}"
|
||||
style="background:var(--wfm-bg-secondary);padding:2px 6px;border-radius:3px;cursor:pointer;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 84px);"
|
||||
title="${t("civitaiCopyHash")}">${escapeHtml(hashType)}: ${escapeHtml(hashFull.substring(0, 16).toUpperCase())}…</code>
|
||||
</div>` : "";
|
||||
|
||||
const detailSection = (typeRow || baseModelRow || hashRow)
|
||||
? `<div style="margin-bottom:10px;">${typeRow}${baseModelRow}${hashRow}</div>` : "";
|
||||
|
||||
const tagsHtml = (info.tags || []).map((tag) =>
|
||||
`<span class="wfm-badge wfm-badge-sm">${escapeHtml(tag)}</span>`
|
||||
@@ -1483,25 +1631,64 @@ function renderCivitaiInfo(el, info, modelName) {
|
||||
`<code style="font-size:11px;background:var(--wfm-bg-secondary);padding:1px 4px;border-radius:3px;cursor:pointer;" class="wfm-trained-word" title="${t("civitaiCopyWord")}">${escapeHtml(w)}</code>`
|
||||
).join(" ");
|
||||
|
||||
// Sample images — all go to Sample pane
|
||||
const images = info.images || [];
|
||||
const sampleImagesHtml = images.map((url) =>
|
||||
`<a href="${escapeHtml(url)}" target="_blank" rel="noopener" title="${t("civitaiOpenImage")}"><img src="${escapeHtml(url)}" style="width:100%;border-radius:4px;margin-bottom:6px;cursor:pointer;display:block;" loading="lazy" /></a>`
|
||||
).join("");
|
||||
|
||||
el.innerHTML = `
|
||||
<div style="padding:0 4px;">
|
||||
<div style="margin-bottom:10px;">
|
||||
<div style="font-weight:700;font-size:14px;margin-bottom:2px;">
|
||||
<a href="${escapeHtml(info.modelUrl)}" target="_blank" style="color:var(--wfm-primary);text-decoration:none;">${escapeHtml(info.modelName)}</a>
|
||||
<div style="display:flex;border-bottom:1px solid var(--wfm-border);margin-bottom:10px;">
|
||||
<button class="wfm-civitai-subtab-btn" data-pane="info"
|
||||
style="padding:4px 10px;font-size:12px;border:none;background:none;cursor:pointer;border-bottom:2px solid var(--wfm-primary);color:var(--wfm-primary);font-weight:600;margin-bottom:-1px;">
|
||||
${t("civitaiTabInfo")}
|
||||
</button>
|
||||
<button class="wfm-civitai-subtab-btn" data-pane="sample"
|
||||
style="padding:4px 10px;font-size:12px;border:none;background:none;cursor:pointer;border-bottom:2px solid transparent;color:var(--wfm-text-secondary);margin-bottom:-1px;">
|
||||
${t("civitaiTabSample")}${images.length ? ` (${images.length})` : ""}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="wfm-civitai-pane-info">
|
||||
<div style="margin-bottom:10px;">
|
||||
<div style="font-weight:700;font-size:14px;margin-bottom:2px;">
|
||||
<a href="${escapeHtml(modelUrl)}" target="_blank" style="color:var(--wfm-primary);text-decoration:none;">${escapeHtml(info.modelName)}</a>
|
||||
</div>
|
||||
<div style="font-size:12px;color:var(--wfm-text-secondary);">
|
||||
${escapeHtml(info.versionName)}${info.creator ? ` · by ${escapeHtml(info.creator)}` : ""}
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size:12px;color:var(--wfm-text-secondary);">
|
||||
${escapeHtml(info.versionName)} · ${escapeHtml(info.baseModel)} · by ${escapeHtml(info.creator)}
|
||||
${detailSection}
|
||||
${tagsHtml ? `<div style="margin-bottom:8px;">${tagsHtml}</div>` : ""}
|
||||
${trainedWordsHtml ? `<div style="margin-bottom:10px;"><div style="font-weight:600;font-size:12px;margin-bottom:4px;">${t("civitaiTriggerWords")}</div>${trainedWordsHtml}</div>` : ""}
|
||||
${info.description ? `<div style="font-size:12px;color:var(--wfm-text-secondary);line-height:1.5;max-height:120px;overflow-y:auto;">${info.description}</div>` : ""}
|
||||
<div style="margin-top:10px;">
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-civitai-refresh-btn">${t("civitaiRefresh")}</button>
|
||||
</div>
|
||||
</div>
|
||||
${imagesHtml ? `<div style="margin-bottom:10px;">${imagesHtml}</div>` : ""}
|
||||
${tagsHtml ? `<div style="margin-bottom:8px;">${tagsHtml}</div>` : ""}
|
||||
${trainedWordsHtml ? `<div style="margin-bottom:10px;"><div style="font-weight:600;font-size:12px;margin-bottom:4px;">${t("civitaiTriggerWords")}</div>${trainedWordsHtml}</div>` : ""}
|
||||
${info.description ? `<div style="font-size:12px;color:var(--wfm-text-secondary);line-height:1.5;max-height:200px;overflow-y:auto;">${info.description}</div>` : ""}
|
||||
<div style="margin-top:10px;">
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-civitai-refresh-btn">${t("civitaiRefresh")}</button>
|
||||
|
||||
<div id="wfm-civitai-pane-sample" style="display:none;">
|
||||
${sampleImagesHtml || `<p style="color:var(--wfm-text-secondary);font-size:13px;text-align:center;margin-top:20px;">${t("civitaiNoImages")}</p>`}
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
// Sub-tab switching
|
||||
const subtabBtns = el.querySelectorAll(".wfm-civitai-subtab-btn");
|
||||
subtabBtns.forEach((btn) => {
|
||||
btn.addEventListener("click", () => {
|
||||
const pane = btn.dataset.pane;
|
||||
subtabBtns.forEach((b) => {
|
||||
const isActive = b === btn;
|
||||
b.style.borderBottom = isActive ? "2px solid var(--wfm-primary)" : "2px solid transparent";
|
||||
b.style.color = isActive ? "var(--wfm-primary)" : "var(--wfm-text-secondary)";
|
||||
b.style.fontWeight = isActive ? "600" : "400";
|
||||
});
|
||||
el.querySelector("#wfm-civitai-pane-info").style.display = pane === "info" ? "" : "none";
|
||||
el.querySelector("#wfm-civitai-pane-sample").style.display = pane === "sample" ? "" : "none";
|
||||
});
|
||||
});
|
||||
|
||||
// Copy trigger word on click
|
||||
el.querySelectorAll(".wfm-trained-word").forEach((wordEl) => {
|
||||
wordEl.addEventListener("click", () => {
|
||||
@@ -1511,9 +1698,17 @@ function renderCivitaiInfo(el, info, modelName) {
|
||||
});
|
||||
});
|
||||
|
||||
// Copy hash on click
|
||||
el.querySelectorAll(".wfm-hash-value").forEach((hashEl) => {
|
||||
hashEl.addEventListener("click", () => {
|
||||
navigator.clipboard.writeText(hashEl.dataset.hash).then(() => {
|
||||
showToast(t("civitaiHashCopied"), "success");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Refresh button
|
||||
document.getElementById("wfm-civitai-refresh-btn")?.addEventListener("click", () => {
|
||||
// Clear cache for this model and re-fetch
|
||||
const meta = state.modelMetadata[modelName] || {};
|
||||
if (meta.sha256) delete state.civitaiCache[meta.sha256];
|
||||
delete meta.sha256;
|
||||
@@ -1530,6 +1725,10 @@ async function loadModelsForCurrentType() {
|
||||
if (state.loaded[type] && state.modelsByType[type].length > 0) {
|
||||
// Reload groups for this type (groups are per-type)
|
||||
state.modelGroups = await fetchModelGroups();
|
||||
if (BATCH_MODEL_TYPES.includes(type) && !state.modelGroups["Batch"]) {
|
||||
state.modelGroups["Batch"] = [];
|
||||
await saveModelGroups(state.modelGroups);
|
||||
}
|
||||
state.allModelGroups[type] = state.modelGroups;
|
||||
renderTagFilter();
|
||||
renderDirFilter();
|
||||
@@ -1549,6 +1748,10 @@ async function loadModelsForCurrentType() {
|
||||
]);
|
||||
const disabledSet = new Set(Array.isArray(disabledList) ? disabledList : []);
|
||||
state.disabledModels[type] = disabledSet;
|
||||
if (BATCH_MODEL_TYPES.includes(type) && !groups["Batch"]) {
|
||||
groups["Batch"] = [];
|
||||
await saveModelGroups(groups);
|
||||
}
|
||||
state.modelGroups = groups;
|
||||
state.allModelGroups[type] = groups;
|
||||
|
||||
@@ -1637,9 +1840,18 @@ async function batchFetchCivitai() {
|
||||
if (progressEl) progressEl.textContent = `${pct}% (${data.current}/${data.total}) ${statusText}`;
|
||||
} else if (eventType === "done") {
|
||||
if (progressEl) progressEl.textContent = "";
|
||||
showToast(t("civitaiBatchDone", data.found, data.not_found), "success");
|
||||
const previewNote = data.preview_saved > 0 ? ` (+${data.preview_saved} preview)` : "";
|
||||
showToast(t("civitaiBatchDone", data.found, data.not_found) + previewNote, "success");
|
||||
// Reload caches
|
||||
const [newMeta, newCache] = await Promise.all([fetchModelMetadata(), fetchCivitaiCache()]);
|
||||
// Apply sha256 hashes from batch result directly in case fetchModelMetadata
|
||||
// returns before the server has flushed updated metadata to disk
|
||||
if (data.hashes) {
|
||||
for (const [modelName, sha256] of Object.entries(data.hashes)) {
|
||||
if (!newMeta[modelName]) newMeta[modelName] = {};
|
||||
if (!newMeta[modelName].sha256) newMeta[modelName].sha256 = sha256;
|
||||
}
|
||||
}
|
||||
state.modelMetadata = newMeta;
|
||||
state.civitaiCache = newCache;
|
||||
renderModelGrid();
|
||||
@@ -1781,6 +1993,19 @@ export function initModelsTab() {
|
||||
});
|
||||
}
|
||||
|
||||
// Batch filter
|
||||
document.getElementById("wfm-models-batch-filter-btn")?.addEventListener("click", () => {
|
||||
state.showBatchOnly = !state.showBatchOnly;
|
||||
document.getElementById("wfm-models-batch-filter-btn").classList.toggle("active", state.showBatchOnly);
|
||||
state.currentPage = 0;
|
||||
renderModelGrid();
|
||||
});
|
||||
|
||||
// Batch clear
|
||||
document.getElementById("wfm-models-batch-clear-btn")?.addEventListener("click", () => {
|
||||
clearBatchGroup();
|
||||
});
|
||||
|
||||
// View mode (thumb / card / table)
|
||||
document.querySelectorAll("[data-models-view]").forEach((btn) => {
|
||||
if (btn.dataset.modelsView === state.viewMode) {
|
||||
@@ -1826,6 +2051,7 @@ export function initModelsTab() {
|
||||
const map = { info: "wfm-models-side-info", group: "wfm-models-side-group", civitai: "wfm-models-side-civitai" };
|
||||
const target = document.getElementById(map[tabId]);
|
||||
if (target) target.style.display = "block";
|
||||
if (tabId === "civitai" && state.selectedModel) renderSideCivitai(state.selectedModel);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
@@ -338,6 +338,36 @@ export function applyTextareaFontSize(size) {
|
||||
el.textContent = `${TEXTAREA_FONT_SIZE_TARGETS} { font-size: ${px}px !important; }`;
|
||||
}
|
||||
|
||||
// JSON highlight color settings
|
||||
const JSON_COLOR_STYLE_ID = "wfm-json-color-style";
|
||||
|
||||
const JSON_COLOR_DEFS = [
|
||||
{ id: "base", label: () => t("jsonColorBase") || "通常テキスト", def: "#abb2bf" },
|
||||
{ id: "yellow", label: () => t("jsonColorYellow") || "名前 / スケジューラ", def: "#e5c07b" },
|
||||
{ id: "pink", label: () => t("jsonColorPink") || "タイトル", def: "#c678dd" },
|
||||
{ id: "green", label: () => t("jsonColorGreen") || "Width / Height", def: "#98c379" },
|
||||
{ id: "cyan", label: () => t("jsonColorCyan") || "プロンプト / テキスト", def: "#61afef" },
|
||||
{ id: "red", label: () => t("jsonColorRed") || "画像 / ファイル", def: "#e06c75" },
|
||||
];
|
||||
|
||||
export function applyJsonColors(colors) {
|
||||
const vals = Object.fromEntries(JSON_COLOR_DEFS.map(d => [d.id, colors?.[d.id] || d.def]));
|
||||
let el = document.getElementById(JSON_COLOR_STYLE_ID);
|
||||
if (!el) {
|
||||
el = document.createElement("style");
|
||||
el.id = JSON_COLOR_STYLE_ID;
|
||||
document.head.appendChild(el);
|
||||
}
|
||||
el.textContent = [
|
||||
`.wfm-json-highlight { color: ${vals.base}; }`,
|
||||
`.json-key-yellow, .json-val-yellow { color: ${vals.yellow}; }`,
|
||||
`.json-key-pink, .json-val-pink { color: ${vals.pink}; }`,
|
||||
`.json-key-green, .json-val-green { color: ${vals.green}; }`,
|
||||
`.json-key-cyan, .json-val-cyan { color: ${vals.cyan}; }`,
|
||||
`.json-key-red, .json-val-red { color: ${vals.red}; }`,
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
export function applyTheme(themeId) {
|
||||
if (themeId) {
|
||||
document.documentElement.setAttribute("data-theme", themeId);
|
||||
@@ -363,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 {
|
||||
@@ -527,6 +562,23 @@ export async function initSettingsTab() {
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- RAW JSON Colors -->
|
||||
<details class="wfm-settings-section" open>
|
||||
<summary class="wfm-settings-summary">${t("jsonColorsSection") || "RAW JSON Colors"}</summary>
|
||||
<div class="wfm-form-group">
|
||||
<div class="wfm-color-grid" id="wfm-json-color-grid">
|
||||
${JSON_COLOR_DEFS.map(d => {
|
||||
const saved = settings.jsonColors?.[d.id] || d.def;
|
||||
return `<div class="wfm-color-item">
|
||||
<label>${d.label()}</label>
|
||||
<input type="color" data-json-color="${d.id}" value="${saved}">
|
||||
</div>`;
|
||||
}).join("")}
|
||||
</div>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-json-color-reset" style="margin-top:8px;">${t("jsonColorReset") || "デフォルトに戻す"}</button>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- Workflow Data Folder -->
|
||||
<details class="wfm-settings-section">
|
||||
<summary class="wfm-settings-summary">${t("workflowsDir")}</summary>
|
||||
@@ -612,6 +664,36 @@ export async function initSettingsTab() {
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- 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")}
|
||||
</small>
|
||||
<div style="display:flex;gap:8px;">
|
||||
<input type="password" class="wfm-input" id="wfm-settings-civitai-api-key"
|
||||
value="${serverSettings.civitai_api_key || ""}"
|
||||
placeholder="${t("civitaiApiKeyPlaceholder")}"
|
||||
style="flex:1;">
|
||||
<button class="wfm-btn wfm-btn-primary wfm-btn-sm" id="wfm-settings-civitai-api-key-save">
|
||||
${t("civitaiApiKeySave")}
|
||||
</button>
|
||||
</div>
|
||||
<div id="wfm-settings-civitai-api-key-status" style="font-size:12px;margin-top:4px;"></div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- Default Workflow -->
|
||||
<details class="wfm-settings-section">
|
||||
<summary class="wfm-settings-summary">${t("defaultWorkflow")}</summary>
|
||||
@@ -1024,6 +1106,36 @@ 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() || "";
|
||||
const statusEl = document.getElementById("wfm-settings-civitai-api-key-status");
|
||||
try {
|
||||
await saveServerSettings({ civitai_api_key: apiKey });
|
||||
serverSettings.civitai_api_key = apiKey;
|
||||
showToast(t("civitaiApiKeySaved"), "success");
|
||||
if (statusEl) { statusEl.textContent = ""; }
|
||||
} catch (err) {
|
||||
if (statusEl) {
|
||||
statusEl.textContent = `${t("saveError")}: ${err.message}`;
|
||||
statusEl.style.color = "var(--wfm-danger)";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Test ComfyUI URL
|
||||
document.getElementById("wfm-settings-test-url")?.addEventListener("click", async () => {
|
||||
const urlInput = document.getElementById("wfm-settings-comfyui-url");
|
||||
@@ -1082,6 +1194,27 @@ export async function initSettingsTab() {
|
||||
applyTextareaFontSize(px);
|
||||
});
|
||||
|
||||
// --- JSON highlight color pickers ---
|
||||
document.getElementById("wfm-json-color-grid")?.addEventListener("input", (e) => {
|
||||
if (e.target.type !== "color") return;
|
||||
const id = e.target.dataset.jsonColor;
|
||||
const jsonColors = { ...(loadLocalSettings().jsonColors || {}), [id]: e.target.value };
|
||||
saveLocalSettings({ jsonColors });
|
||||
applyJsonColors(jsonColors);
|
||||
});
|
||||
|
||||
document.getElementById("wfm-json-color-reset")?.addEventListener("click", () => {
|
||||
const cur = loadLocalSettings();
|
||||
delete cur.jsonColors;
|
||||
localStorage.setItem(SETTINGS_KEY, JSON.stringify(cur));
|
||||
applyJsonColors(undefined);
|
||||
document.querySelectorAll("#wfm-json-color-grid input[type=color]").forEach(inp => {
|
||||
const def = JSON_COLOR_DEFS.find(d => d.id === inp.dataset.jsonColor);
|
||||
if (def) inp.value = def.def;
|
||||
});
|
||||
showToast(t("settingsSaved"), "success");
|
||||
});
|
||||
|
||||
// Save (local settings)
|
||||
document.getElementById("wfm-settings-save")?.addEventListener("click", () => {
|
||||
const taFontSize = parseInt(document.getElementById("wfm-ta-font-size")?.value) || TEXTAREA_FONT_SIZE_DEFAULT;
|
||||
|
||||
@@ -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) {
|
||||
@@ -1271,6 +1333,11 @@ export function initWorkflowTab() {
|
||||
openBadgeEditModal(() => renderGrid());
|
||||
});
|
||||
|
||||
// Toolbar: BC (batch clear) button
|
||||
document.getElementById("wfm-wf-batch-clear-btn")?.addEventListener("click", () => {
|
||||
clearBatch();
|
||||
});
|
||||
|
||||
// Initial load
|
||||
loadWorkflows();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<button class="wfm-tab" data-tab="gallery">Gallery</button>
|
||||
<button class="wfm-tab" data-tab="settings">Settings</button>
|
||||
<button class="wfm-tab" data-tab="help">Help</button>
|
||||
<button class="wfm-tab" data-tab="ai">AI TOOL</button>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
@@ -49,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>
|
||||
@@ -62,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">
|
||||
@@ -189,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>
|
||||
@@ -200,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>
|
||||
@@ -209,6 +210,7 @@
|
||||
<span id="wfm-models-civitai-progress" style="font-size:12px;color:var(--wfm-text-secondary);"></span>
|
||||
<button id="wfm-models-badge-settings-btn" class="wfm-btn wfm-btn-sm" title="Badge settings">⚙ Badge</button>
|
||||
<button id="wfm-models-select-btn" class="wfm-btn wfm-btn-sm" title="Multi-select models">Select</button>
|
||||
<button id="wfm-models-batch-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all batch entries">BC</button>
|
||||
</div>
|
||||
<!-- Bulk action bar (shown in select mode) -->
|
||||
<div id="wfm-models-bulk-bar" class="wfm-bulk-bar" style="display:none;"></div>
|
||||
@@ -266,6 +268,7 @@
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="model">Model</button>
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="settings">Settings</button>
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="feeder">Feeder</button>
|
||||
<button class="wfm-gen-subtab-btn" data-subtab="batch">Batch</button>
|
||||
</div>
|
||||
|
||||
<!-- Tab: Input — left sub-col: Prompt(top)+Image(bottom), right sub-col: Raw JSON -->
|
||||
@@ -312,6 +315,87 @@
|
||||
<div class="wfm-gen-rawjson-col" id="wfm-gen-rawjson-col-settings"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tab: Batch — 3-pane: file tree | group select | queue preview -->
|
||||
<div id="wfm-gen-subtab-batch" class="wfm-gen-subtab-content">
|
||||
<div class="wfm-batch-layout">
|
||||
<!-- Left pane: file-tree checkpoint selection -->
|
||||
<div class="wfm-batch-pane wfm-batch-left">
|
||||
<div class="wfm-batch-pane-header">Checkpoints</div>
|
||||
<div class="wfm-batch-toolbar">
|
||||
<input type="text" id="wfm-ckpt-search" class="wfm-input" placeholder="Filter...">
|
||||
<button type="button" id="wfm-ckpt-select-all" class="wfm-btn wfm-btn-sm">All</button>
|
||||
<button type="button" id="wfm-ckpt-deselect-all" class="wfm-btn wfm-btn-sm">None</button>
|
||||
</div>
|
||||
<div id="wfm-ckpt-list" class="wfm-batch-list"></div>
|
||||
</div>
|
||||
|
||||
<!-- Center pane: group-based selection with inner tabs -->
|
||||
<div class="wfm-batch-pane wfm-batch-center">
|
||||
<div class="wfm-batch-inner-tab-nav">
|
||||
<button class="wfm-batch-inner-tab active" data-batch-inner="checkpoint">Checkpoint</button>
|
||||
<button class="wfm-batch-inner-tab" data-batch-inner="lora">Lora</button>
|
||||
<button class="wfm-batch-inner-tab" data-batch-inner="prompt">Prompt</button>
|
||||
<button class="wfm-batch-inner-tab" data-batch-inner="workflow">Workflow</button>
|
||||
</div>
|
||||
<div id="wfm-batch-inner-checkpoint" class="wfm-batch-inner-content active">
|
||||
<div class="wfm-batch-pane-header" style="border-top:none;">Groups</div>
|
||||
<div id="wfm-batch-group-list" class="wfm-batch-group-list"></div>
|
||||
</div>
|
||||
<div id="wfm-batch-inner-lora" class="wfm-batch-inner-content">
|
||||
<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">
|
||||
<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">
|
||||
<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 (4 columns) -->
|
||||
<div class="wfm-batch-pane wfm-batch-right">
|
||||
<div class="wfm-batch-pane-header">Batch Queue</div>
|
||||
<div class="wfm-batch-queue-grid">
|
||||
<div class="wfm-batch-queue-col">
|
||||
<div class="wfm-batch-queue-col-header">
|
||||
<span>Checkpoint</span>
|
||||
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="checkpoint" title="Checkpoint batch を有効にする">
|
||||
</div>
|
||||
<div id="wfm-batch-preview-count" class="wfm-batch-count"></div>
|
||||
<div id="wfm-batch-preview-list" class="wfm-batch-preview-list"></div>
|
||||
</div>
|
||||
<div class="wfm-batch-queue-col">
|
||||
<div class="wfm-batch-queue-col-header">
|
||||
<span>Lora</span>
|
||||
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="lora" title="Lora batch を有効にする">
|
||||
</div>
|
||||
<div id="wfm-batch-lora-count" class="wfm-batch-count"></div>
|
||||
<div id="wfm-batch-lora-list" class="wfm-batch-preview-list"></div>
|
||||
</div>
|
||||
<div class="wfm-batch-queue-col">
|
||||
<div class="wfm-batch-queue-col-header">
|
||||
<span>Prompt</span>
|
||||
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="prompt" title="Prompt batch を有効にする">
|
||||
</div>
|
||||
<div id="wfm-batch-prompt-count" class="wfm-batch-count"></div>
|
||||
<div id="wfm-batch-prompt-list" class="wfm-batch-preview-list"></div>
|
||||
</div>
|
||||
<div class="wfm-batch-queue-col">
|
||||
<div class="wfm-batch-queue-col-header">
|
||||
<span>Workflow</span>
|
||||
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="workflow" title="Workflow batch を有効にする">
|
||||
</div>
|
||||
<div id="wfm-batch-wf-count" class="wfm-batch-count"></div>
|
||||
<div id="wfm-batch-wf-list" class="wfm-batch-preview-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab: Feeder — full-width: settings(left) + library(center) -->
|
||||
<div id="wfm-gen-subtab-feeder" class="wfm-gen-subtab-content">
|
||||
<div class="wfm-feeder-layout">
|
||||
@@ -461,34 +545,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Checkpoint Batch Panel -->
|
||||
<!-- Batch Status Panel -->
|
||||
<div class="wfm-gen-panel" id="wfm-ckpt-batch-panel">
|
||||
<div style="display:flex;align-items:center;gap:8px;">
|
||||
<input type="checkbox" id="wfm-ckpt-batch-enabled" style="width:14px;height:14px;cursor:pointer;accent-color:var(--wfm-primary);">
|
||||
<label for="wfm-ckpt-batch-enabled" style="font-weight:600;font-size:13px;cursor:pointer;">Checkpoint Batch</label>
|
||||
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;">
|
||||
<span style="font-weight:600;font-size:13px;">Batch</span>
|
||||
<span id="wfm-batch-type-label" style="font-size:11px;color:var(--wfm-text-secondary);">—</span>
|
||||
</div>
|
||||
<div id="wfm-ckpt-batch-body" style="display:none;margin-top:8px;">
|
||||
<div style="margin-bottom:6px;">
|
||||
<div style="font-size:11px;color:var(--wfm-text-secondary);margin-bottom:3px;">Checkpoints</div>
|
||||
<div class="wfm-ckpt-dropdown-wrap" id="wfm-ckpt-dropdown-wrap">
|
||||
<button type="button" id="wfm-ckpt-dropdown-btn" class="wfm-ckpt-dropdown-trigger">
|
||||
<span id="wfm-ckpt-dropdown-label">All checkpoints</span>
|
||||
<span class="wfm-ckpt-dropdown-arrow">▼</span>
|
||||
</button>
|
||||
<div id="wfm-ckpt-dropdown-panel" class="wfm-ckpt-dropdown-panel" style="display:none;">
|
||||
<div style="padding:6px 8px 4px;">
|
||||
<input type="text" id="wfm-ckpt-search" class="wfm-input" style="height:28px;padding:4px 8px;font-size:11px;" placeholder="Filter...">
|
||||
</div>
|
||||
<div style="display:flex;gap:4px;padding:0 8px 4px;">
|
||||
<button type="button" id="wfm-ckpt-select-all" class="wfm-btn wfm-btn-sm" style="flex:1;font-size:10px;">All</button>
|
||||
<button type="button" id="wfm-ckpt-deselect-all" class="wfm-btn wfm-btn-sm" style="flex:1;font-size:10px;">None</button>
|
||||
</div>
|
||||
<div id="wfm-ckpt-list" class="wfm-ckpt-dropdown-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wfm-ckpt-batch-info" style="font-size:11px;color:var(--wfm-text-secondary);"></div>
|
||||
<div id="wfm-ckpt-batch-progress" style="margin-top:8px;display:none;">
|
||||
<div id="wfm-ckpt-batch-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>
|
||||
@@ -631,7 +695,8 @@
|
||||
<button class="wfm-pm-tab" data-pmtab="groups">Groups</button>
|
||||
</div>
|
||||
<div class="wfm-pm-search">
|
||||
<input type="text" id="wfm-pm-search-input" class="wfm-input" placeholder="Search presets...">
|
||||
<input type="text" id="wfm-pm-search-input" class="wfm-input" placeholder="Search presets..." style="flex:1;min-width:0;">
|
||||
<button id="wfm-pm-batch-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all batch presets" style="flex-shrink:0;">BC</button>
|
||||
</div>
|
||||
<div id="wfm-pm-list" class="wfm-pm-list"></div>
|
||||
</div>
|
||||
@@ -821,7 +886,7 @@
|
||||
<ul>
|
||||
<li id="wfm-help-gen-1">Connect/disconnect ComfyUI and check connection status</li>
|
||||
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported)</li>
|
||||
<li id="wfm-help-gen-3">4-tab layout — Input (Prompt + Image), Model, Settings, Feeder — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
|
||||
<li id="wfm-help-gen-3">5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
|
||||
<li id="wfm-help-gen-4">Input tab: Prompt (top) and Image drag-and-drop (bottom) in the left column</li>
|
||||
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder selectors with filter</li>
|
||||
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
|
||||
@@ -829,7 +894,10 @@
|
||||
<li id="wfm-help-gen-8">Seed control: random, fixed, increment, decrement — seed input and mode selector stacked vertically for readability</li>
|
||||
<li id="wfm-help-gen-9">Generate, progress display, stop, and view results</li>
|
||||
<li id="wfm-help-gen-10">Eagle integration: auto-save generated images to Eagle</li>
|
||||
<li id="wfm-help-gen-11">Checkpoint Batch: select checkpoints by folder from the dropdown — check a folder to select all its files, or expand with ▶ to check individual files; use Filter to search; Pause/Resume suspends and continues between models; Stop aborts after the current generation</li>
|
||||
<li id="wfm-help-gen-11">Checkpoint Batch toggle (right panel): enable/disable batch mode — when enabled, Generate runs through all queued checkpoints sequentially with Pause/Resume and Stop controls</li>
|
||||
<li id="wfm-help-gen-12">Batch tab — 3-pane layout: Left pane (file tree) selects checkpoints by folder; use Filter to narrow the list, All/None buttons to select or clear all; initial state is all unchecked</li>
|
||||
<li id="wfm-help-gen-13">Batch tab — Center pane: group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint tab shows groups defined in the Models tab — check a group header to select all its members, or expand ▶ to check individual models; group membership always reflects the current Models tab state</li>
|
||||
<li id="wfm-help-gen-14">Batch tab — Right pane (Batch Queue): live preview of all checkpoints that will be processed, combining file-tree and group selections with duplicates removed; count shown at top</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -890,6 +958,8 @@
|
||||
<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>
|
||||
|
||||
@@ -935,7 +1005,7 @@
|
||||
<li id="wfm-help-models-8">GenUI Model button: apply the selected model to the corresponding node in GenerateUI's current workflow (Checkpoint / LoRA / VAE / ControlNet / UNET / TextEncoder)</li>
|
||||
<li id="wfm-help-models-9">User-defined badges: assign free-label badges with custom colors shared with the Workflow tab</li>
|
||||
<li id="wfm-help-models-10">Enable/Disable models: toggle visibility in ComfyUI by renaming file extension (.disabled suffix). Disable per model (⏸ button on each card) or per group (Enable All / Disable All in Group panel). Changes take effect after ComfyUI refresh.</li>
|
||||
<li id="wfm-help-models-11">Multi-select & bulk operations: click Select to enter selection mode, check multiple models, then use the bulk action bar to add/remove from groups or permanently delete files (model file + preview images + sidecar files such as .json/.info).</li>
|
||||
<li id="wfm-help-models-11">Multi-select & 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>
|
||||
|
||||
@@ -957,6 +1027,18 @@
|
||||
<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>
|
||||
|
||||
@@ -1138,6 +1220,113 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- AI Tab -->
|
||||
<section id="wfm-tab-ai" class="wfm-tab-content">
|
||||
<!-- Translation pane -->
|
||||
<div class="wfm-ai-pane wfm-ai-pane-translate">
|
||||
<div class="wfm-ai-pane-header">Translation</div>
|
||||
<div class="wfm-ai-trans-container">
|
||||
<div class="wfm-ai-trans-lang-row">
|
||||
<select id="wfm-ai-src-lang" class="wfm-select wfm-ai-lang-select">
|
||||
<option value="ja">Japanese</option>
|
||||
<option value="en">English</option>
|
||||
<option value="zh">Chinese</option>
|
||||
<option value="free">Free</option>
|
||||
</select>
|
||||
<button id="wfm-ai-trans-swap-btn" class="wfm-btn wfm-ai-swap-btn" title="Swap languages">⇄</button>
|
||||
<select id="wfm-ai-dst-lang" class="wfm-select wfm-ai-lang-select">
|
||||
<option value="en">English</option>
|
||||
<option value="ja">Japanese</option>
|
||||
<option value="zh">Chinese</option>
|
||||
<option value="free">Free</option>
|
||||
</select>
|
||||
</div>
|
||||
<textarea id="wfm-ai-trans-input" class="wfm-ai-trans-textarea" placeholder="Enter text to translate..."></textarea>
|
||||
<div class="wfm-ai-trans-actions">
|
||||
<button id="wfm-ai-trans-btn" class="wfm-btn wfm-btn-primary">Translate</button>
|
||||
<button id="wfm-ai-trans-copy-btn" class="wfm-btn">Copy</button>
|
||||
<span id="wfm-ai-trans-status" class="wfm-ai-trans-status"></span>
|
||||
</div>
|
||||
<textarea id="wfm-ai-trans-output" class="wfm-ai-trans-textarea wfm-ai-trans-output" placeholder="Translation result..." readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-ai-pane-divider"></div>
|
||||
<!-- TOOLS pane -->
|
||||
<div class="wfm-ai-pane wfm-ai-pane-tools">
|
||||
<div class="wfm-ai-pane-header">TOOLS</div>
|
||||
<div class="wfm-ai-vlm-container">
|
||||
<div class="wfm-ai-vlm-drop" id="wfm-ai-vlm-drop">
|
||||
<img id="wfm-ai-vlm-preview" style="display:none;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none;">
|
||||
<span id="wfm-ai-vlm-label" class="wfm-ai-vlm-label">Drop or click PNG / JPG / WebP</span>
|
||||
<input type="file" id="wfm-ai-vlm-file" accept="image/png,image/jpeg,image/webp" style="display:none;">
|
||||
</div>
|
||||
<div class="wfm-ai-vlm-task-row">
|
||||
<select id="wfm-ai-vlm-task" class="wfm-select">
|
||||
<option value="describe">Describe image</option>
|
||||
<option value="prompt">Create prompt</option>
|
||||
<option value="tags">Create tags</option>
|
||||
</select>
|
||||
<button id="wfm-ai-vlm-run" class="wfm-btn wfm-btn-primary">Run</button>
|
||||
</div>
|
||||
<span id="wfm-ai-vlm-status" class="wfm-ai-trans-status"></span>
|
||||
<textarea id="wfm-ai-vlm-result" class="wfm-ai-vlm-result" placeholder="Result..." readonly></textarea>
|
||||
<button id="wfm-ai-vlm-copy" class="wfm-btn wfm-ai-vlm-copy-btn">Copy</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-ai-pane-divider"></div>
|
||||
<!-- Settings pane -->
|
||||
<div class="wfm-ai-pane wfm-ai-pane-settings">
|
||||
<div class="wfm-ai-pane-header">Settings</div>
|
||||
<div class="wfm-ai-settings-container">
|
||||
<div class="wfm-ai-settings-section">
|
||||
<div class="wfm-ai-settings-title" id="wfm-ai-settings-backend-title">Backend</div>
|
||||
<div class="wfm-ai-backend-row">
|
||||
<label class="wfm-ai-radio-label">
|
||||
<input type="radio" name="wfm-ai-backend" value="ollama" checked> Ollama
|
||||
</label>
|
||||
<label class="wfm-ai-radio-label">
|
||||
<input type="radio" name="wfm-ai-backend" value="lmstudio"> LM Studio
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-ai-settings-section">
|
||||
<div class="wfm-ai-settings-title" id="wfm-ai-settings-conn-title">Connection</div>
|
||||
<div class="wfm-ai-settings-row">
|
||||
<label class="wfm-ai-label">URL</label>
|
||||
<input type="text" id="wfm-ai-backend-url" class="wfm-input wfm-ai-url-input" value="http://localhost:11434">
|
||||
</div>
|
||||
<div class="wfm-ai-settings-row">
|
||||
<button id="wfm-ai-test-btn" class="wfm-btn">Test connection</button>
|
||||
<span id="wfm-ai-test-result" class="wfm-ai-test-result"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-ai-settings-section">
|
||||
<div class="wfm-ai-settings-title" id="wfm-ai-settings-model-title">Model</div>
|
||||
<div class="wfm-ai-settings-row">
|
||||
<select id="wfm-ai-model-select" class="wfm-select wfm-ai-model-select">
|
||||
<option value="">-- Select model --</option>
|
||||
</select>
|
||||
<button id="wfm-ai-model-refresh-btn" class="wfm-btn">Refresh</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-ai-settings-section">
|
||||
<div class="wfm-ai-settings-title" id="wfm-ai-settings-freelang-title">Free language</div>
|
||||
<div class="wfm-ai-settings-row">
|
||||
<label class="wfm-ai-label" id="wfm-ai-free-src-label">Source</label>
|
||||
<input type="text" id="wfm-ai-free-src-lang" class="wfm-input" placeholder="e.g. French">
|
||||
</div>
|
||||
<div class="wfm-ai-settings-row">
|
||||
<label class="wfm-ai-label" id="wfm-ai-free-dst-label">Target</label>
|
||||
<input type="text" id="wfm-ai-free-dst-lang" class="wfm-input" placeholder="e.g. German">
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-ai-settings-section">
|
||||
<button id="wfm-ai-settings-save-btn" class="wfm-btn wfm-btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Workflow Detail Modal -->
|
||||
|
||||
@@ -58,6 +58,8 @@ const state = {
|
||||
// Info (Metadata) tab
|
||||
infoSubTab: "info-model", // "info-model" | "info-lora" | "info-prompt"
|
||||
infoMeta: null, // parsed metadata from dropped file
|
||||
// AI tab
|
||||
aiSubTab: "ai-translate", // "ai-translate" | "ai-vlm" | "ai-settings"
|
||||
};
|
||||
|
||||
// ============================================
|
||||
@@ -693,6 +695,7 @@ const createPanel = () => {
|
||||
<button class="wfm-nlp-tab wfm-nlp-top-tab" data-toptab="prompts" title="Prompts">P</button>
|
||||
<button class="wfm-nlp-tab wfm-nlp-top-tab" data-toptab="models" title="Models">M</button>
|
||||
<button class="wfm-nlp-tab wfm-nlp-top-tab" data-toptab="info" title="Information (Metadata)">I</button>
|
||||
<button class="wfm-nlp-tab wfm-nlp-top-tab" data-toptab="ai" title="AI Tools (Translation)">A</button>
|
||||
</div>
|
||||
<div class="wfm-nlp-subtabs"></div>
|
||||
<div class="wfm-nlp-subtabs wfm-nlp-subtabs-row2"></div>
|
||||
@@ -715,7 +718,7 @@ const createPanel = () => {
|
||||
const searchInput = panel.querySelector(".wfm-nlp-search-input");
|
||||
if (searchInput) {
|
||||
searchInput.value = "";
|
||||
const placeholders = { workflows: "Search workflows...", nodes: "Search nodes...", prompts: "Search prompts...", models: "Search models...", info: "" };
|
||||
const placeholders = { workflows: "Search workflows...", nodes: "Search nodes...", prompts: "Search prompts...", models: "Search models...", info: "", ai: "" };
|
||||
searchInput.placeholder = placeholders[tab] ?? "Search...";
|
||||
}
|
||||
panel.querySelectorAll(".wfm-nlp-top-tab").forEach(b => b.classList.remove("active"));
|
||||
@@ -804,7 +807,27 @@ const rebuildSubTabs = () => {
|
||||
row2.querySelectorAll(".wfm-nlp-sub-tab").forEach(b => b.classList.remove("active"));
|
||||
};
|
||||
|
||||
if (state.topTab === "info") {
|
||||
if (state.topTab === "ai") {
|
||||
const row1Tabs = [
|
||||
{ key: "ai-translate", label: "Translation" },
|
||||
{ key: "ai-vlm", label: "TOOLS" },
|
||||
{ key: "ai-settings", label: "Settings" },
|
||||
];
|
||||
const activeKey = state.aiSubTab;
|
||||
for (const t of row1Tabs) {
|
||||
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.aiSubTab = t.key;
|
||||
updateAllActive();
|
||||
btn.classList.add("active");
|
||||
renderAiSubContent();
|
||||
});
|
||||
row1.appendChild(btn);
|
||||
}
|
||||
} else if (state.topTab === "info") {
|
||||
const row1Tabs = [
|
||||
{ key: "info-model", label: "model" },
|
||||
{ key: "info-lora", label: "lora" },
|
||||
@@ -980,7 +1003,7 @@ const renderContent = () => {
|
||||
// Remove filter dropdowns from previous category/package views
|
||||
panelEl.querySelectorAll(".wfm-nlp-filter-row").forEach(e => e.remove());
|
||||
|
||||
// Show/hide search bar and adjust overflow for info tab
|
||||
// Show/hide search bar and adjust overflow for info/ai tab
|
||||
const searchEl = panelEl?.querySelector(".wfm-nlp-search");
|
||||
if (state.topTab === "info") {
|
||||
if (searchEl) searchEl.style.display = "none";
|
||||
@@ -988,6 +1011,12 @@ const renderContent = () => {
|
||||
content.style.padding = "0";
|
||||
renderInfoTab(content);
|
||||
return;
|
||||
} else if (state.topTab === "ai") {
|
||||
if (searchEl) searchEl.style.display = "none";
|
||||
content.style.overflowY = "hidden";
|
||||
content.style.padding = "0";
|
||||
renderAiTab(content);
|
||||
return;
|
||||
} else {
|
||||
if (searchEl) searchEl.style.display = "";
|
||||
content.style.overflowY = "auto";
|
||||
@@ -2726,6 +2755,425 @@ const renderInfoTab = (container) => {
|
||||
renderInfoSubContent();
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// AI Tab
|
||||
// ============================================
|
||||
|
||||
const AI_SETTINGS_KEY = "wfm_ai_settings";
|
||||
const AI_LANG_NAMES = { ja: "Japanese", en: "English", zh: "Chinese" };
|
||||
|
||||
function isValidAiUrl(url) {
|
||||
try {
|
||||
const u = new URL(url);
|
||||
return u.protocol === "http:" || u.protocol === "https:";
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function loadAiCfg() {
|
||||
try { return JSON.parse(localStorage.getItem(AI_SETTINGS_KEY) || "{}"); } catch { return {}; }
|
||||
}
|
||||
function saveAiCfg(patch) {
|
||||
const d = { ...loadAiCfg(), ...patch };
|
||||
localStorage.setItem(AI_SETTINGS_KEY, JSON.stringify(d));
|
||||
return d;
|
||||
}
|
||||
|
||||
async function aiCallLLM(url, backend, model, prompt) {
|
||||
if (backend === "ollama") {
|
||||
const r = await fetch(`${url}/api/generate`, {
|
||||
method: "POST", headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ model, prompt, stream: false }),
|
||||
});
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
return (await r.json()).response || "";
|
||||
} else {
|
||||
const r = await fetch(`${url}/v1/chat/completions`, {
|
||||
method: "POST", headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ model, messages: [{ role: "user", content: prompt }], stream: false }),
|
||||
});
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
const d = await r.json();
|
||||
return d.choices?.[0]?.message?.content || "";
|
||||
}
|
||||
}
|
||||
|
||||
function aiFileToBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = e => {
|
||||
const b64 = e.target.result.split(",")[1];
|
||||
resolve({ base64: b64, mimeType: file.type });
|
||||
};
|
||||
reader.onerror = reject;
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
async function aiCallVLM(url, backend, model, prompt, base64Image, mimeType) {
|
||||
if (backend === "ollama") {
|
||||
const r = await fetch(`${url}/api/generate`, {
|
||||
method: "POST", headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ model, prompt, images: [base64Image], stream: false }),
|
||||
});
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
return (await r.json()).response || "";
|
||||
} else {
|
||||
const r = await fetch(`${url}/v1/chat/completions`, {
|
||||
method: "POST", headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
model,
|
||||
messages: [{ role: "user", content: [
|
||||
{ type: "text", text: prompt },
|
||||
{ type: "image_url", image_url: { url: `data:${mimeType};base64,${base64Image}` } },
|
||||
]}],
|
||||
stream: false,
|
||||
}),
|
||||
});
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
return (await r.json()).choices?.[0]?.message?.content || "";
|
||||
}
|
||||
}
|
||||
|
||||
async function aiFetchModels(url, backend) {
|
||||
if (backend === "ollama") {
|
||||
const r = await fetch(`${url}/api/tags`);
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
return ((await r.json()).models || []).map(m => m.name);
|
||||
} else {
|
||||
const r = await fetch(`${url}/v1/models`);
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
return ((await r.json()).data || []).map(m => m.id);
|
||||
}
|
||||
}
|
||||
|
||||
const renderAiTab = (container) => {
|
||||
if (!container.querySelector(".wfm-nlp-ai-layout")) {
|
||||
container.innerHTML = `
|
||||
<div class="wfm-nlp-ai-layout">
|
||||
<!-- Translation sub -->
|
||||
<div id="wfm-nlp-ai-translate" class="wfm-nlp-ai-pane">
|
||||
<div class="wfm-nlp-ai-lang-row">
|
||||
<select id="wfm-nlp-ai-src" class="wfm-nlp-ai-sel">
|
||||
<option value="ja">Japanese</option>
|
||||
<option value="en">English</option>
|
||||
<option value="zh">Chinese</option>
|
||||
<option value="free">Free</option>
|
||||
</select>
|
||||
<button id="wfm-nlp-ai-swap" class="wfm-nlp-ai-swap" title="Swap">⇄</button>
|
||||
<select id="wfm-nlp-ai-dst" class="wfm-nlp-ai-sel">
|
||||
<option value="en">English</option>
|
||||
<option value="ja">Japanese</option>
|
||||
<option value="zh">Chinese</option>
|
||||
<option value="free">Free</option>
|
||||
</select>
|
||||
</div>
|
||||
<textarea id="wfm-nlp-ai-input" class="wfm-nlp-ai-textarea" placeholder="Enter text to translate..."></textarea>
|
||||
<div class="wfm-nlp-ai-actions">
|
||||
<button id="wfm-nlp-ai-trans-btn" class="wfm-nlp-ai-btn wfm-nlp-ai-btn-primary">Translate</button>
|
||||
<button id="wfm-nlp-ai-copy-btn" class="wfm-nlp-ai-btn">Copy</button>
|
||||
<span id="wfm-nlp-ai-status" class="wfm-nlp-ai-status"></span>
|
||||
</div>
|
||||
<textarea id="wfm-nlp-ai-output" class="wfm-nlp-ai-textarea wfm-nlp-ai-output" placeholder="Translation result..." readonly></textarea>
|
||||
</div>
|
||||
<!-- TOOLS sub -->
|
||||
<div id="wfm-nlp-ai-vlm" class="wfm-nlp-ai-pane" style="display:none;">
|
||||
<div class="wfm-nlp-ai-vlm-drop" id="wfm-nlp-ai-vlm-drop">
|
||||
<img id="wfm-nlp-ai-vlm-preview" style="display:none;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none;">
|
||||
<span id="wfm-nlp-ai-vlm-label" class="wfm-nlp-ai-vlm-label">Drop PNG / JPG / WebP</span>
|
||||
<input type="file" id="wfm-nlp-ai-vlm-file" accept="image/png,image/jpeg,image/webp" style="display:none;">
|
||||
</div>
|
||||
<div class="wfm-nlp-ai-row">
|
||||
<select id="wfm-nlp-ai-vlm-task" class="wfm-nlp-ai-sel" style="flex:1;">
|
||||
<option value="describe">Describe image</option>
|
||||
<option value="prompt">Create prompt</option>
|
||||
<option value="tags">Create tags</option>
|
||||
</select>
|
||||
<button id="wfm-nlp-ai-vlm-run" class="wfm-nlp-ai-btn wfm-nlp-ai-btn-primary">Run</button>
|
||||
</div>
|
||||
<span id="wfm-nlp-ai-vlm-status" class="wfm-nlp-ai-status"></span>
|
||||
<textarea id="wfm-nlp-ai-vlm-result" class="wfm-nlp-ai-textarea wfm-nlp-ai-output" style="flex:1;min-height:60px;" placeholder="Result..." readonly></textarea>
|
||||
<button id="wfm-nlp-ai-vlm-copy" class="wfm-nlp-ai-btn" style="align-self:flex-end;">Copy</button>
|
||||
</div>
|
||||
<!-- Settings sub -->
|
||||
<div id="wfm-nlp-ai-settings" class="wfm-nlp-ai-pane wfm-nlp-ai-settings-pane" style="display:none;">
|
||||
<div class="wfm-nlp-ai-sec">
|
||||
<div class="wfm-nlp-ai-sec-title">Backend</div>
|
||||
<div class="wfm-nlp-ai-radio-row">
|
||||
<label class="wfm-nlp-ai-radio"><input type="radio" name="wfm-nlp-ai-backend" value="ollama"> Ollama</label>
|
||||
<label class="wfm-nlp-ai-radio"><input type="radio" name="wfm-nlp-ai-backend" value="lmstudio"> LM Studio</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-nlp-ai-sec">
|
||||
<div class="wfm-nlp-ai-sec-title">Connection</div>
|
||||
<input type="text" id="wfm-nlp-ai-url" class="wfm-nlp-ai-input" placeholder="http://localhost:11434">
|
||||
<div class="wfm-nlp-ai-row">
|
||||
<button id="wfm-nlp-ai-test" class="wfm-nlp-ai-btn">Test connection</button>
|
||||
<span id="wfm-nlp-ai-test-result" class="wfm-nlp-ai-status"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-nlp-ai-sec">
|
||||
<div class="wfm-nlp-ai-sec-title">Model</div>
|
||||
<div class="wfm-nlp-ai-row">
|
||||
<select id="wfm-nlp-ai-model" class="wfm-nlp-ai-sel" style="flex:1;">
|
||||
<option value="">-- Select model --</option>
|
||||
</select>
|
||||
<button id="wfm-nlp-ai-model-refresh" class="wfm-nlp-ai-btn">↻</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-nlp-ai-sec">
|
||||
<div class="wfm-nlp-ai-sec-title">Free language</div>
|
||||
<div class="wfm-nlp-ai-row">
|
||||
<span class="wfm-nlp-ai-lbl">Source</span>
|
||||
<input type="text" id="wfm-nlp-ai-free-src" class="wfm-nlp-ai-input" placeholder="e.g. French" style="flex:1;">
|
||||
</div>
|
||||
<div class="wfm-nlp-ai-row">
|
||||
<span class="wfm-nlp-ai-lbl">Target</span>
|
||||
<input type="text" id="wfm-nlp-ai-free-dst" class="wfm-nlp-ai-input" placeholder="e.g. German" style="flex:1;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="wfm-nlp-ai-sec">
|
||||
<button id="wfm-nlp-ai-save" class="wfm-nlp-ai-btn wfm-nlp-ai-btn-primary" style="width:100%;">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
setupAiHandlers(container);
|
||||
}
|
||||
renderAiSubContent();
|
||||
};
|
||||
|
||||
const renderAiSubContent = () => {
|
||||
if (!panelEl) return;
|
||||
const panes = { "ai-translate": "wfm-nlp-ai-translate", "ai-vlm": "wfm-nlp-ai-vlm", "ai-settings": "wfm-nlp-ai-settings" };
|
||||
for (const [key, id] of Object.entries(panes)) {
|
||||
const el = panelEl.querySelector(`#${id}`);
|
||||
if (el) el.style.display = state.aiSubTab === key ? "flex" : "none";
|
||||
}
|
||||
};
|
||||
|
||||
const setupAiHandlers = (container) => {
|
||||
const cfg = loadAiCfg();
|
||||
|
||||
// Restore settings
|
||||
const backendRadios = container.querySelectorAll("input[name='wfm-nlp-ai-backend']");
|
||||
backendRadios.forEach(r => { if (r.value === (cfg.backend || "ollama")) r.checked = true; });
|
||||
const urlInput = container.querySelector("#wfm-nlp-ai-url");
|
||||
if (urlInput && cfg.backendUrl) urlInput.value = cfg.backendUrl;
|
||||
else if (urlInput) urlInput.value = "http://localhost:11434";
|
||||
|
||||
const freeSrcInput = container.querySelector("#wfm-nlp-ai-free-src");
|
||||
const freeDstInput = container.querySelector("#wfm-nlp-ai-free-dst");
|
||||
if (freeSrcInput && cfg.freeSrcLang) freeSrcInput.value = cfg.freeSrcLang;
|
||||
if (freeDstInput && cfg.freeDstLang) freeDstInput.value = cfg.freeDstLang;
|
||||
|
||||
const srcSel = container.querySelector("#wfm-nlp-ai-src");
|
||||
const dstSel = container.querySelector("#wfm-nlp-ai-dst");
|
||||
if (srcSel && cfg.srcLang) srcSel.value = cfg.srcLang;
|
||||
if (dstSel && cfg.dstLang) dstSel.value = cfg.dstLang;
|
||||
|
||||
// Swap
|
||||
container.querySelector("#wfm-nlp-ai-swap")?.addEventListener("click", () => {
|
||||
const tmp = srcSel.value; srcSel.value = dstSel.value; dstSel.value = tmp;
|
||||
const inputEl = container.querySelector("#wfm-nlp-ai-input");
|
||||
const outputEl = container.querySelector("#wfm-nlp-ai-output");
|
||||
const tmpTxt = inputEl.value; inputEl.value = outputEl.value; outputEl.value = tmpTxt;
|
||||
saveAiCfg({ srcLang: srcSel.value, dstLang: dstSel.value });
|
||||
});
|
||||
|
||||
srcSel?.addEventListener("change", () => saveAiCfg({ srcLang: srcSel.value }));
|
||||
dstSel?.addEventListener("change", () => saveAiCfg({ dstLang: dstSel.value }));
|
||||
|
||||
// Translate
|
||||
container.querySelector("#wfm-nlp-ai-trans-btn")?.addEventListener("click", async () => {
|
||||
const text = container.querySelector("#wfm-nlp-ai-input")?.value?.trim();
|
||||
if (!text) { showToast("テキストを入力してください", "error"); return; }
|
||||
|
||||
const c = loadAiCfg();
|
||||
const backend = c.backend || "ollama";
|
||||
const url = c.backendUrl || (backend === "ollama" ? "http://localhost:11434" : "http://localhost:1234");
|
||||
const model = c.model;
|
||||
if (!isValidAiUrl(url)) { showToast("URLは http:// または https:// で始まる必要があります", "error"); return; }
|
||||
if (!model) { showToast("Please select a model in Settings", "error"); return; }
|
||||
|
||||
const srcLang = srcSel?.value || "ja";
|
||||
const dstLang = dstSel?.value || "en";
|
||||
const srcName = srcLang === "free" ? (c.freeSrcLang || "Auto") : AI_LANG_NAMES[srcLang];
|
||||
const dstName = dstLang === "free" ? (c.freeDstLang || "English") : AI_LANG_NAMES[dstLang];
|
||||
const fromPart = srcLang === "free" ? "" : `from ${srcName} `;
|
||||
const prompt = `Translate the following text ${fromPart}to ${dstName}. Output only the translated text, nothing else.\n\n${text}`;
|
||||
|
||||
const transBtn = container.querySelector("#wfm-nlp-ai-trans-btn");
|
||||
const statusEl = container.querySelector("#wfm-nlp-ai-status");
|
||||
const outputEl = container.querySelector("#wfm-nlp-ai-output");
|
||||
transBtn.disabled = true;
|
||||
statusEl.textContent = "Translating...";
|
||||
statusEl.className = "wfm-nlp-ai-status wfm-nlp-ai-working";
|
||||
outputEl.value = "";
|
||||
|
||||
try {
|
||||
const result = await aiCallLLM(url, backend, model, prompt);
|
||||
outputEl.value = result.trim();
|
||||
statusEl.textContent = "完了";
|
||||
statusEl.className = "wfm-nlp-ai-status wfm-nlp-ai-ok";
|
||||
} catch (err) {
|
||||
statusEl.textContent = `エラー: ${err.message}`;
|
||||
statusEl.className = "wfm-nlp-ai-status wfm-nlp-ai-err";
|
||||
} finally {
|
||||
transBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Copy
|
||||
container.querySelector("#wfm-nlp-ai-copy-btn")?.addEventListener("click", () => {
|
||||
const text = container.querySelector("#wfm-nlp-ai-output")?.value;
|
||||
if (!text) { showToast("No text to copy", "error"); return; }
|
||||
navigator.clipboard.writeText(text).then(() => showToast("Copied", "success"));
|
||||
});
|
||||
|
||||
// Model refresh helper
|
||||
const refreshModels = async () => {
|
||||
const c = loadAiCfg();
|
||||
const backend = container.querySelector("input[name='wfm-nlp-ai-backend']:checked")?.value || "ollama";
|
||||
const url = container.querySelector("#wfm-nlp-ai-url")?.value?.trim() || "";
|
||||
const modelSel = container.querySelector("#wfm-nlp-ai-model");
|
||||
try {
|
||||
const models = await aiFetchModels(url, backend);
|
||||
modelSel.innerHTML = '<option value="">-- Select model --</option>';
|
||||
models.forEach(name => {
|
||||
const opt = document.createElement("option");
|
||||
opt.value = name; opt.textContent = name;
|
||||
if (name === c.model) opt.selected = true;
|
||||
modelSel.appendChild(opt);
|
||||
});
|
||||
if (!models.length) showToast("No models found", "error");
|
||||
} catch (err) {
|
||||
showToast("Failed to fetch models: " + err.message, "error");
|
||||
}
|
||||
};
|
||||
|
||||
// Connection test
|
||||
container.querySelector("#wfm-nlp-ai-test")?.addEventListener("click", async () => {
|
||||
const testBtn = container.querySelector("#wfm-nlp-ai-test");
|
||||
const resultEl = container.querySelector("#wfm-nlp-ai-test-result");
|
||||
const backend = container.querySelector("input[name='wfm-nlp-ai-backend']:checked")?.value || "ollama";
|
||||
const url = container.querySelector("#wfm-nlp-ai-url")?.value?.trim() || "";
|
||||
if (!isValidAiUrl(url)) {
|
||||
resultEl.textContent = "http:// または https:// で始まるURLを入力してください";
|
||||
resultEl.className = "wfm-nlp-ai-status wfm-nlp-ai-err";
|
||||
return;
|
||||
}
|
||||
testBtn.disabled = true;
|
||||
resultEl.textContent = "Connecting...";
|
||||
resultEl.className = "wfm-nlp-ai-status wfm-nlp-ai-working";
|
||||
try {
|
||||
const models = await aiFetchModels(url, backend);
|
||||
resultEl.textContent = `OK (${models.length} models)`;
|
||||
resultEl.className = "wfm-nlp-ai-status wfm-nlp-ai-ok";
|
||||
await refreshModels();
|
||||
} catch (err) {
|
||||
resultEl.textContent = `失敗: ${err.message}`;
|
||||
resultEl.className = "wfm-nlp-ai-status wfm-nlp-ai-err";
|
||||
} finally {
|
||||
testBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Model refresh button
|
||||
container.querySelector("#wfm-nlp-ai-model-refresh")?.addEventListener("click", () => refreshModels());
|
||||
|
||||
// Save settings
|
||||
container.querySelector("#wfm-nlp-ai-save")?.addEventListener("click", () => {
|
||||
const backend = container.querySelector("input[name='wfm-nlp-ai-backend']:checked")?.value || "ollama";
|
||||
const url = container.querySelector("#wfm-nlp-ai-url")?.value?.trim() || "";
|
||||
const model = container.querySelector("#wfm-nlp-ai-model")?.value || "";
|
||||
const freeSrcLang = container.querySelector("#wfm-nlp-ai-free-src")?.value?.trim() || "";
|
||||
const freeDstLang = container.querySelector("#wfm-nlp-ai-free-dst")?.value?.trim() || "";
|
||||
if (url && !isValidAiUrl(url)) {
|
||||
showToast("URLは http:// または https:// で始まる必要があります", "error");
|
||||
return;
|
||||
}
|
||||
saveAiCfg({ backend, backendUrl: url, model, freeSrcLang, freeDstLang });
|
||||
showToast("Settings saved", "success");
|
||||
});
|
||||
|
||||
// Auto-load models if settings exist
|
||||
if (cfg.backendUrl && cfg.backend) refreshModels().catch(() => {});
|
||||
|
||||
// ---- VLM handlers ----
|
||||
let vlmImage = null; // { base64, mimeType }
|
||||
|
||||
const vlmDrop = container.querySelector("#wfm-nlp-ai-vlm-drop");
|
||||
const vlmPreview = container.querySelector("#wfm-nlp-ai-vlm-preview");
|
||||
const vlmLabel = container.querySelector("#wfm-nlp-ai-vlm-label");
|
||||
const vlmFile = container.querySelector("#wfm-nlp-ai-vlm-file");
|
||||
const vlmRunBtn = container.querySelector("#wfm-nlp-ai-vlm-run");
|
||||
const vlmStatus = container.querySelector("#wfm-nlp-ai-vlm-status");
|
||||
const vlmResult = container.querySelector("#wfm-nlp-ai-vlm-result");
|
||||
const vlmCopy = container.querySelector("#wfm-nlp-ai-vlm-copy");
|
||||
|
||||
const loadVlmImage = async (file) => {
|
||||
if (!file || !file.type.startsWith("image/")) return;
|
||||
const data = await aiFileToBase64(file);
|
||||
vlmImage = data;
|
||||
vlmPreview.src = `data:${data.mimeType};base64,${data.base64}`;
|
||||
vlmPreview.style.display = "block";
|
||||
vlmLabel.style.display = "none";
|
||||
};
|
||||
|
||||
vlmDrop?.addEventListener("click", () => vlmFile?.click());
|
||||
vlmFile?.addEventListener("change", e => { if (e.target.files[0]) loadVlmImage(e.target.files[0]); });
|
||||
vlmDrop?.addEventListener("dragover", e => { e.preventDefault(); vlmDrop.classList.add("drag-over"); });
|
||||
vlmDrop?.addEventListener("dragleave", () => vlmDrop.classList.remove("drag-over"));
|
||||
vlmDrop?.addEventListener("drop", e => {
|
||||
e.preventDefault();
|
||||
vlmDrop.classList.remove("drag-over");
|
||||
const file = e.dataTransfer.files[0];
|
||||
if (file) loadVlmImage(file);
|
||||
});
|
||||
|
||||
const VLM_PROMPTS = {
|
||||
describe: "Describe this image in detail.",
|
||||
prompt: "Create a detailed Stable Diffusion image generation prompt based on this image. Output only the prompt text, nothing else.",
|
||||
tags: "Generate a list of descriptive tags for this image. Output only comma-separated tags in English, nothing else.",
|
||||
};
|
||||
|
||||
vlmRunBtn?.addEventListener("click", async () => {
|
||||
if (!vlmImage) { showToast("Please drop an image", "error"); return; }
|
||||
const c = loadAiCfg();
|
||||
const backend = c.backend || "ollama";
|
||||
const url = c.backendUrl || (backend === "ollama" ? "http://localhost:11434" : "http://localhost:1234");
|
||||
const model = c.model;
|
||||
if (!isValidAiUrl(url)) { showToast("URLは http:// または https:// で始まる必要があります", "error"); return; }
|
||||
if (!model) { showToast("Please select a model in Settings", "error"); return; }
|
||||
|
||||
const task = container.querySelector("#wfm-nlp-ai-vlm-task")?.value || "describe";
|
||||
vlmRunBtn.disabled = true;
|
||||
vlmStatus.textContent = "Running...";
|
||||
vlmStatus.className = "wfm-nlp-ai-status wfm-nlp-ai-working";
|
||||
vlmResult.value = "";
|
||||
|
||||
try {
|
||||
const result = await aiCallVLM(url, backend, model, VLM_PROMPTS[task], vlmImage.base64, vlmImage.mimeType);
|
||||
vlmResult.value = result.trim();
|
||||
vlmStatus.textContent = "完了";
|
||||
vlmStatus.className = "wfm-nlp-ai-status wfm-nlp-ai-ok";
|
||||
} catch (err) {
|
||||
vlmStatus.textContent = `エラー: ${err.message}`;
|
||||
vlmStatus.className = "wfm-nlp-ai-status wfm-nlp-ai-err";
|
||||
} finally {
|
||||
vlmRunBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
vlmCopy?.addEventListener("click", () => {
|
||||
const text = vlmResult?.value;
|
||||
if (!text) { showToast("No text to copy", "error"); return; }
|
||||
navigator.clipboard.writeText(text).then(() => showToast("Copied", "success"));
|
||||
});
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// Save selected nodes as Node Set (context menu)
|
||||
// ============================================
|
||||
@@ -3371,6 +3819,192 @@ const injectStyles = () => {
|
||||
color: var(--descrip-text, #aaa);
|
||||
}
|
||||
.wfm-nlp-theme-reset-btn:hover { color: var(--input-text, #ddd); }
|
||||
/* AI Tab */
|
||||
.wfm-nlp-ai-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wfm-nlp-ai-pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
gap: 6px;
|
||||
padding: 8px;
|
||||
}
|
||||
.wfm-nlp-ai-settings-pane {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.wfm-nlp-ai-lang-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wfm-nlp-ai-sel {
|
||||
flex: 1;
|
||||
padding: 4px 6px;
|
||||
background: var(--comfy-input-bg, #2a2a2a);
|
||||
border: 1px solid var(--border-color, #4e4e4e);
|
||||
border-radius: 3px;
|
||||
color: var(--input-text, #ddd);
|
||||
font-size: 11px;
|
||||
outline: none;
|
||||
}
|
||||
.wfm-nlp-ai-swap {
|
||||
flex-shrink: 0;
|
||||
padding: 4px 6px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.wfm-nlp-ai-textarea {
|
||||
flex: 1;
|
||||
min-height: 80px;
|
||||
padding: 6px 8px;
|
||||
background: var(--comfy-input-bg, #2a2a2a);
|
||||
border: 1px solid var(--border-color, #4e4e4e);
|
||||
border-radius: 3px;
|
||||
color: var(--input-text, #ddd);
|
||||
font-size: 11px;
|
||||
font-family: inherit;
|
||||
resize: none;
|
||||
outline: none;
|
||||
line-height: 1.5;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wfm-nlp-ai-textarea:focus {
|
||||
border-color: var(--p-button-background, #4a9eff);
|
||||
}
|
||||
.wfm-nlp-ai-output {
|
||||
background: var(--comfy-menu-bg, #1e1e1e);
|
||||
color: var(--descrip-text, #aaa);
|
||||
}
|
||||
.wfm-nlp-ai-output:focus { border-color: var(--border-color, #4e4e4e); }
|
||||
.wfm-nlp-ai-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wfm-nlp-ai-status {
|
||||
font-size: 10px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wfm-nlp-ai-working { color: var(--wfm-warning, #ffa502); }
|
||||
.wfm-nlp-ai-ok { color: #2ed573; }
|
||||
.wfm-nlp-ai-err { color: #ff4757; }
|
||||
.wfm-nlp-ai-btn {
|
||||
padding: 4px 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
border: 1px solid var(--border-color, #555);
|
||||
border-radius: 3px;
|
||||
background: none;
|
||||
color: var(--descrip-text, #aaa);
|
||||
transition: background 0.15s, color 0.15s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wfm-nlp-ai-btn:hover {
|
||||
background: rgba(74,158,255,0.2);
|
||||
color: #4a9eff;
|
||||
border-color: #4a9eff;
|
||||
}
|
||||
.wfm-nlp-ai-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
.wfm-nlp-ai-btn-primary {
|
||||
background: var(--p-button-background, #4a9eff);
|
||||
color: #fff;
|
||||
border-color: var(--p-button-background, #4a9eff);
|
||||
}
|
||||
.wfm-nlp-ai-btn-primary:hover { background: #3a8eef; border-color: #3a8eef; color: #fff; }
|
||||
.wfm-nlp-ai-coming {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 11px;
|
||||
color: var(--descrip-text, #888);
|
||||
text-align: center;
|
||||
padding: 16px;
|
||||
}
|
||||
.wfm-nlp-ai-sec {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid var(--border-color, #3a3a3a);
|
||||
}
|
||||
.wfm-nlp-ai-sec:last-child { border-bottom: none; }
|
||||
.wfm-nlp-ai-sec-title {
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
color: var(--descrip-text, #888);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
.wfm-nlp-ai-radio-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
.wfm-nlp-ai-radio {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 11px;
|
||||
color: var(--input-text, #ddd);
|
||||
cursor: pointer;
|
||||
}
|
||||
.wfm-nlp-ai-input {
|
||||
padding: 5px 8px;
|
||||
background: var(--comfy-input-bg, #2a2a2a);
|
||||
border: 1px solid var(--border-color, #4e4e4e);
|
||||
border-radius: 3px;
|
||||
color: var(--input-text, #ddd);
|
||||
font-size: 11px;
|
||||
outline: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wfm-nlp-ai-input:focus { border-color: var(--p-button-background, #4a9eff); }
|
||||
.wfm-nlp-ai-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.wfm-nlp-ai-lbl {
|
||||
font-size: 10px;
|
||||
color: var(--descrip-text, #888);
|
||||
white-space: nowrap;
|
||||
width: 28px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
/* VLM drop zone */
|
||||
.wfm-nlp-ai-vlm-drop {
|
||||
height: 110px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 2px dashed var(--border-color, #4e4e4e);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
transition: border-color 0.15s, background 0.15s;
|
||||
position: relative;
|
||||
}
|
||||
.wfm-nlp-ai-vlm-drop:hover,
|
||||
.wfm-nlp-ai-vlm-drop.drag-over {
|
||||
border-color: var(--p-button-background, #4a9eff);
|
||||
background: rgba(74,158,255,0.04);
|
||||
}
|
||||
.wfm-nlp-ai-vlm-label {
|
||||
font-size: 11px;
|
||||
color: var(--descrip-text, #999);
|
||||
pointer-events: none;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
};
|
||||
|
||||
|
After Width: | Height: | Size: 192 KiB |
|
After Width: | Height: | Size: 758 KiB |
|
After Width: | Height: | Size: 246 KiB |
|
After Width: | Height: | Size: 316 KiB |
@@ -0,0 +1,599 @@
|
||||
{
|
||||
"id": "f11699d9-4b62-47bd-b501-e49d609d9810",
|
||||
"revision": 0,
|
||||
"last_node_id": 10,
|
||||
"last_link_id": 10,
|
||||
"nodes": [
|
||||
{
|
||||
"id": 7,
|
||||
"type": "CLIPTextEncode",
|
||||
"pos": [
|
||||
413,
|
||||
389
|
||||
],
|
||||
"size": [
|
||||
425.27801513671875,
|
||||
180.6060791015625
|
||||
],
|
||||
"flags": {},
|
||||
"order": 4,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 5
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "CONDITIONING",
|
||||
"name": "CONDITIONING",
|
||||
"type": "CONDITIONING",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
6
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CLIPTextEncode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"text, watermark"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "KSampler",
|
||||
"pos": [
|
||||
863,
|
||||
186
|
||||
],
|
||||
"size": [
|
||||
315,
|
||||
474
|
||||
],
|
||||
"flags": {},
|
||||
"order": 5,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "model",
|
||||
"name": "model",
|
||||
"type": "MODEL",
|
||||
"link": 1
|
||||
},
|
||||
{
|
||||
"localized_name": "positive",
|
||||
"name": "positive",
|
||||
"type": "CONDITIONING",
|
||||
"link": 4
|
||||
},
|
||||
{
|
||||
"localized_name": "negative",
|
||||
"name": "negative",
|
||||
"type": "CONDITIONING",
|
||||
"link": 6
|
||||
},
|
||||
{
|
||||
"localized_name": "latent_image",
|
||||
"name": "latent_image",
|
||||
"type": "LATENT",
|
||||
"link": 2
|
||||
},
|
||||
{
|
||||
"localized_name": "seed",
|
||||
"name": "seed",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "seed"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "steps",
|
||||
"name": "steps",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "steps"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "cfg",
|
||||
"name": "cfg",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "cfg"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "sampler_name",
|
||||
"name": "sampler_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "sampler_name"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "scheduler",
|
||||
"name": "scheduler",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "scheduler"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "denoise",
|
||||
"name": "denoise",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "denoise"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
7
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "KSampler",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
378124453179007,
|
||||
"randomize",
|
||||
20,
|
||||
8,
|
||||
"euler",
|
||||
"normal",
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"type": "VAEDecode",
|
||||
"pos": [
|
||||
1209,
|
||||
188
|
||||
],
|
||||
"size": [
|
||||
210,
|
||||
46
|
||||
],
|
||||
"flags": {},
|
||||
"order": 6,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "samples",
|
||||
"name": "samples",
|
||||
"type": "LATENT",
|
||||
"link": 7
|
||||
},
|
||||
{
|
||||
"localized_name": "vae",
|
||||
"name": "vae",
|
||||
"type": "VAE",
|
||||
"link": 10
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "IMAGE",
|
||||
"name": "IMAGE",
|
||||
"type": "IMAGE",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
9
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "VAEDecode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": []
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"type": "SaveImage",
|
||||
"pos": [
|
||||
1451,
|
||||
189
|
||||
],
|
||||
"size": [
|
||||
210,
|
||||
270
|
||||
],
|
||||
"flags": {},
|
||||
"order": 7,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "images",
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"link": 9
|
||||
},
|
||||
{
|
||||
"localized_name": "filename_prefix",
|
||||
"name": "filename_prefix",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "filename_prefix"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"properties": {
|
||||
"Node name for S&R": "SaveImage",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"ComfyUI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "EmptyLatentImage",
|
||||
"pos": [
|
||||
473,
|
||||
609
|
||||
],
|
||||
"size": [
|
||||
315,
|
||||
106
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "width",
|
||||
"name": "width",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "width"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "height",
|
||||
"name": "height",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "height"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "batch_size",
|
||||
"name": "batch_size",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "batch_size"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "EmptyLatentImage",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
1024,
|
||||
1024,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "CheckpointLoaderSimple",
|
||||
"pos": [
|
||||
51.3,
|
||||
182.49999999999997
|
||||
],
|
||||
"size": [
|
||||
315,
|
||||
98
|
||||
],
|
||||
"flags": {},
|
||||
"order": 1,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "ckpt_name",
|
||||
"name": "ckpt_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "ckpt_name"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "MODEL",
|
||||
"name": "MODEL",
|
||||
"type": "MODEL",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "CLIP",
|
||||
"name": "CLIP",
|
||||
"type": "CLIP",
|
||||
"slot_index": 1,
|
||||
"links": [
|
||||
3,
|
||||
5
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "VAE",
|
||||
"name": "VAE",
|
||||
"type": "VAE",
|
||||
"slot_index": 2,
|
||||
"links": []
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CheckpointLoaderSimple",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"v1-5-pruned-emaonly-fp16.safetensors"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"type": "VAELoader",
|
||||
"pos": [
|
||||
61.897062649999256,
|
||||
347.8818042399999
|
||||
],
|
||||
"size": [
|
||||
270,
|
||||
58
|
||||
],
|
||||
"flags": {},
|
||||
"order": 2,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "vae_name",
|
||||
"name": "vae_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "vae_name"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "VAE",
|
||||
"name": "VAE",
|
||||
"type": "VAE",
|
||||
"links": [
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "VAELoader"
|
||||
},
|
||||
"widgets_values": [
|
||||
"vae-ft-mse-840000-ema-pruned.safetensors"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"type": "CLIPTextEncode",
|
||||
"pos": [
|
||||
415,
|
||||
186
|
||||
],
|
||||
"size": [
|
||||
422.84503173828125,
|
||||
164.31304931640625
|
||||
],
|
||||
"flags": {},
|
||||
"order": 3,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 3
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "CONDITIONING",
|
||||
"name": "CONDITIONING",
|
||||
"type": "CONDITIONING",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
4
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CLIPTextEncode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"flower"
|
||||
]
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
[
|
||||
1,
|
||||
4,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
"MODEL"
|
||||
],
|
||||
[
|
||||
2,
|
||||
5,
|
||||
0,
|
||||
3,
|
||||
3,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
3,
|
||||
4,
|
||||
1,
|
||||
6,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
4,
|
||||
6,
|
||||
0,
|
||||
3,
|
||||
1,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
5,
|
||||
4,
|
||||
1,
|
||||
7,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
6,
|
||||
7,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
7,
|
||||
3,
|
||||
0,
|
||||
8,
|
||||
0,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
9,
|
||||
8,
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
10,
|
||||
10,
|
||||
0,
|
||||
8,
|
||||
1,
|
||||
"VAE"
|
||||
]
|
||||
],
|
||||
"groups": [],
|
||||
"config": {},
|
||||
"extra": {
|
||||
"ds": {
|
||||
"offset": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"scale": 1
|
||||
},
|
||||
"ue_links": [],
|
||||
"links_added_by_ue": []
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 309 KiB |
|
After Width: | Height: | Size: 741 KiB |
|
After Width: | Height: | Size: 303 KiB |
@@ -0,0 +1,887 @@
|
||||
{
|
||||
"id": "831a2929-0536-4715-a530-72a8b91c00fd",
|
||||
"revision": 0,
|
||||
"last_node_id": 13,
|
||||
"last_link_id": 21,
|
||||
"nodes": [
|
||||
{
|
||||
"id": 12,
|
||||
"type": "CLIPTextEncodeEditPlus",
|
||||
"pos": [
|
||||
1364.9859298350216,
|
||||
-408.28982585532515
|
||||
],
|
||||
"size": [
|
||||
300,
|
||||
257
|
||||
],
|
||||
"flags": {},
|
||||
"order": 4,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 16
|
||||
},
|
||||
{
|
||||
"localized_name": "text1",
|
||||
"name": "text1",
|
||||
"type": "STRING",
|
||||
"link": 18
|
||||
},
|
||||
{
|
||||
"localized_name": "text2",
|
||||
"name": "text2",
|
||||
"shape": 7,
|
||||
"type": "STRING",
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "text_edit",
|
||||
"name": "text_edit",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text_edit"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "mode",
|
||||
"name": "mode",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "mode"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "conditioning",
|
||||
"name": "conditioning",
|
||||
"type": "CONDITIONING",
|
||||
"links": [
|
||||
17
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"links": [
|
||||
21
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "CLIPTextEncodeEditPlus"
|
||||
},
|
||||
"widgets_values": [
|
||||
"blue flower",
|
||||
"+af",
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "KSampler",
|
||||
"pos": [
|
||||
1742.6139298350226,
|
||||
-576.3158258553248
|
||||
],
|
||||
"size": [
|
||||
315,
|
||||
474
|
||||
],
|
||||
"flags": {},
|
||||
"order": 5,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "model",
|
||||
"name": "model",
|
||||
"type": "MODEL",
|
||||
"link": 15
|
||||
},
|
||||
{
|
||||
"localized_name": "positive",
|
||||
"name": "positive",
|
||||
"type": "CONDITIONING",
|
||||
"link": 17
|
||||
},
|
||||
{
|
||||
"localized_name": "negative",
|
||||
"name": "negative",
|
||||
"type": "CONDITIONING",
|
||||
"link": 5
|
||||
},
|
||||
{
|
||||
"localized_name": "latent_image",
|
||||
"name": "latent_image",
|
||||
"type": "LATENT",
|
||||
"link": 6
|
||||
},
|
||||
{
|
||||
"localized_name": "seed",
|
||||
"name": "seed",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "seed"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "steps",
|
||||
"name": "steps",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "steps"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "cfg",
|
||||
"name": "cfg",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "cfg"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "sampler_name",
|
||||
"name": "sampler_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "sampler_name"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "scheduler",
|
||||
"name": "scheduler",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "scheduler"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "denoise",
|
||||
"name": "denoise",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "denoise"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
7
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "KSampler"
|
||||
},
|
||||
"widgets_values": [
|
||||
1018108390999488,
|
||||
"randomize",
|
||||
20,
|
||||
8,
|
||||
"euler",
|
||||
"normal",
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "VAEDecode",
|
||||
"pos": [
|
||||
2086.446929835019,
|
||||
-568.6398258553247
|
||||
],
|
||||
"size": [
|
||||
210,
|
||||
46
|
||||
],
|
||||
"flags": {},
|
||||
"order": 7,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "samples",
|
||||
"name": "samples",
|
||||
"type": "LATENT",
|
||||
"link": 7
|
||||
},
|
||||
{
|
||||
"localized_name": "vae",
|
||||
"name": "vae",
|
||||
"type": "VAE",
|
||||
"link": 20
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "IMAGE",
|
||||
"name": "IMAGE",
|
||||
"type": "IMAGE",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
12
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "VAEDecode"
|
||||
},
|
||||
"widgets_values": []
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"type": "SaveImage",
|
||||
"pos": [
|
||||
2326.33789983502,
|
||||
-566.7928258553247
|
||||
],
|
||||
"size": [
|
||||
210,
|
||||
270
|
||||
],
|
||||
"flags": {},
|
||||
"order": 8,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "images",
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"link": 12
|
||||
},
|
||||
{
|
||||
"localized_name": "filename_prefix",
|
||||
"name": "filename_prefix",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "filename_prefix"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "SaveImage"
|
||||
},
|
||||
"widgets_values": [
|
||||
"ComfyUI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"type": "ShowText|pysssss",
|
||||
"pos": [
|
||||
1363.0960298350246,
|
||||
-578.3718258553248
|
||||
],
|
||||
"size": [
|
||||
305.77,
|
||||
111.08999999999992
|
||||
],
|
||||
"flags": {},
|
||||
"order": 6,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"link": 21
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "STRING",
|
||||
"name": "STRING",
|
||||
"shape": 6,
|
||||
"type": "STRING",
|
||||
"links": null
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "ShowText|pysssss"
|
||||
},
|
||||
"widgets_values": [
|
||||
"girl,sentai,sentai,flower petal,full body,long hair,long legs,white boots and white gloves,<lora:9_Toshikazu:0.4> Toshikazu,<lora:9_Iggym:0.3> Iggym, painterly, realistic, sketch, traditional media, \\(medium\\)\n<lora:9_Landuo941:0.3> Landuo941\n<lora:Manga122:0.2>,<lora:MayuMurataIllustrious:0.3> Mayu Murata\n<lora:9_Navybluesparrow:0.4> Navybluesparrow\n<lora:9_RiyokoIkeda:0.2> Riyoko Ikeda\n<lora:9_ShumiiberryAlt:0.2> Shumiiberry,\n<lora:Shuiyuan:0.2> 5huny4n_5ty13 \n<lora:test_mix:0.2>,,blue flower"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "EmptyLatentImage",
|
||||
"pos": [
|
||||
992.022929835024,
|
||||
79.15817414467442
|
||||
],
|
||||
"size": [
|
||||
271.44000000000005,
|
||||
106
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "width",
|
||||
"name": "width",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "width"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "height",
|
||||
"name": "height",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "height"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "batch_size",
|
||||
"name": "batch_size",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "batch_size"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
6
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "EmptyLatentImage"
|
||||
},
|
||||
"widgets_values": [
|
||||
1024,
|
||||
1024,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"type": "ImageMetadataLoRALoader",
|
||||
"pos": [
|
||||
987.5885798350228,
|
||||
-582.1963058553249
|
||||
],
|
||||
"size": [
|
||||
286,
|
||||
565
|
||||
],
|
||||
"flags": {},
|
||||
"order": 2,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "model",
|
||||
"name": "model",
|
||||
"type": "MODEL",
|
||||
"link": 1
|
||||
},
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 2
|
||||
},
|
||||
{
|
||||
"localized_name": "metadata",
|
||||
"name": "metadata",
|
||||
"shape": 7,
|
||||
"type": "METADATA",
|
||||
"link": 3
|
||||
},
|
||||
{
|
||||
"localized_name": "lora_1",
|
||||
"name": "lora_1",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "lora_1"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "strength_model_1",
|
||||
"name": "strength_model_1",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "strength_model_1"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "strength_clip_1",
|
||||
"name": "strength_clip_1",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "strength_clip_1"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "lora_2",
|
||||
"name": "lora_2",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "lora_2"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "strength_model_2",
|
||||
"name": "strength_model_2",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "strength_model_2"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "strength_clip_2",
|
||||
"name": "strength_clip_2",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "strength_clip_2"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "lora_3",
|
||||
"name": "lora_3",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "lora_3"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "strength_model_3",
|
||||
"name": "strength_model_3",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "strength_model_3"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "strength_clip_3",
|
||||
"name": "strength_clip_3",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "strength_clip_3"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "model",
|
||||
"name": "model",
|
||||
"type": "MODEL",
|
||||
"links": [
|
||||
15
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"links": [
|
||||
14,
|
||||
16
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "ImageMetadataLoRALoader",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"temp\\Manga122.safetensors",
|
||||
0.2,
|
||||
0.2,
|
||||
"temp\\MayuMurataIllustrious.safetensors",
|
||||
0.3,
|
||||
0.3,
|
||||
"temp\\Shuiyuan.safetensors",
|
||||
0.2,
|
||||
0.2,
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": "ImageMetadataPromptLoader",
|
||||
"pos": [
|
||||
626.8189298350237,
|
||||
-586.5118258553252
|
||||
],
|
||||
"size": [
|
||||
286,
|
||||
709
|
||||
],
|
||||
"flags": {},
|
||||
"order": 1,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "ckpt_name",
|
||||
"name": "ckpt_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "ckpt_name"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "vae_name",
|
||||
"name": "vae_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "vae_name"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "positive_text",
|
||||
"name": "positive_text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "positive_text"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "negative_text",
|
||||
"name": "negative_text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "negative_text"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "_metadata_json",
|
||||
"name": "_metadata_json",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "_metadata_json"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "model",
|
||||
"name": "model",
|
||||
"type": "MODEL",
|
||||
"links": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"links": [
|
||||
2
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "vae",
|
||||
"name": "vae",
|
||||
"type": "VAE",
|
||||
"links": [
|
||||
20
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "positive",
|
||||
"name": "positive",
|
||||
"type": "CONDITIONING",
|
||||
"links": null
|
||||
},
|
||||
{
|
||||
"localized_name": "negative",
|
||||
"name": "negative",
|
||||
"type": "CONDITIONING",
|
||||
"links": null
|
||||
},
|
||||
{
|
||||
"localized_name": "positive_text",
|
||||
"name": "positive_text",
|
||||
"type": "STRING",
|
||||
"links": [
|
||||
18
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "negative_text",
|
||||
"name": "negative_text",
|
||||
"type": "STRING",
|
||||
"links": []
|
||||
},
|
||||
{
|
||||
"localized_name": "metadata",
|
||||
"name": "metadata",
|
||||
"type": "METADATA",
|
||||
"links": [
|
||||
3
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "ImageMetadataPromptLoader",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"anime\\CHEYENNE_v24HyperIllustration.safetensors",
|
||||
"SDXL-VAE-FP16-Fix.safetensors",
|
||||
"girl,sentai,sentai,flower petal,full body,long hair,long legs,white boots and white gloves,<lora:9_Toshikazu:0.4> Toshikazu,<lora:9_Iggym:0.3> Iggym, painterly, realistic, sketch, traditional media, \\(medium\\)\n<lora:9_Landuo941:0.3> Landuo941\n<lora:Manga122:0.2>,<lora:MayuMurataIllustrious:0.3> Mayu Murata\n<lora:9_Navybluesparrow:0.4> Navybluesparrow\n<lora:9_RiyokoIkeda:0.2> Riyoko Ikeda\n<lora:9_ShumiiberryAlt:0.2> Shumiiberry,\n<lora:Shuiyuan:0.2> 5huny4n_5ty13 \n<lora:test_mix:0.2>,",
|
||||
"helmet,mask",
|
||||
"{\"loras\":[{\"name\":\"9_Toshikazu\",\"strength_model\":0.4,\"strength_clip\":0.4},{\"name\":\"9_Iggym\",\"strength_model\":0.3,\"strength_clip\":0.3},{\"name\":\"9_Landuo941\",\"strength_model\":0.3,\"strength_clip\":0.3},{\"name\":\"Manga122\",\"strength_model\":0.2,\"strength_clip\":0.2},{\"name\":\"MayuMurataIllustrious\",\"strength_model\":0.3,\"strength_clip\":0.3},{\"name\":\"9_Navybluesparrow\",\"strength_model\":0.4,\"strength_clip\":0.4},{\"name\":\"9_RiyokoIkeda\",\"strength_model\":0.2,\"strength_clip\":0.2},{\"name\":\"9_ShumiiberryAlt\",\"strength_model\":0.2,\"strength_clip\":0.2},{\"name\":\"Shuiyuan\",\"strength_model\":0.2,\"strength_clip\":0.2},{\"name\":\"test_mix\",\"strength_model\":0.2,\"strength_clip\":0.2}]}",
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"type": "CLIPTextEncode",
|
||||
"pos": [
|
||||
1360.6159298350235,
|
||||
-96.8748258553254
|
||||
],
|
||||
"size": [
|
||||
301.4950151367186,
|
||||
88
|
||||
],
|
||||
"flags": {},
|
||||
"order": 3,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 14
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "CONDITIONING",
|
||||
"name": "CONDITIONING",
|
||||
"type": "CONDITIONING",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
5
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "CLIPTextEncode"
|
||||
},
|
||||
"widgets_values": [
|
||||
""
|
||||
]
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
[
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
"MODEL"
|
||||
],
|
||||
[
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
3,
|
||||
2,
|
||||
7,
|
||||
1,
|
||||
2,
|
||||
"METADATA"
|
||||
],
|
||||
[
|
||||
5,
|
||||
10,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
6,
|
||||
5,
|
||||
0,
|
||||
3,
|
||||
3,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
7,
|
||||
3,
|
||||
0,
|
||||
4,
|
||||
0,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
12,
|
||||
4,
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
14,
|
||||
1,
|
||||
1,
|
||||
10,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
15,
|
||||
1,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
"MODEL"
|
||||
],
|
||||
[
|
||||
16,
|
||||
1,
|
||||
1,
|
||||
12,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
17,
|
||||
12,
|
||||
0,
|
||||
3,
|
||||
1,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
18,
|
||||
2,
|
||||
5,
|
||||
12,
|
||||
1,
|
||||
"STRING"
|
||||
],
|
||||
[
|
||||
20,
|
||||
2,
|
||||
2,
|
||||
4,
|
||||
1,
|
||||
"VAE"
|
||||
],
|
||||
[
|
||||
21,
|
||||
12,
|
||||
1,
|
||||
13,
|
||||
0,
|
||||
"STRING"
|
||||
]
|
||||
],
|
||||
"groups": [],
|
||||
"config": {},
|
||||
"extra": {
|
||||
"ue_links": [],
|
||||
"links_added_by_ue": []
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
|
After Width: | Height: | Size: 287 KiB |
|
After Width: | Height: | Size: 510 KiB |
@@ -0,0 +1,719 @@
|
||||
{
|
||||
"id": "03047124-7d5d-4eb4-b458-558d6dec9b5e",
|
||||
"revision": 0,
|
||||
"last_node_id": 28,
|
||||
"last_link_id": 50,
|
||||
"nodes": [
|
||||
{
|
||||
"id": 8,
|
||||
"type": "VAEEncode",
|
||||
"pos": [
|
||||
551.8454158175873,
|
||||
-685.9812381649755
|
||||
],
|
||||
"size": [
|
||||
242.296875,
|
||||
96
|
||||
],
|
||||
"flags": {},
|
||||
"order": 5,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "pixels",
|
||||
"name": "pixels",
|
||||
"type": "IMAGE",
|
||||
"link": 49
|
||||
},
|
||||
{
|
||||
"localized_name": "vae",
|
||||
"name": "vae",
|
||||
"type": "VAE",
|
||||
"link": 34
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"links": [
|
||||
5
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "VAEEncode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": []
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"type": "VAELoader",
|
||||
"pos": [
|
||||
75.4452850000009,
|
||||
-464.22850100000056
|
||||
],
|
||||
"size": [
|
||||
270,
|
||||
58
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "vae_name",
|
||||
"name": "vae_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "vae_name"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "VAE",
|
||||
"name": "VAE",
|
||||
"type": "VAE",
|
||||
"links": [
|
||||
34,
|
||||
35
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "VAELoader",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"SDXL-VAE-FP16-Fix.safetensors"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "VAEDecode",
|
||||
"pos": [
|
||||
1312.282348239462,
|
||||
-683.1137137997414
|
||||
],
|
||||
"size": [
|
||||
254.390625,
|
||||
96
|
||||
],
|
||||
"flags": {},
|
||||
"order": 7,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "samples",
|
||||
"name": "samples",
|
||||
"type": "LATENT",
|
||||
"link": 11
|
||||
},
|
||||
{
|
||||
"localized_name": "vae",
|
||||
"name": "vae",
|
||||
"type": "VAE",
|
||||
"link": 35
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "IMAGE",
|
||||
"name": "IMAGE",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
50
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "VAEDecode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": []
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"type": "KSampler",
|
||||
"pos": [
|
||||
1000.0439480441502,
|
||||
-674.780789922787
|
||||
],
|
||||
"size": [
|
||||
270,
|
||||
589.3125
|
||||
],
|
||||
"flags": {},
|
||||
"order": 6,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "model",
|
||||
"name": "model",
|
||||
"type": "MODEL",
|
||||
"link": 36
|
||||
},
|
||||
{
|
||||
"localized_name": "positive",
|
||||
"name": "positive",
|
||||
"type": "CONDITIONING",
|
||||
"link": 37
|
||||
},
|
||||
{
|
||||
"localized_name": "negative",
|
||||
"name": "negative",
|
||||
"type": "CONDITIONING",
|
||||
"link": 10
|
||||
},
|
||||
{
|
||||
"localized_name": "latent_image",
|
||||
"name": "latent_image",
|
||||
"type": "LATENT",
|
||||
"link": 5
|
||||
},
|
||||
{
|
||||
"localized_name": "seed",
|
||||
"name": "seed",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "seed"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "steps",
|
||||
"name": "steps",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "steps"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "cfg",
|
||||
"name": "cfg",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "cfg"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "sampler_name",
|
||||
"name": "sampler_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "sampler_name"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "scheduler",
|
||||
"name": "scheduler",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "scheduler"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "denoise",
|
||||
"name": "denoise",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "denoise"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"links": [
|
||||
11
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "KSampler",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
240074286219855,
|
||||
"randomize",
|
||||
30,
|
||||
8,
|
||||
"euler",
|
||||
"karras",
|
||||
0.7
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 24,
|
||||
"type": "CLIPTextEncode",
|
||||
"pos": [
|
||||
528.6156850000002,
|
||||
-509.49460100000033
|
||||
],
|
||||
"size": [
|
||||
400,
|
||||
200
|
||||
],
|
||||
"flags": {},
|
||||
"order": 4,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 38
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "CONDITIONING",
|
||||
"name": "CONDITIONING",
|
||||
"type": "CONDITIONING",
|
||||
"links": [
|
||||
37
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CLIPTextEncode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"flower,anime girl"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"type": "CLIPTextEncode",
|
||||
"pos": [
|
||||
526.8870184488446,
|
||||
-252.08752270664039
|
||||
],
|
||||
"size": [
|
||||
400,
|
||||
200
|
||||
],
|
||||
"flags": {
|
||||
"collapsed": false
|
||||
},
|
||||
"order": 3,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 9
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "CONDITIONING",
|
||||
"name": "CONDITIONING",
|
||||
"type": "CONDITIONING",
|
||||
"links": [
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CLIPTextEncode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"type": "CheckpointLoaderSimple",
|
||||
"pos": [
|
||||
70.30033916275676,
|
||||
-694.6312926669282
|
||||
],
|
||||
"size": [
|
||||
270,
|
||||
154.65625
|
||||
],
|
||||
"flags": {},
|
||||
"order": 1,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "ckpt_name",
|
||||
"name": "ckpt_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "ckpt_name"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "MODEL",
|
||||
"name": "MODEL",
|
||||
"type": "MODEL",
|
||||
"links": [
|
||||
36
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "CLIP",
|
||||
"name": "CLIP",
|
||||
"type": "CLIP",
|
||||
"links": [
|
||||
9,
|
||||
38
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "VAE",
|
||||
"name": "VAE",
|
||||
"type": "VAE",
|
||||
"links": []
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CheckpointLoaderSimple",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"anime\\IllustriousStyle_v22.safetensors"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
"type": "ImageFeeder",
|
||||
"pos": [
|
||||
76.77559983502367,
|
||||
-338.79391585532534
|
||||
],
|
||||
"size": [
|
||||
253.923,
|
||||
319.923
|
||||
],
|
||||
"flags": {},
|
||||
"order": 2,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "directory",
|
||||
"name": "directory",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "directory"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "sort_mode",
|
||||
"name": "sort_mode",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "sort_mode"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "index",
|
||||
"name": "index",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "index"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "start_index",
|
||||
"name": "start_index",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "start_index"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "end_index",
|
||||
"name": "end_index",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "end_index"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "batch_size",
|
||||
"name": "batch_size",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "batch_size"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "seed",
|
||||
"name": "seed",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "seed"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "use_selection",
|
||||
"name": "use_selection",
|
||||
"type": "BOOLEAN",
|
||||
"widget": {
|
||||
"name": "use_selection"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "selected_files",
|
||||
"name": "selected_files",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "selected_files"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "IMAGE",
|
||||
"name": "IMAGE",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
49
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "ImageFeeder"
|
||||
},
|
||||
"widgets_values": [
|
||||
"test",
|
||||
"ascending",
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
908906407258686,
|
||||
"randomize",
|
||||
true,
|
||||
"[\"00030-2656222951.png\",\"00063-2334831609.png\",\"02121-3711614362.png\"]",
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "PreviewImage",
|
||||
"pos": [
|
||||
1603.3762031816507,
|
||||
-693.7018206825535
|
||||
],
|
||||
"size": [
|
||||
284.5062499999997,
|
||||
301.77375000000023
|
||||
],
|
||||
"flags": {},
|
||||
"order": 8,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "images",
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"link": 50
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"properties": {
|
||||
"Node name for S&R": "PreviewImage",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {},
|
||||
"version": "7.8"
|
||||
}
|
||||
},
|
||||
"widgets_values": []
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
[
|
||||
5,
|
||||
8,
|
||||
0,
|
||||
7,
|
||||
3,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
9,
|
||||
9,
|
||||
1,
|
||||
11,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
10,
|
||||
11,
|
||||
0,
|
||||
7,
|
||||
2,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
11,
|
||||
7,
|
||||
0,
|
||||
5,
|
||||
0,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
34,
|
||||
22,
|
||||
0,
|
||||
8,
|
||||
1,
|
||||
"VAE"
|
||||
],
|
||||
[
|
||||
35,
|
||||
22,
|
||||
0,
|
||||
5,
|
||||
1,
|
||||
"VAE"
|
||||
],
|
||||
[
|
||||
36,
|
||||
9,
|
||||
0,
|
||||
7,
|
||||
0,
|
||||
"MODEL"
|
||||
],
|
||||
[
|
||||
37,
|
||||
24,
|
||||
0,
|
||||
7,
|
||||
1,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
38,
|
||||
9,
|
||||
1,
|
||||
24,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
49,
|
||||
28,
|
||||
0,
|
||||
8,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
50,
|
||||
5,
|
||||
0,
|
||||
4,
|
||||
0,
|
||||
"IMAGE"
|
||||
]
|
||||
],
|
||||
"groups": [],
|
||||
"config": {},
|
||||
"extra": {
|
||||
"ue_links": [],
|
||||
"links_added_by_ue": [],
|
||||
"linearData": {
|
||||
"inputs": [
|
||||
[
|
||||
"9",
|
||||
"ckpt_name"
|
||||
],
|
||||
[
|
||||
"3",
|
||||
"pose_editor_3d_widget"
|
||||
],
|
||||
[
|
||||
"3",
|
||||
"timer_interval"
|
||||
]
|
||||
],
|
||||
"outputs": []
|
||||
}
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
|
After Width: | Height: | Size: 258 KiB |
@@ -0,0 +1,599 @@
|
||||
{
|
||||
"id": "f11699d9-4b62-47bd-b501-e49d609d9810",
|
||||
"revision": 0,
|
||||
"last_node_id": 10,
|
||||
"last_link_id": 10,
|
||||
"nodes": [
|
||||
{
|
||||
"id": 7,
|
||||
"type": "CLIPTextEncode",
|
||||
"pos": [
|
||||
413,
|
||||
389
|
||||
],
|
||||
"size": [
|
||||
425.27801513671875,
|
||||
180.6060791015625
|
||||
],
|
||||
"flags": {},
|
||||
"order": 4,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 5
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "CONDITIONING",
|
||||
"name": "CONDITIONING",
|
||||
"type": "CONDITIONING",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
6
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CLIPTextEncode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"text, watermark"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "KSampler",
|
||||
"pos": [
|
||||
863,
|
||||
186
|
||||
],
|
||||
"size": [
|
||||
315,
|
||||
474
|
||||
],
|
||||
"flags": {},
|
||||
"order": 5,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "model",
|
||||
"name": "model",
|
||||
"type": "MODEL",
|
||||
"link": 1
|
||||
},
|
||||
{
|
||||
"localized_name": "positive",
|
||||
"name": "positive",
|
||||
"type": "CONDITIONING",
|
||||
"link": 4
|
||||
},
|
||||
{
|
||||
"localized_name": "negative",
|
||||
"name": "negative",
|
||||
"type": "CONDITIONING",
|
||||
"link": 6
|
||||
},
|
||||
{
|
||||
"localized_name": "latent_image",
|
||||
"name": "latent_image",
|
||||
"type": "LATENT",
|
||||
"link": 2
|
||||
},
|
||||
{
|
||||
"localized_name": "seed",
|
||||
"name": "seed",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "seed"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "steps",
|
||||
"name": "steps",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "steps"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "cfg",
|
||||
"name": "cfg",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "cfg"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "sampler_name",
|
||||
"name": "sampler_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "sampler_name"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "scheduler",
|
||||
"name": "scheduler",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "scheduler"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "denoise",
|
||||
"name": "denoise",
|
||||
"type": "FLOAT",
|
||||
"widget": {
|
||||
"name": "denoise"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
7
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "KSampler",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
636718080453780,
|
||||
"randomize",
|
||||
20,
|
||||
8,
|
||||
"euler",
|
||||
"normal",
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"type": "VAEDecode",
|
||||
"pos": [
|
||||
1209,
|
||||
188
|
||||
],
|
||||
"size": [
|
||||
210,
|
||||
46
|
||||
],
|
||||
"flags": {},
|
||||
"order": 6,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "samples",
|
||||
"name": "samples",
|
||||
"type": "LATENT",
|
||||
"link": 7
|
||||
},
|
||||
{
|
||||
"localized_name": "vae",
|
||||
"name": "vae",
|
||||
"type": "VAE",
|
||||
"link": 10
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "IMAGE",
|
||||
"name": "IMAGE",
|
||||
"type": "IMAGE",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
9
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "VAEDecode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": []
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"type": "SaveImage",
|
||||
"pos": [
|
||||
1451,
|
||||
189
|
||||
],
|
||||
"size": [
|
||||
210,
|
||||
270
|
||||
],
|
||||
"flags": {},
|
||||
"order": 7,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "images",
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"link": 9
|
||||
},
|
||||
{
|
||||
"localized_name": "filename_prefix",
|
||||
"name": "filename_prefix",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "filename_prefix"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"properties": {
|
||||
"Node name for S&R": "SaveImage",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"ComfyUI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "EmptyLatentImage",
|
||||
"pos": [
|
||||
473,
|
||||
609
|
||||
],
|
||||
"size": [
|
||||
315,
|
||||
106
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "width",
|
||||
"name": "width",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "width"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "height",
|
||||
"name": "height",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "height"
|
||||
},
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"localized_name": "batch_size",
|
||||
"name": "batch_size",
|
||||
"type": "INT",
|
||||
"widget": {
|
||||
"name": "batch_size"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "LATENT",
|
||||
"name": "LATENT",
|
||||
"type": "LATENT",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "EmptyLatentImage",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
1024,
|
||||
1024,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"type": "CLIPTextEncode",
|
||||
"pos": [
|
||||
415,
|
||||
186
|
||||
],
|
||||
"size": [
|
||||
422.84503173828125,
|
||||
164.31304931640625
|
||||
],
|
||||
"flags": {},
|
||||
"order": 3,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "clip",
|
||||
"name": "clip",
|
||||
"type": "CLIP",
|
||||
"link": 3
|
||||
},
|
||||
{
|
||||
"localized_name": "text",
|
||||
"name": "text",
|
||||
"type": "STRING",
|
||||
"widget": {
|
||||
"name": "text"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "CONDITIONING",
|
||||
"name": "CONDITIONING",
|
||||
"type": "CONDITIONING",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
4
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CLIPTextEncode",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"flower"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "CheckpointLoaderSimple",
|
||||
"pos": [
|
||||
51.3,
|
||||
182.49999999999997
|
||||
],
|
||||
"size": [
|
||||
315,
|
||||
98
|
||||
],
|
||||
"flags": {},
|
||||
"order": 1,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "ckpt_name",
|
||||
"name": "ckpt_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "ckpt_name"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "MODEL",
|
||||
"name": "MODEL",
|
||||
"type": "MODEL",
|
||||
"slot_index": 0,
|
||||
"links": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "CLIP",
|
||||
"name": "CLIP",
|
||||
"type": "CLIP",
|
||||
"slot_index": 1,
|
||||
"links": [
|
||||
3,
|
||||
5
|
||||
]
|
||||
},
|
||||
{
|
||||
"localized_name": "VAE",
|
||||
"name": "VAE",
|
||||
"type": "VAE",
|
||||
"slot_index": 2,
|
||||
"links": []
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "CheckpointLoaderSimple",
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"version": "7.8",
|
||||
"input_ue_unconnectable": {}
|
||||
}
|
||||
},
|
||||
"widgets_values": [
|
||||
"anime\\artUniverse_sdxlV60.safetensors"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"type": "VAELoader",
|
||||
"pos": [
|
||||
61.897062649999256,
|
||||
347.8818042399999
|
||||
],
|
||||
"size": [
|
||||
270,
|
||||
58
|
||||
],
|
||||
"flags": {},
|
||||
"order": 2,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"localized_name": "vae_name",
|
||||
"name": "vae_name",
|
||||
"type": "COMBO",
|
||||
"widget": {
|
||||
"name": "vae_name"
|
||||
},
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"localized_name": "VAE",
|
||||
"name": "VAE",
|
||||
"type": "VAE",
|
||||
"links": [
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"ue_properties": {
|
||||
"widget_ue_connectable": {},
|
||||
"input_ue_unconnectable": {}
|
||||
},
|
||||
"Node name for S&R": "VAELoader"
|
||||
},
|
||||
"widgets_values": [
|
||||
"sdxl_vae.safetensors"
|
||||
]
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
[
|
||||
1,
|
||||
4,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
"MODEL"
|
||||
],
|
||||
[
|
||||
2,
|
||||
5,
|
||||
0,
|
||||
3,
|
||||
3,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
3,
|
||||
4,
|
||||
1,
|
||||
6,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
4,
|
||||
6,
|
||||
0,
|
||||
3,
|
||||
1,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
5,
|
||||
4,
|
||||
1,
|
||||
7,
|
||||
0,
|
||||
"CLIP"
|
||||
],
|
||||
[
|
||||
6,
|
||||
7,
|
||||
0,
|
||||
3,
|
||||
2,
|
||||
"CONDITIONING"
|
||||
],
|
||||
[
|
||||
7,
|
||||
3,
|
||||
0,
|
||||
8,
|
||||
0,
|
||||
"LATENT"
|
||||
],
|
||||
[
|
||||
9,
|
||||
8,
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
10,
|
||||
10,
|
||||
0,
|
||||
8,
|
||||
1,
|
||||
"VAE"
|
||||
]
|
||||
],
|
||||
"groups": [],
|
||||
"config": {},
|
||||
"extra": {
|
||||
"ds": {
|
||||
"offset": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"scale": 1
|
||||
},
|
||||
"ue_links": [],
|
||||
"links_added_by_ue": []
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 411 KiB |