Compare commits

...
4 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 4.6 9fa1490d4b feat: v0.3.58 — GenerateUI Model タブ GGUF対応拡張(Diffusion Model / Text Encoder)
- Diffusion Model: LoaderGGUF / LoaderGGUFAdvanced を認識、gguf_name キーを自動選択
- Text Encoder: CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF 対応
  - 単体CLIP: clip_name + type + device(GGUF only) のUI
  - DualCLIP: clip_name1 + clip_name2 + type + device(GGUF only) の2段UI
  - type選択肢を /object_info から動的取得
- Models タブ GenUI Model ボタン: unet=gguf_name / textencoder=clip_name にも対応
- ヘルプ3点セット更新(helpGen5、helpGen17・helpGallery15・16のi18n漏れ修正含む)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 10:49:52 +09:00
ketle-manandClaude Sonnet 4.6 3a5637a4cf feat: v0.3.57 — Image Edit Blur Tool / BG Remove Tool 追加
- Blur ツール (≈): Whole Blur / Whole Mosaic(全体適用)+ Rect Blur / Rect Mosaic(矩形ドラッグ選択)
- BG Remove ツール (⬚): Lightweight @imgly(ブラウザ内処理)+ BiRefNet stub(Python backend, coming soon)
- サイドバーの Blur / BG Remove アイコンから ie-tool-placeholder を除去(白色表示)
- ヘルプに Blur Tool / BG Remove Tool カードを追加(英語・日本語・中国語 i18n 対応)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 20:27:46 +09:00
ketle-manandClaude Sonnet 4.6 be66dc3d5a feat: v0.3.56 — Style機能追加(GenerateUI ツールバー & Batchタブ)
- GenerateUI ツールバーに Style チェックボックス+ドロップダウンを追加
  - user/default/Workflow-Studio/style/*.json を自動読み込み
  - {prompt} プレースホルダー置換、negative_prompt 末尾連結
  - ワークフローコピーにのみ適用(currentWorkflow は変更しない)
- Batch左ペインに Style タブを追加(全スタイルのフラットリスト、All/None)
- Batch Queue に Style 列を追加(7列目)
- GET /api/wfm/styles エンドポイントを settings_routes.py に追加
- ヘルプ・README・DEVLOG 更新

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 19:02:44 +09:00
ketle-manandClaude Sonnet 4.6 5a3d69fe14 fix(generate-tab): Batch/Stack グループをバッチ実行UIに復元
v0.3.55 で誤って追加した RESERVED フィルターを削除。
Batch/Stack はグループ削除保護のための予約グループであり、
バッチ実行選択UIに表示され選択できることが正しい動作。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 22:56:53 +09:00
13 changed files with 1037 additions and 59 deletions
+244 -1
View File
@@ -1,5 +1,248 @@
# DEVLOG - ComfyUI-Workflow-Studio
## 2026-06-27: v0.3.58 — GenerateUI Model タブ GGUF対応拡張(Diffusion Model / Text Encoder)
**変更ファイル**: `static/js/comfyui-workflow.js`, `static/js/comfyui-client.js`, `static/js/comfyui-editor.js`, `static/js/models-tab.js`, `templates/index.html`, `static/js/i18n.js`
### 概要
GenerateUI の Model タブで、Diffusion Model セクション(UNET)と Text Encoder セクションを GGUF カスタムノードおよび CLIP バリアント全種に対応させた。
---
### Diffusion Model — GGUF 対応
#### analyzeWorkflow(`comfyui-workflow.js`)
- `LoaderGGUF` / `LoaderGGUFAdvanced` を `diffusion_model_nodes` に追加
- ノードオブジェクトに `inputKey: "gguf_name"` を明示記録(`UNETLoader` 系は `"unet_name"`)
- `_getWidgetMapping` に `LoaderGGUF: ["gguf_name"]`、`LoaderGGUFAdvanced: ["gguf_name", ...]` を追加
#### fetchDiffusionModels(`comfyui-client.js`)
- `_fetchModelList(["UNETLoader", "UnetLoaderGGUF"], "unet_name")` と `_fetchModelList(["LoaderGGUF", "LoaderGGUFAdvanced"], "gguf_name")` を `Promise.all` で並列フェッチし重複除去してマージ
#### renderModelTab / Apply(`comfyui-editor.js`)
- Apply 時にノードの `class_type` が `LoaderGGUF` / `LoaderGGUFAdvanced` であれば `inputKey` を自動的に `"gguf_name"` に切り替え
#### applyToGenUI(`models-tab.js`)
- `unet` タイプの検索キーに `"gguf_name"` を追加(`["unet_name", "gguf_name"]` 順で検索)
---
### Text Encoder — CLIPLoader / DualCLIPLoader / GGUF 対応
#### analyzeWorkflow(`comfyui-workflow.js`)
- 認識ノードに `ClipLoaderGGUF`、`DualClipLoaderGGUF` を追加
- ノードオブジェクトに `clip_type`(= `inputs.type`)、`device`(= `inputs.device`)フィールドを追加
- `_getWidgetMapping` に `ClipLoaderGGUF: ["clip_name", "type"]`、`DualClipLoaderGGUF: ["clip_name1", "clip_name2", "type"]` を追加
#### fetchTextEncoders(`comfyui-client.js`)
- `DualCLIPLoader` / `DualClipLoaderGGUF`(`clip_name1` キー)と `CLIPLoader` / `ClipLoaderGGUF`(`clip_name` キー)を並列フェッチしてマージ
#### renderModelTab(`comfyui-editor.js`)
- Text Encoder セクションを `sections` 汎用処理から分離し `#wfm-te-section` プレースホルダーに非同期初期化関数 `_initTextEncoderSection` で描画
- **単体 CLIP**(CLIPLoader / ClipLoaderGGUF): clip_name 1段 + type ドロップダウン + device(GGUF のみ)
- **Dual CLIP**(DualCLIPLoader / DualClipLoaderGGUF): clip_name1 + clip_name2 の 2 段 + type ドロップダウン + device(GGUF のみ)
- type 選択肢はノードの `/object_info` から動的取得
- フィルター入力は 1 段目(clip_name1)のみ対応
#### applyToGenUI(`models-tab.js`)
- `textencoder` タイプの検索キーに `"clip_name"` を追加(CLIPLoader 系対応)
### ヘルプ更新(3点セット)
- `templates/index.html` — `wfm-help-gen-5` 初期テキスト更新
- `static/js/i18n.js` — 英語・日本語・中国語 `helpGen5` を更新(Diffusion Model / Text Encoder の詳細ノード種別を追記)
---
## 2026-06-26: v0.3.57 — Image Edit Blur Tool / BG Remove Tool 追加
**変更ファイル**: `templates/index.html`, `static/js/image-edit-tab.js`, `static/js/app.js`, `static/js/i18n.js`
### 概要
Image Edit タブに **Blur ツール** と **BG Remove ツール** を追加。両ツールはサイドバーから選択でき、`ie-tool-placeholder` を除去してアイコンを通常の白色で表示するよう修正した。ヘルプの Blur / BG Remove セクションを新規追加し、英語・日本語・中国語の i18n に対応。
---
### Blur ツール(`static/js/image-edit-tab.js`)
#### TOOL_DEFS
- `{ id: "blur", icon: "≈", label: "Blur", ready: true }` — `ready: false` → `true` に変更
#### クラスプロパティ(constructor)
- `_blurRectMode` — アクティブな矩形モード(`"blur"` / `"mosaic"` / `null`)
- `_blurDragging`, `_blurDragStart`, `_blurDragCur` — 矩形ドラッグ状態
#### ツールオプション UI(`_renderToolOptions("blur")`)
- **Whole Blur** — 強度スライダー(1〜50 px)+ Apply ボタン
- **Whole Mosaic** — ブロックサイズスライダー(5〜100 px)+ Apply ボタン
- **Rect Blur** — トグルボタン(青色)でドラッグ矩形モードに入り、マウスアップ時に選択範囲をぼかす
- **Rect Mosaic** — トグルボタン(橙色)で同様の矩形モザイク;Rect Blur と排他
#### マウスイベント
- `_onToolMouseDown/Move/Up/Leave` に `case "blur"` を追加してドラッグ座標を追跡
- `_activateCurrentTool` — `_blurRectMode` が有効な場合はキャンバスカーソルを `crosshair` に変更
#### 新規メソッド
| メソッド | 概要 |
|---|---|
| `_applyWholeBlur(intensity)` | `ctx.filter = "blur(Xpx)"` でオフスクリーンキャンバスに描画し `layer.canvas` を更新 |
| `_applyWholeMosaic(size)` | `_applyMosaicToRegion` でレイヤーキャンバス全体をピクセル化 |
| `_canvasToLayerCoords(layer, canvasX, canvasY)` | `applyTransform` の逆変換:中心移動 → 逆回転 → スケール除算 → flip → レイヤーキャンバス座標に変換 |
| `_drawBlurPreview(start, cur)` | オーバーレイキャンバスにプレビュー矩形を描画(Blur=青、Mosaic=橙) |
| `_applyRectEffect(start, cur)` | `_canvasToLayerCoords` でレイヤー座標に変換し、ぼかし or `_applyMosaicToRegion` を適用 |
#### モジュールレベル関数
```js
function _applyMosaicToRegion(ctx, x, y, w, h, size)
```
`ImageData` のピクセルブロックを左上ピクセルの色で塗りつぶすことでモザイクを実現。
---
### BG Remove ツール(`static/js/image-edit-tab.js`)
#### TOOL_DEFS
- `{ id: "bgremove", icon: "⬚", label: "BG Remove", ready: true }` — `ready: false` → `true` に変更
#### ツールオプション UI(`_renderToolOptions("bgremove")`)
- **Model セレクト** — `lightweight` (@imgly) / `birefnet` (coming soon)
- **New Layer チェックボックス** — ON: 結果を新規レイヤーとして追加 / OFF: アクティブレイヤーを上書き
- **Remove BG ボタン** — 処理開始;ステータステキストで進捗を表示
#### 新規メソッド
| メソッド | 概要 |
|---|---|
| `_bgRemoveImgly(imageDataUrl)` | `@imgly/background-removal@1.5.7`(esm.sh CDN)を動的 `import()` で読み込み、Blob URL を返す |
| `_bgRemoveBiRefNet(imageDataUrl)` | `POST /api/wfm/bg-remove` を呼び出す stub(BiRefNet 実装予定) |
| `_applyBgRemove()` | アクティブレイヤーを PNG に変換 → モデル呼び出し → `Image` に展開 → New Layer or 上書き適用 → Undo スタックに push |
---
### サイドバーアイコン修正(`templates/index.html`)
- `blur` ボタンと `bgremove` ボタンから `ie-tool-placeholder` クラスを除去
- `filter` と `mask` は未実装のため `ie-tool-placeholder` のまま維持(opacity: 0.38)
---
### ヘルプ更新(`templates/index.html` / `static/js/app.js` / `static/js/i18n.js`)
**追加カード**
- **Blur Tool (≈)** — Whole Blur / Whole Mosaic / Rect Blur / Rect Mosaic の操作説明(6項目)
- **BG Remove Tool (⬚)** — モデル説明・New Layer 動作・処理フロー(5項目)
**Tools リストに追記**
- `helpImageEdit7b` — Blur ツールの概要
- `helpImageEdit7c` — BG Remove ツールの概要
**i18n**
- `app.js`: 14 エントリの ID→キーマッピングを追加
- `i18n.js`: 英語・日本語・中国語に各 14 キーを追加
---
## 2026-06-26: v0.3.56 — Style機能追加(GenerateUI ツールバー & Batchタブ)
**変更ファイル**: `py/routes/settings_routes.py`, `static/js/generate-tab.js`, `templates/index.html`, `README.md`
### 概要
Fooocus形式(`{name, prompt, negative_prompt}`)のスタイルJSONを生成時に自動適用する機能を追加。`user/default/Workflow-Studio/style/` に置いた `*.json` ファイルをすべて読み込んでドロップダウンに表示し、ポジティブ/ネガティブプロンプトへ適用する。ワークフロー本体は変更せず生成ごとのコピーにのみ適用される。
---
### バックエンド
#### `py/routes/settings_routes.py`
- **`GET /api/wfm/styles`** を追加
- `DATA_DIR/style/*.json` をファイル名順に読み込み、各ファイルの配列を結合して返す
- ファイル読み込みに失敗した場合はその1ファイルをスキップしてログを出力(全体のエラーにはしない)
---
### フロントエンド
#### `static/js/generate-tab.js`
**スタイル管理**
- `_stylesData` — ロードしたスタイルオブジェクト配列(`{name, prompt?, negative_prompt?}`)
- `_batchStyleSelected` — Batchタブで選択中のスタイル名 Set
- `_batchStyleOverride` — Styleバッチ実行中に適用スタイルを一時的に上書きする変数(`null` のとき通常モード)
**追加関数**
| 関数 | 概要 |
|---|---|
| `_loadStyles()` | `/api/wfm/styles` を取得しドロップダウンとバッチリストを更新 |
| `_renderStyleDropdown()` | ツールバーの `#wfm-style-select` をスタイル名で再描画 |
| `_rebuildStyleList()` | `_buildSimpleGroupList` を使って左ペインのスタイル一覧を描画 |
| `_applyNamedStyle(workflow, style)` | プロンプトノードにスタイルを適用したワークフローのコピーを返す共通ロジック |
| `_applyStyleToWorkflow(workflow)` | バッチ上書きがあればそれを優先、なければツールバー設定を参照して `_applyNamedStyle` を呼ぶ |
**適用ロジック(`_applyNamedStyle`)**
- ポジティブノード: `style.prompt` に `{prompt}` が含まれる場合は置換、含まれない場合は `元のプロンプト, スタイルプロンプト` で連結
- ネガティブノード: `style.negative_prompt` を元のネガティブプロンプトの末尾に `, ` で連結
- ワークフローコピー(`JSON.parse(JSON.stringify(workflow))`)に対して操作するため、`comfyUI.currentWorkflow` は変更されない
**既存関数の変更**
- `_coreGenerate()`: ワイルドカード展開後に `_applyStyleToWorkflow()` を呼ぶよう変更(変数名 `workflowForGenerate` → `workflowExpanded` → `workflowForGenerate` の2段階に分割)
- `_updateBatchTypeLabel()`: `labels` マップに `style: "Style"` を追加
- `_renderBatchPreview()`: Style列の更新を追加(`wfm-batch-style-count` / `wfm-batch-style-preview-list`)
- `initBatchTab()`: Styleタブ切り替え時に `_rebuildStyleList()` を呼ぶよう追加、All/Noneボタン(`wfm-style-batch-select-all` / `wfm-style-batch-deselect-all`)のイベントリスナーを追加、Batchタブ表示時に `_rebuildStyleList()` を追加
- `initGenerateTab()`: 初期化時に `await _loadStyles()` を追加
- `_runBatchGenerate()`: `case "style"` を追加 — 選択スタイルを `_batchStyleOverride` にセットして `_runBatchLoop` を実行、finally で `_batchStyleOverride = null` にリセット
---
#### `templates/index.html`
**ツールバー(Styleセレクター)**
Reset Workflow ボタンの右隣に以下を追加:
- `<label id="wfm-style-label">` + `<input type="checkbox" id="wfm-style-enabled">` — Style の有効/無効チェックボックス
- `<select id="wfm-style-select">` — スタイルドロップダウン(`min-width:120px / max-width:220px`)
**Batchタブ左ペイン**
- `wfm-batch-left-tab-nav` に `<button data-left-tab="style">Style</button>` を追加
- `wfm-batch-left-style` コンテンツを追加(All/Noneボタン + `wfm-batch-style-list`)
**Batchタブ Batch Queue(右ペイン)**
- Style 列を追加(`wfm-batch-style-count` / `wfm-batch-style-preview-list` / `data-batch-type="style"` チェックボックス)
**ヘルプ**
- `wfm-help-gen-2`: ツールバーへのStyle追加とスタイルファイルパス・適用ロジックを追記
- `wfm-help-gen-12`: 左ペインのタブ数 3→4、Styleタブの説明を追記
- `wfm-help-gen-14`: Batch Queue の列数 6→7 に更新
- `wfm-help-gen-17`(新規): Styleバッチ専用の説明を追加
---
### スタイルファイル仕様
`user/default/Workflow-Studio/style/` 配下の任意の `*.json`(複数可)を配置する。各ファイルはオブジェクトの配列形式で、以下のフィールドを持つ:
```json
[
{
"name": "スタイル名",
"prompt": "スタイルプロンプト({prompt} プレースホルダー使用可)",
"negative_prompt": "ネガティブプロンプト"
}
]
```
`prompt` / `negative_prompt` はいずれも省略可能。Fooocusの `sdxl_styles_*.json` 形式をそのまま使用できる。
---
## 2026-06-25: v0.3.55 — グループ機能バグ修正(全タブ)
**変更ファイル**: `py/services/models_service.py`, `static/js/models-tab.js`, `static/js/generate-tab.js`, `static/js/prompt-tab.js`, `static/js/i18n.js`
@@ -24,7 +267,7 @@ Windows 環境で ComfyUI が返す Checkpoint/LoRA 名はバックスラッシ
#### `static/js/generate-tab.js`
- **Checkpoint/LoRA/Prompt/Workflow 全バッチグループ**: 予約グループ(Batch/Stack)が各バッチ実行選択UIに表示されていたのを除外
- **Checkpoint/LoRA/Prompt/Workflow 全バッチグループ**: v0.3.55 で誤って追加した予約グループ(Batch/Stack)除外フィルターを削除 → Batch/Stack グループはバッチ実行UIに表示され正常に選択可能
- **LoRA グループ**: API取得後にバックスラッシュ→フォワードスラッシュ正規化を追加(Checkpoint 修正と同等)
- **`batchComplete` トースト**: 英語ハードコード文字列を削除し `t("batchComplete", ...)` に変更
+25 -7
View File
@@ -18,7 +18,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- Built-in AI tools (translation and more)
![Workflow Studio](https://img.shields.io/badge/ComfyUI-Custom_Node-blue)
![Version](https://img.shields.io/badge/version-0.3.55-green)
![Version](https://img.shields.io/badge/version-0.3.58-green)
## Screenshots
@@ -71,16 +71,17 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **5-tab layout** — Input / Model / Settings / Feeder / Batch tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
- **Save button** — located at the right end of the subtab row; opens a filename dialog (default: current workflow name) and saves the current workflow as a `.json` file to the Workflow tab via the import API
- **Input tab** — Prompt and Image inner tabs (drag-and-drop upload); Prompt tab shows Positive Prompt and Negative Prompt textareas, plus an **Embeddings selector** at the bottom (Filter + Select + Weight input + Paste button); Paste inserts `(embedding:Name:weight)` at the cursor position of the last focused textarea (defaults to Positive when neither is focused); Raw JSON (540px) in the right column
- **Model tab** — Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder, **Hypernetwork** (with Strength field) selectors with filter; Raw JSON on the right
- **Model tab** — Checkpoint, VAE, LoRA, ControlNet, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — single clip: type + device; dual clip: two clip selectors + type + device), **Hypernetwork** (with Strength field) 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
- **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
- **Style selector** — checkbox and dropdown next to the Reset Workflow button; enable to apply a Fooocus-style JSON to positive and negative prompts at generation time; style files (`*.json`) are loaded from `user/default/Workflow-Studio/style/`; the style's `{prompt}` placeholder is replaced with the original prompt text, or the style is appended if no placeholder exists; `negative_prompt` is appended to the existing negative prompt; styles are applied to a per-generation copy and do not modify the loaded workflow
- **Batch type selector** — check one of the column header checkboxes in the Batch Queue pane (Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler / Style) 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
- **Left pane** — 4 tabs: **Checkpoints** (file-tree; Filter / All / None), **Sampler** (KSampler sampler list), **Scheduler** (KSampler scheduler list), **Style** (flat list of all styles from `Workflow-Studio/style/`; All / None buttons)
- **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
- **Right pane (Batch Queue)** — 7 columns: Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler / **Style**; each column header has an enable checkbox (radio behavior: only one at a time); count shown per column; Style batch applies each selected style sequentially to a workflow copy
- **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
@@ -212,11 +213,13 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **Layer-based image editor** — compose images with multiple layers (Image, Text, Draw types) and export the composite as PNG
- **Loading images** — drag & drop onto the canvas, Upload button, or send from the Gallery tab via the **Image Edit** toolbar button; first image becomes Layer 1 (auto-locked), subsequent images are added as new layers scaled to fit the canvas
- **New button** — create a blank canvas with custom dimensions (WxH prompt); clears all existing layers
- **Tools** — Select (V), Draw (B), Text (T), Shape (S); tool options bar updates per active tool
- **Tools** — Select (V), Draw (B), Text (T), Shape (S), Blur (≈), BG Remove (⬚); tool options bar updates per active tool
- **Select** — click to select; drag to move; drag corner handles to resize; drag circle handle to rotate; Flip H / Flip V / Rotate angle in the options bar; double-click a text layer to re-edit its content
- **Draw** — freehand brush; options: color, brush size, blend mode
- **Text** — click to place; configure font, size, bold/italic, align, and color; placed as an exact-size text layer sized to the measured bounding box; double-click to re-edit
- **Shape** — drag to draw geometric shapes (Rect / Ellipse / Line / FreeLine); options: shape type, Rounded toggle (Rect/Ellipse), Fill color, Stroke color + width, Opacity; each committed shape becomes an independent draw layer; Stroke None hidden for Line/FreeLine (stroke always active)
- **Blur** — **Whole Blur**: Gaussian blur to the entire active layer with intensity slider (1–50 px); **Whole Mosaic**: pixelation mosaic with block-size slider (5–100 px); **Rect Blur / Rect Mosaic**: enable the toggle then drag a rectangle on the canvas to apply blur or mosaic to that region only (blue preview for blur, orange for mosaic); Rect Blur and Rect Mosaic are mutually exclusive; all operations support Undo
- **BG Remove** — remove the background from the active layer; **Lightweight (@imgly)**: runs entirely in the browser via CDN (no server required; ~40 MB model downloaded on first use); **BiRefNet**: high-quality removal via the Python backend (coming soon); **New Layer** option (default on) adds the result as a new layer above the original; when off, replaces the active layer in-place
- **Layer panel** — layer list with visibility (👁/🚫) and lock (🔒/🔓) toggles; opacity slider; type icons (🖼 image / T text / ✏ draw); Layer 1 is automatically locked on first image load
- **Layer lock** — locked layers show an orange bounding box and 🔒 icon on the canvas; move/resize/rotate are disabled while locked; click the 🔓 button in the layer row to unlock
- **Text quality** — text layers are rendered at their measured bounding-box size; resizing with the Select tool regenerates the canvas at the new display resolution so text stays sharp
@@ -350,6 +353,20 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
## Changelog
### v0.3.58
- **GenerateUI Model tab — Diffusion Model GGUF support** — `LoaderGGUF` and `LoaderGGUFAdvanced` nodes are now recognized alongside `UNETLoader` / `UnetLoaderGGUF`; the correct input key (`gguf_name` vs `unet_name`) is selected automatically on Apply; the Models tab "GenUI Model" button also applies correctly to `LoaderGGUF` workflows
- **GenerateUI Model tab — Text Encoder expanded (CLIPLoader / DualCLIPLoader / GGUF variants)** — the Text Encoder section now renders a node-type-aware UI: **single CLIP** (`CLIPLoader` / `ClipLoaderGGUF`) shows one clip selector + **type** dropdown + **device** (GGUF only); **Dual CLIP** (`DualCLIPLoader` / `DualClipLoaderGGUF`) shows two clip selectors (clip_name1 / clip_name2) + **type** dropdown + **device** (GGUF only); type options are fetched dynamically from `/object_info`; filter applies to the first selector only
### v0.3.57
- **Image Edit — Blur tool** — new Blur tool (≈) in the Image Edit sidebar; **Whole Blur**: Gaussian blur to the entire active layer with intensity slider (1–50 px); **Whole Mosaic**: pixelation mosaic with block-size slider (5–100 px); **Rect Blur / Rect Mosaic**: toggle to enter rect-draw mode then drag to select a region — blur or mosaic is applied on mouse release; Rect Blur and Rect Mosaic are mutually exclusive; all operations support Undo (Ctrl+Z)
- **Image Edit — BG Remove tool** — new BG Remove tool (⬚); **Lightweight (@imgly)**: background removal running entirely in the browser via CDN (~40 MB model cached after first load); **BiRefNet**: stub wired to a future Python backend endpoint (coming soon); **New Layer** checkbox (default on) adds the result as a new layer above the original — uncheck to replace the active layer in-place; supports Undo
- **Image Edit — sidebar icons** — removed `ie-tool-placeholder` dimming from Blur and BG Remove buttons; both now display at full brightness matching other active tools
- **Help — Blur / BG Remove sections** — added two new help cards (Blur Tool and BG Remove Tool) with full i18n support (English / Japanese / Chinese); Tools list updated with Blur and BG Remove overview items
### v0.3.56
- **GenerateUI — Style selector** — new checkbox and dropdown next to the Reset Workflow button; when enabled, a Fooocus-style JSON style is applied to positive and negative prompts at generation time; style files (`*.json`) are read from `user/default/Workflow-Studio/style/`; multiple files are merged into a single list sorted by filename; the style's `{prompt}` placeholder is replaced with the original prompt text, otherwise the style text is appended; `negative_prompt` is appended to the existing negative prompt; styles are applied to a per-generation workflow copy and never modify the loaded workflow
- **Batch tab — Style batch** — new **Style** tab in the Batch left pane lists all styles loaded from the style directory (flat list with All / None buttons); select any combination, enable the **Style** column in Batch Queue, then Generate to run each selected style sequentially; Batch Queue expanded from 6 to 7 columns (Style added as the rightmost column)
### v0.3.55
- **Group feature — fix data loss on Windows (backslash/slash mismatch)** — on Windows, ComfyUI returns model paths with backslashes (`sub\model.safetensors`) while the backend normalized to forward slashes; this caused all subdir group members to be flagged as missing and deleted on save; fixed by normalizing both stored and scanned paths to forward slashes in `get_model_groups` and `save_model_groups`
- **Group feature — network drive protection** — if no model directories are accessible (e.g. external drive disconnected), the group cleanup step is now skipped entirely to prevent wiping all group memberships
@@ -357,7 +374,7 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
- **Group feature — RESERVED_GROUPS protection** — `bulkRemoveFromGroup` and `renderPmGroups` now prevent Batch/Stack reserved group keys from being deleted even when all members are removed
- **Group feature — stale groupFilter reset** — after deleting a group, `state.groupFilter` is automatically cleared if it pointed to the now-deleted group (previously showed 0 models)
- **Group feature — toggleGroupEnable partial failure** — only models listed in `data.ok` are updated client-side, preventing state divergence when some enable/disable calls fail
- **GenerateUI batch groups — exclude reserved groups** — Batch and Stack reserved groups no longer appear in the batch group selection UI for Checkpoint/LoRA/Prompt/Workflow
- **GenerateUI batch groups — restore Batch/Stack visibility** — reverts an incorrect filter that hid Batch and Stack groups from the batch group selection UI; these groups are now selectable for batch execution as intended
- **GenerateUI LoRA groups — path normalization** — backslash-to-slash normalization added after fetching LoRA groups from the API, matching the Checkpoint fix
- **Batch complete toast — i18n** — replaced hardcoded English toast with `t("batchComplete", ...)` supporting all 3 languages
- **Prompt tab migration — fix negText loss** — `migrateLocalStoragePresets` now correctly passes `negText` when calling `apiCreatePreset`, preventing negative prompts from being silently dropped during localStorage→API migration
@@ -839,3 +856,4 @@ MIT License
- [Pillow (PIL Fork)](https://python-pillow.org/) — server-side thumbnail generation (`data/thumb_cache/`)
- [ComfyUI-Gallery](https://github.com/PanicTitan/ComfyUI-Gallery) by PanicTitan — thumbnail grid UX reference
- [infinite-image-browsing](https://github.com/zanllp/sd-webui-infinite-image-browsing) by zanllp — thumbnail caching and index strategy reference
- [Fooocus](https://github.com/lllyasviel/Fooocus) by lllyasviel — style preset JSON format reference
+28
View File
@@ -36,6 +36,7 @@ def setup_routes(app: web.Application):
app.router.add_post("/api/wfm/settings/output-dir", handle_set_output_dir)
app.router.add_get("/api/wfm/settings/export", handle_export)
app.router.add_post("/api/wfm/settings/import", handle_import)
app.router.add_get("/api/wfm/styles", handle_get_styles)
async def handle_get(request: web.Request) -> web.Response:
@@ -241,3 +242,30 @@ async def handle_import(request: web.Request) -> web.Response:
except Exception as e:
logger.error("Error importing data: %s", e)
return web.json_response({"error": str(e)}, status=500)
def _load_styles() -> list:
"""Load all style JSON files from DATA_DIR/style/ directory."""
style_dir = DATA_DIR / "style"
styles = []
if not style_dir.is_dir():
return styles
for json_file in sorted(style_dir.glob("*.json")):
try:
with open(json_file, "r", encoding="utf-8") as f:
data = json.load(f)
if isinstance(data, list):
styles.extend(data)
except Exception as e:
logger.warning("Failed to load style file %s: %s", json_file.name, e)
return styles
async def handle_get_styles(request: web.Request) -> web.Response:
"""GET /api/wfm/styles - Get all styles from style directory."""
try:
styles = await asyncio.to_thread(_load_styles)
return web.json_response(styles)
except Exception as e:
logger.error("Error loading styles: %s", e)
return web.json_response({"error": str(e)}, status=500)
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-workflow-studio"
description = "A comprehensive workflow, asset management, and generation UI plugin for ComfyUI. Manage workflows, models, images, and prompts; batch generation and Image Feeder in the GenerateUI tab; library side panel with canvas drag & drop and AI tools."
version = "0.3.55"
version = "0.3.58"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+11
View File
@@ -355,6 +355,7 @@ function applyI18nToHtml() {
"wfm-help-gen-11": "helpGen11", "wfm-help-gen-12": "helpGen12",
"wfm-help-gen-13": "helpGen13", "wfm-help-gen-14": "helpGen14",
"wfm-help-gen-15": "helpGen15", "wfm-help-gen-16": "helpGen16",
"wfm-help-gen-17": "helpGen17",
"wfm-help-feeder-title": "helpFeederTitle",
"wfm-help-feeder-desc": "helpFeederDesc",
"wfm-help-feeder-imgloop-title": "helpFeederImgloopTitle",
@@ -398,6 +399,7 @@ function applyI18nToHtml() {
"wfm-help-gallery-9": "helpGallery9", "wfm-help-gallery-10": "helpGallery10",
"wfm-help-gallery-11": "helpGallery11", "wfm-help-gallery-12": "helpGallery12",
"wfm-help-gallery-13": "helpGallery13", "wfm-help-gallery-14": "helpGallery14",
"wfm-help-gallery-15": "helpGallery15", "wfm-help-gallery-16": "helpGallery16",
"wfm-help-tagger-title": "helpTaggerTitle",
"wfm-help-tagger-1": "helpTagger1", "wfm-help-tagger-2": "helpTagger2",
"wfm-help-tagger-3": "helpTagger3", "wfm-help-tagger-4": "helpTagger4",
@@ -439,6 +441,15 @@ function applyI18nToHtml() {
"wfm-help-imageedit-26": "helpImageEdit26", "wfm-help-imageedit-27": "helpImageEdit27",
"wfm-help-imageedit-28": "helpImageEdit28", "wfm-help-imageedit-29": "helpImageEdit29",
"wfm-help-imageedit-30": "helpImageEdit30",
"wfm-help-imageedit-7b": "helpImageEdit7b", "wfm-help-imageedit-7c": "helpImageEdit7c",
"wfm-help-imageedit-blur-title": "helpImageEditBlurTitle",
"wfm-help-imageedit-blur-1": "helpImageEditBlur1", "wfm-help-imageedit-blur-2": "helpImageEditBlur2",
"wfm-help-imageedit-blur-3": "helpImageEditBlur3", "wfm-help-imageedit-blur-4": "helpImageEditBlur4",
"wfm-help-imageedit-blur-5": "helpImageEditBlur5", "wfm-help-imageedit-blur-6": "helpImageEditBlur6",
"wfm-help-imageedit-bgremove-title": "helpImageEditBgRemoveTitle",
"wfm-help-imageedit-bgremove-1": "helpImageEditBgRemove1", "wfm-help-imageedit-bgremove-2": "helpImageEditBgRemove2",
"wfm-help-imageedit-bgremove-3": "helpImageEditBgRemove3", "wfm-help-imageedit-bgremove-4": "helpImageEditBgRemove4",
"wfm-help-imageedit-bgremove-5": "helpImageEditBgRemove5",
"wfm-help-imageedit-tabkbd-title": "helpImageEditTabKbdTitle",
"wfm-help-imageedit-tabkbd-1": "helpImageEdit22", "wfm-help-imageedit-tabkbd-2": "helpImageEdit23",
"wfm-help-imageedit-tabkbd-3": "helpImageEdit24", "wfm-help-imageedit-tabkbd-4": "helpImageEdit25",
+10 -8
View File
@@ -132,17 +132,19 @@ export const comfyUI = {
},
async fetchDiffusionModels() {
return this._fetchModelList(
["UNETLoader", "UnetLoaderGGUF"],
"unet_name"
);
const [standard, gguf] = await Promise.all([
this._fetchModelList(["UNETLoader", "UnetLoaderGGUF"], "unet_name"),
this._fetchModelList(["LoaderGGUF", "LoaderGGUFAdvanced"], "gguf_name"),
]);
return [...new Set([...standard, ...gguf])];
},
async fetchTextEncoders() {
return this._fetchModelList(
["DualCLIPLoader", "CLIPLoader"],
"clip_name1"
);
const [dual, single] = await Promise.all([
this._fetchModelList(["DualCLIPLoader", "DualClipLoaderGGUF"], "clip_name1"),
this._fetchModelList(["CLIPLoader", "ClipLoaderGGUF"], "clip_name"),
]);
return [...new Set([...dual, ...single])];
},
async fetchHypernetworks() {
+107 -3
View File
@@ -342,7 +342,6 @@ export const comfyEditor = {
{ label: "Checkpoint", key: "checkpoints", nodes: analysis.checkpoint_nodes, inputKey: "ckpt_name" },
{ label: "VAE", key: "vaes", nodes: analysis.vae_nodes, inputKey: "vae_name" },
{ label: "Diffusion Model", key: "diffusionModels", nodes: analysis.diffusion_model_nodes, inputKey: "unet_name" },
{ label: "Text Encoder", key: "textEncoders", nodes: analysis.text_encoder_nodes, inputKey: "clip_name1" },
{ label: "ControlNet", key: "controlNets", nodes: analysis.controlnet_nodes, inputKey: "control_net_name" },
{
label: "Hypernetwork", key: "hypernetworks", nodes: analysis.hypernetwork_nodes, inputKey: "hypernetwork_name",
@@ -383,7 +382,7 @@ export const comfyEditor = {
</div>
`;
})
.join("");
.join("") + '<div class="wfm-form-group" id="wfm-te-section" style="border-bottom:1px solid var(--wfm-border);padding-bottom:12px;"><label>Text Encoder</label></div>';
// Filter inputs
el.querySelectorAll(".wfm-model-filter").forEach((input) => {
@@ -405,13 +404,18 @@ export const comfyEditor = {
el.querySelectorAll(".wfm-model-apply").forEach((btn) => {
btn.addEventListener("click", () => {
const key = btn.dataset.key;
const inputKey = btn.dataset.input;
let inputKey = btn.dataset.input;
const select = document.getElementById(`wfm-model-${key}`);
const targetSelect = document.getElementById(`wfm-model-${key}-target`);
if (!select || !targetSelect) return;
const value = select.value;
const nodeId = targetSelect.value;
if (nodeId && comfyUI.currentWorkflow?.[nodeId]) {
// LoaderGGUF ノードは gguf_name キーを使う
const ct = comfyUI.currentWorkflow[nodeId].class_type;
if (key === "diffusionModels" && (ct === "LoaderGGUF" || ct === "LoaderGGUFAdvanced")) {
inputKey = "gguf_name";
}
comfyUI.currentWorkflow[nodeId].inputs[inputKey] = value;
// Apply extras (e.g. strength for Hypernetwork)
el.querySelectorAll(`.wfm-model-extra[data-key="${key}"]`).forEach((ex) => {
@@ -423,6 +427,9 @@ export const comfyEditor = {
}
});
});
// Text Encoder セクションの非同期初期化
_initTextEncoderSection(analysis, this.models.textEncoders || [], el).catch(() => {});
},
async renderLoraPane(analysis, containerId) {
@@ -1207,3 +1214,100 @@ function _nodeOptions(nodes) {
.map((n) => `<option value="${n.id}">ID:${n.id} (${n.title})</option>`)
.join("");
}
async function _initTextEncoderSection(analysis, textEncoders, containerEl) {
const section = containerEl.querySelector("#wfm-te-section");
if (!section) return;
const nodes = analysis.text_encoder_nodes || [];
if (nodes.length === 0) {
section.innerHTML = `<label>Text Encoder</label><p class="wfm-placeholder">No text encoder node found</p>`;
return;
}
const firstNode = nodes[0];
const ct = firstNode.type;
const isDual = ct === "DualCLIPLoader" || ct === "DualClipLoaderGGUF";
const hasDevice = ct === "ClipLoaderGGUF" || ct === "DualClipLoaderGGUF";
// CLIPLoader は clip_name、DualCLIPLoader は clip_name1 キーを使う
const clip1Key = (ct === "CLIPLoader" || ct === "ClipLoaderGGUF") ? "clip_name" : "clip_name1";
// object_info から type 選択肢を取得
let typeOptions = [];
try {
const info = await comfyUI.fetchObjectInfo(ct);
const typeSpec = info?.[ct]?.input?.required?.type;
if (typeSpec) {
const first = typeSpec[0];
if (Array.isArray(first)) typeOptions = first;
else if (Array.isArray(typeSpec[1]?.values)) typeOptions = typeSpec[1].values;
else if (Array.isArray(typeSpec[1]?.options)) typeOptions = typeSpec[1].options;
}
} catch {}
const currentClip1 = firstNode.clip_name1 || "";
const currentClip2 = firstNode.clip_name2 || "";
const currentType = firstNode.clip_type || typeOptions[0] || "";
const currentDevice = firstNode.device || "default";
const targetOpts = nodes.map(n => `<option value="${n.id}">ID:${n.id} (${n.title})</option>`).join("");
const clip1Opts = textEncoders.map(m => `<option value="${m}" ${m === currentClip1 ? "selected" : ""}>${m}</option>`).join("");
const clip2Opts = textEncoders.map(m => `<option value="${m}" ${m === currentClip2 ? "selected" : ""}>${m}</option>`).join("");
const typeOpts = typeOptions.map(t => `<option value="${t}" ${t === currentType ? "selected" : ""}>${t}</option>`).join("");
const deviceOpts = ["default", "cpu"].map(d => `<option value="${d}" ${d === currentDevice ? "selected" : ""}>${d}</option>`).join("");
section.innerHTML = `
<label>Text Encoder</label>
<input type="text" class="wfm-input" id="wfm-te-filter" placeholder="Filter..." style="margin-bottom:4px;">
<select class="wfm-select" id="wfm-te-clip1" style="margin-bottom:4px;">${clip1Opts}</select>
${isDual ? `<select class="wfm-select" id="wfm-te-clip2" style="margin-bottom:4px;">${clip2Opts}</select>` : ""}
${typeOptions.length > 0 ? `
<div style="display:flex;gap:6px;align-items:center;margin-bottom:4px;">
<label style="font-size:12px;white-space:nowrap;color:var(--wfm-text-secondary);width:50px;">Type</label>
<select class="wfm-select" id="wfm-te-type">${typeOpts}</select>
</div>` : ""}
${hasDevice ? `
<div style="display:flex;gap:6px;align-items:center;margin-bottom:4px;">
<label style="font-size:12px;white-space:nowrap;color:var(--wfm-text-secondary);width:50px;">Device</label>
<select class="wfm-select" id="wfm-te-device">${deviceOpts}</select>
</div>` : ""}
<div style="display:flex;gap:8px;align-items:center;margin-top:4px;">
<select class="wfm-select" id="wfm-te-target" style="flex:1;">${targetOpts}</select>
<button class="wfm-btn wfm-btn-sm" id="wfm-te-apply">Apply</button>
</div>
`;
// フィルター(clip1 のみ)
document.getElementById("wfm-te-filter")?.addEventListener("input", (e) => {
const filter = e.target.value.toLowerCase();
const sel = document.getElementById("wfm-te-clip1");
if (!sel) return;
const filtered = textEncoders.filter(m => m.toLowerCase().includes(filter));
sel.innerHTML = filtered.map(m => `<option value="${m}">${m}</option>`).join("");
});
// Apply
document.getElementById("wfm-te-apply")?.addEventListener("click", () => {
const nodeId = document.getElementById("wfm-te-target")?.value;
if (!nodeId || !comfyUI.currentWorkflow?.[nodeId]) return;
const inputs = comfyUI.currentWorkflow[nodeId].inputs;
const clip1Val = document.getElementById("wfm-te-clip1")?.value;
if (clip1Val) inputs[clip1Key] = clip1Val;
if (isDual) {
const clip2Val = document.getElementById("wfm-te-clip2")?.value;
if (clip2Val) inputs.clip_name2 = clip2Val;
}
const typeVal = document.getElementById("wfm-te-type")?.value;
if (typeVal) inputs.type = typeVal;
if (hasDevice) {
const deviceVal = document.getElementById("wfm-te-device")?.value;
if (deviceVal) inputs.device = deviceVal;
}
_syncRawJson();
});
}
+13 -2
View File
@@ -794,18 +794,25 @@ export const comfyWorkflow = {
}
// --- Text encoder (CLIP) nodes ---
if (ct === "DualCLIPLoader" || ct === "CLIPLoader") {
if (ct === "DualCLIPLoader" || ct === "CLIPLoader" || ct === "ClipLoaderGGUF" || ct === "DualClipLoaderGGUF") {
result.text_encoder_nodes.push({
id, type: ct, title,
clip_name1: inputs.clip_name1 || inputs.clip_name,
clip_name2: inputs.clip_name2,
clip_type: inputs.type,
device: inputs.device,
});
}
// --- Diffusion model nodes ---
if (ct === "UNETLoader" || ct === "UnetLoaderGGUF") {
result.diffusion_model_nodes.push({
id, type: ct, title, unet_name: inputs.unet_name,
id, type: ct, title, unet_name: inputs.unet_name, inputKey: "unet_name",
});
}
if (ct === "LoaderGGUF" || ct === "LoaderGGUFAdvanced") {
result.diffusion_model_nodes.push({
id, type: ct, title, unet_name: inputs.gguf_name, inputKey: "gguf_name",
});
}
@@ -879,9 +886,13 @@ function _getWidgetMapping(nodeType) {
SaveImage: ["filename_prefix"],
LoadImage: ["image", "upload"],
UNETLoader: ["unet_name", "weight_dtype"],
LoaderGGUF: ["gguf_name"],
LoaderGGUFAdvanced: ["gguf_name", "dequant_dtype", "patch_dtype", "patch_on_device"],
ResolutionSelector: ["aspect_ratio", "megapixels"],
EmptySD3LatentImage: ["width", "height", "batch_size"],
CLIPLoader: ["clip_name", "type", "device"],
ClipLoaderGGUF: ["clip_name", "type"],
DualClipLoaderGGUF: ["clip_name1", "clip_name2", "type"],
FluxGuidance: ["guidance"],
CFGNorm: ["strength"],
// Impact Pack wildcard nodes — only map wildcard_text (index 0); remaining widgets
+139 -21
View File
@@ -287,7 +287,7 @@ function _setPauseBtnState(paused) {
function _updateBatchTypeLabel(running = false) {
const el = document.getElementById("wfm-batch-type-label");
if (!el) return;
const labels = { checkpoint: "Checkpoint", lora: "Lora", prompt: "Prompt", workflow: "Workflow", sampler: "Sampler", scheduler: "Scheduler" };
const labels = { checkpoint: "Checkpoint", lora: "Lora", prompt: "Prompt", workflow: "Workflow", sampler: "Sampler", scheduler: "Scheduler", style: "Style" };
if (_activeBatchType) {
el.textContent = labels[_activeBatchType];
el.style.color = running ? "var(--wfm-primary)" : "";
@@ -457,6 +457,14 @@ function _renderBatchPreview() {
(s) => s,
"scheduler", "schedulers"
);
// Style
const styleList = _stylesData.filter((s) => _batchStyleSelected.has(s.name)).map((s) => s.name);
_renderQueueColumn(
"wfm-batch-style-count", "wfm-batch-style-preview-list",
styleList,
(s) => s,
"style", "styles"
);
}
// モデルパスリストをフォルダ → [modelPath, ...] のMapに変換
@@ -647,9 +655,7 @@ function _renderBatchGroupList() {
const el = document.getElementById("wfm-batch-group-list");
if (!el) return;
const groups = _batchGroupState.groups;
// Batch / Stack はモデルタブ専用の予約グループ — バッチ実行選択UIには表示しない
const RESERVED = new Set(["Batch", "Stack"]);
const names = Object.keys(groups).filter((n) => !RESERVED.has(n)).sort();
const names = Object.keys(groups).sort();
if (names.length === 0) {
el.innerHTML = `<p class="wfm-placeholder" style="font-size:12px;padding:16px;">No groups defined.<br>Create groups in the Models tab.</p>`;
@@ -908,14 +914,9 @@ async function _loadBatchLoraGroups() {
function _renderBatchLoraGroupList() {
const el = document.getElementById("wfm-batch-lora-group-list");
// Batch / Stack はモデルタブ専用 — バッチ実行UIには表示しない
const RESERVED = new Set(["Batch", "Stack"]);
const filtered = Object.fromEntries(
Object.entries(_batchGroupState.loraGroups).filter(([k]) => !RESERVED.has(k))
);
_renderAnyGroupList(
el,
filtered,
_batchGroupState.loraGroups,
_batchGroupState.loraSelectedGroups,
_batchGroupState.loraPartialSelections,
(m) => m.replace(/\\/g, "/").split("/").pop(),
@@ -953,13 +954,9 @@ async function _loadPromptGroupsForBatch() {
function _renderBatchPromptGroupList() {
const el = document.getElementById("wfm-batch-prompt-group-list");
const presetsMap = new Map(_batchGroupState.promptPresets.map((p) => [p.id, p]));
// "Batch" はPromptタブ専用の予約グループ — バッチ実行UIには表示しない
const filtered = Object.fromEntries(
Object.entries(_batchGroupState.promptGroups).filter(([k]) => k !== "Batch")
);
_renderAnyGroupList(
el,
filtered,
_batchGroupState.promptGroups,
_batchGroupState.promptSelectedGroups,
_batchGroupState.promptPartialSelections,
(id) => presetsMap.get(id)?.name || id,
@@ -987,13 +984,9 @@ function _loadWorkflowGroupsForBatch() {
function _renderBatchWfGroupList() {
const el = document.getElementById("wfm-batch-wf-group-list");
// "Batch" はWorkflowタブ専用の予約グループ — バッチ実行UIには表示しない
const filtered = Object.fromEntries(
Object.entries(_batchGroupState.wfGroups).filter(([k]) => k !== "Batch")
);
_renderAnyGroupList(
el,
filtered,
_batchGroupState.wfGroups,
_batchGroupState.wfSelectedGroups,
_batchGroupState.wfPartialSelections,
(f) => f.replace(/\.json$/i, "").replace(/\\/g, "/").split("/").pop(),
@@ -1113,6 +1106,7 @@ function initBatchTab() {
document.getElementById(`wfm-batch-left-${tabId}`)?.classList.add("active");
if (tabId === "sampler") _rebuildSamplerList();
else if (tabId === "scheduler") _rebuildSchedulerList();
else if (tabId === "style") _rebuildStyleList();
});
});
@@ -1172,6 +1166,18 @@ function initBatchTab() {
_renderBatchPreview();
});
// 全選択 / 全解除(左ペイン Style)
document.getElementById("wfm-style-batch-select-all")?.addEventListener("click", () => {
_stylesData.forEach((s) => _batchStyleSelected.add(s.name));
_rebuildStyleList();
_renderBatchPreview();
});
document.getElementById("wfm-style-batch-deselect-all")?.addEventListener("click", () => {
_batchStyleSelected.clear();
_rebuildStyleList();
_renderBatchPreview();
});
// Batch タブが表示されたときに全グループを読み込む
document.querySelector('[data-subtab="batch"]')?.addEventListener("click", () => {
_rebuildCkptList();
@@ -1179,6 +1185,7 @@ function initBatchTab() {
_loadBatchLoraGroups();
_loadPromptGroupsForBatch();
_loadWorkflowGroupsForBatch();
_rebuildStyleList();
_renderBatchPreview();
});
}
@@ -1215,6 +1222,101 @@ function initCheckpointBatch() {
});
}
// ============================================
// Style (Fooocus-style JSON from DATA_DIR/style/)
// ============================================
let _stylesData = [];
const _batchStyleSelected = new Set();
let _batchStyleOverride = null; // Style バッチ実行中に一時的にセット
async function _loadStyles() {
try {
const res = await fetch("/api/wfm/styles");
if (res.ok) _stylesData = await res.json();
else _stylesData = [];
} catch { _stylesData = []; }
_renderStyleDropdown();
_rebuildStyleList();
}
function _renderStyleDropdown() {
const sel = document.getElementById("wfm-style-select");
if (!sel) return;
sel.innerHTML = "";
if (_stylesData.length === 0) {
const opt = document.createElement("option");
opt.value = "";
opt.textContent = "No styles";
sel.appendChild(opt);
return;
}
for (const s of _stylesData) {
const opt = document.createElement("option");
opt.value = s.name;
opt.textContent = s.name;
sel.appendChild(opt);
}
}
function _rebuildStyleList() {
_buildSimpleGroupList(
document.getElementById("wfm-batch-style-list"),
_stylesData.map((s) => s.name),
_batchStyleSelected,
"No styles (place JSON files in Workflow-Studio/style/)"
);
}
function _applyNamedStyle(workflow, style) {
if (!style) return workflow;
const analysis = comfyUI.currentAnalysis;
if (!analysis) return workflow;
const positiveNodes = (analysis.prompt_nodes || []).filter((n) => n.role === "positive");
const negativeNodes = (analysis.prompt_nodes || []).filter((n) => n.role === "negative");
const result = JSON.parse(JSON.stringify(workflow));
if (style.prompt) {
for (const node of positiveNodes) {
const nodeData = result[node.id];
if (!nodeData) continue;
const key = node.textKey || "text";
const original = nodeData.inputs[key] || "";
nodeData.inputs[key] = style.prompt.includes("{prompt}")
? style.prompt.replace("{prompt}", original)
: original ? `${original}, ${style.prompt}` : style.prompt;
}
}
if (style.negative_prompt) {
for (const node of negativeNodes) {
const nodeData = result[node.id];
if (!nodeData) continue;
const key = node.textKey || "text";
const original = nodeData.inputs[key] || "";
nodeData.inputs[key] = original
? `${original}, ${style.negative_prompt}`
: style.negative_prompt;
}
}
return result;
}
function _applyStyleToWorkflow(workflow) {
// バッチ実行中は上書きスタイルを優先
if (_batchStyleOverride !== null) return _applyNamedStyle(workflow, _batchStyleOverride);
const enabled = document.getElementById("wfm-style-enabled")?.checked;
if (!enabled) return workflow;
const selectedName = document.getElementById("wfm-style-select")?.value;
if (!selectedName) return workflow;
const style = _stylesData.find((s) => s.name === selectedName);
return _applyNamedStyle(workflow, style || null);
}
// ============================================
// SPA-side wildcard expansion (A1111-style __name__ syntax)
// Applies to non-ImpactWildcard nodes only; ImpactWildcard* nodes expand server-side.
@@ -1307,7 +1409,8 @@ async function _coreGenerate(silent = false) {
if (progressBar) progressBar.style.width = "0%";
if (progressText) progressText.textContent = "Starting...";
const workflowForGenerate = await _expandWildcardsInWorkflow({ ...comfyUI.currentWorkflow });
const workflowExpanded = await _expandWildcardsInWorkflow({ ...comfyUI.currentWorkflow });
const workflowForGenerate = _applyStyleToWorkflow(workflowExpanded);
const { images, seed } = await comfyUI.generate(
workflowForGenerate,
{
@@ -1538,6 +1641,18 @@ async function _runBatchGenerate() {
});
break;
}
case "style": {
const list = _stylesData.filter((s) => _batchStyleSelected.has(s.name));
if (list.length === 0) { showToast(t("batchNoneSelected", "styles"), "error"); return; }
try {
await _runBatchLoop(list, (style) => {
_batchStyleOverride = style;
}, (s) => s.name);
} finally {
_batchStyleOverride = null;
}
break;
}
}
}
@@ -1854,6 +1969,9 @@ export async function initGenerateTab() {
// Feeder tab
await initFeederTab();
// Style dropdown
await _loadStyles();
// Auto-connect on init
const connected = await comfyUI.checkConnection();
updateStatus(connected);
+57 -3
View File
@@ -604,7 +604,7 @@ const LANGUAGES = {
helpGen2: "Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor; Save button (right end of the tab bar) saves the current workflow — including any edits made in the editor — as a new .json file to the Workflow tab; a filename dialog appears with the current workflow name as the default",
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: inner tabs — Prompt and Image (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an Embeddings selector at the bottom — select a model, set Weight (default 1.0), then click Paste to insert (embedding:Name:weight) at the cursor position of the last focused textarea (defaults to Positive if neither is focused)",
helpGen5: "Model tab: Checkpoint, VAE, LoRA (Single/Stack tabs), ControlNet, UNET, TextEncoder, Hypernetwork (with Strength field) selectors with filter",
helpGen5: "Model tab: Checkpoint, VAE, LoRA (Single/Stack tabs), ControlNet, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors), Hypernetwork (with Strength field) selectors with filter",
helpGen6: "Settings tab: KSampler and Latent Image side by side, each at 50% width",
helpGen7: "Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow",
helpGen8: "Seed control: random, fixed, increment, decrement",
@@ -616,6 +616,7 @@ const LANGUAGES = {
helpGen14: "Batch tab — Right pane (Batch Queue): 6 columns — Checkpoint, Lora, Prompt, Workflow, Sampler, Scheduler; each column has an enable checkbox (radio behavior: only one at a time); count shown per column",
helpGen15: "Sampler/Scheduler batch: select samplers or schedulers in the left pane, enable the column in Batch Queue, then Generate to iterate through each value on the KSampler node; lists are fetched from ComfyUI (connection required)",
helpGen16: "SPA-side wildcard expansion (A1111-style): when prompt text in non-ImpactWildcard nodes (e.g. CLIPTextEncode) contains __name__ syntax, the SPA expands it at generation time by randomly picking a line from the matching file in the WFS wildcard folder; nested wildcards are re-expanded up to 5 passes; unresolved wildcards are passed through unchanged; ImpactWildcardEncode/Processor nodes are skipped (handled server-side by Impact Pack); works in both single and batch generation",
helpGen17: "Style batch: select styles from the Style tab in the left pane, enable the Style column in Batch Queue, then Generate — each selected style is applied in sequence to the positive and negative prompts; applied to workflow copies so the loaded workflow is not modified; style files are re-read on each page load from user/default/Workflow-Studio/style/*.json",
helpFeederTitle: "GenerateUI Tab — Feeder subtab",
helpFeederDesc: "Two modes switchable via the [Image Loop] / [Gallery] toggle at the top of the left pane.",
helpFeederImgloopTitle: "Image Loop mode",
@@ -693,6 +694,8 @@ const LANGUAGES = {
helpGallery12: "Metadata button (green, in the detail panel tab bar): opens the selected image in the Metadata tab for full embedded-data inspection; Alt+click on any image thumbnail has the same effect",
helpGallery13: "Load GenUI button (blue, in the detail panel tab bar): loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab and switches to it; shows a warning toast if no workflow is embedded or the format is not supported",
helpGallery14: "Tagger button (purple, in the detail panel action row): opens the selected image directly in the Tagger tab's Single mode for instant tagging",
helpGallery15: "F button (cyan overlay, top-left of each thumbnail): toggle the image in/out of the __Feeder__ group with a single click; cyan and always visible when in group, visible on hover only when not; quickly queue images for the Feeder tab Gallery mode",
helpGallery16: "Image Edit button (toolbar, next to Refresh): sends the currently selected image to the Image Edit tab; if layers already exist the image is added as a new layer scaled to fit the canvas, otherwise it becomes Layer 1",
// -- Tagger Tab --
helpTaggerTitle: "Tagger Tab",
@@ -767,6 +770,21 @@ const LANGUAGES = {
helpImageEdit28: "Space + drag: Pan canvas",
helpImageEdit29: "Mouse wheel: Zoom in / out",
helpImageEdit30: "Double-click (Select tool on text layer): Re-edit text",
helpImageEdit7b: "Blur (≈): apply Gaussian blur or mosaic to the active layer — whole-layer or region-based (drag a rectangle); see the Blur Tool card below for details",
helpImageEdit7c: "BG Remove (⬚): remove the background from the active layer using Lightweight (@imgly, runs in browser) or BiRefNet (Python backend, coming soon); see the BG Remove Tool card below for details",
helpImageEditBlurTitle: "Blur Tool (≈)",
helpImageEditBlur1: "Whole Blur: applies a Gaussian blur to the entire active layer — adjust the intensity slider (1–50 px) and click Apply",
helpImageEditBlur2: "Whole Mosaic: applies a pixelation mosaic to the entire active layer — adjust the block size slider (5–100 px) and click Apply",
helpImageEditBlur3: "Rect Blur: click the toggle to enter rect mode (button turns blue), then drag on the canvas to draw a rectangle — the selected region is blurred on release; adjust intensity before or after enabling the mode",
helpImageEditBlur4: "Rect Mosaic: same as Rect Blur but applies mosaic; preview outline is orange; adjust block size with the slider",
helpImageEditBlur5: "Rect Blur and Rect Mosaic are mutually exclusive — enabling one disables the other; click the active toggle again to exit rect mode",
helpImageEditBlur6: "All operations support Undo (Ctrl+Z)",
helpImageEditBgRemoveTitle: "BG Remove Tool (⬚)",
helpImageEditBgRemove1: "Model — Lightweight (@imgly): runs entirely in the browser using the @imgly/background-removal library loaded from CDN; no server required; first use downloads the model (~40 MB) and caches it for the session",
helpImageEditBgRemove2: "Model — BiRefNet: high-quality background removal using the BiRefNet model via the Workflow Studio Python backend; requires birefnet.safetensors placed in ComfyUI/models/background_removal/ (coming soon)",
helpImageEditBgRemove3: "New Layer (checked by default): the result is added as a new layer above the active layer at the same position and display size — the original layer is preserved",
helpImageEditBgRemove4: "When New Layer is unchecked, the active layer's canvas is replaced in-place with the background-removed result",
helpImageEditBgRemove5: "Click Remove BG to start processing; status text shows Loading model → Processing → Done; supports Undo (Ctrl+Z)",
helpImageEditTabKbdTitle: "Image Edit Tab Shortcuts",
helpShortcutsTitle: "Keyboard Shortcuts",
helpShortcuts1: "Escape: Close modal/panel",
@@ -1522,7 +1540,7 @@ const LANGUAGES = {
helpGen2: "Workflowタブからワークフローを読み込み(App形式 .app.json は非対応)。Reset Workflowボタンは現在のワークフローファイルをディスクから再読込してエディタをリロード。Saveボタン(タブバー右端)はエディタでの編集を含む現在のワークフローを新しい.jsonファイルとしてWorkflowタブに保存(現在のワークフロー名を初期値としたファイル名ダイアログを表示)",
helpGen3: "5タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder、Batch — Input/Model/SettingsタブにはRaw JSON列を常時表示",
helpGen4: "Inputタブ:Prompt・Imageの内部タブ切り替え;PromptタブにはPositive Prompt・Negative Promptに加え最下部にEmbeddingsセレクタを表示(Filter+セレクト+Weight入力+Pasteボタン)— Pasteは最後にフォーカスしたテキストエリアのカーソル位置に(embedding:Name:weight)を挿入(未フォーカス時はPositiveに追加)",
helpGen5: "Modelタブ:Checkpoint/VAE/LoRA(Single/Stackタブ)/ControlNet/UNET/TextEncoder/Hypernetwork(Strength入力付き)のセレクタ(フィルタ検索付き)",
helpGen5: "Modelタブ:Checkpoint/VAE/LoRA(Single/Stackタブ)/ControlNet/Diffusion Model(UNETLoader / UnetLoaderGGUF / LoaderGGUF対応)/Text Encoder(CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF対応 — typeおよびdevice選択付き、DualCLIPは2段モデル選択)/Hypernetwork(Strength入力付き)のセレクタ(フィルタ検索付き)",
helpGen6: "Settingsタブ:KSamplerとLatent Imageを横並び(各50%幅)",
helpGen7: "Raw JSONを各タブの右列に常時表示 — 直接編集してApplyでワークフロー即時反映",
helpGen8: "シード管理:ランダム / 固定 / 増加 / 減少",
@@ -1534,6 +1552,7 @@ const LANGUAGES = {
helpGen14: "Batchタブ — 右ペイン(バッチキュー):6列構成 — Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler;各列にチェックボックスがあり1種類のみ有効化可能(ラジオ動作);各列に件数を表示",
helpGen15: "Sampler/Schedulerバッチ:左ペインでサンプラーまたはスケジューラーを選択し、バッチキューの対応列を有効化してGenerateを実行;選択した値を順番にKSamplerノードに適用して生成;リストはComfyUIから取得(要接続)",
helpGen16: "SPAサイドのワイルドカード展開(A1111スタイル):ImpactWildcard系以外のノード(CLIPTextEncodeなど)のプロンプトに__name__構文が含まれる場合、生成時にSPA側がWFSワイルドカードフォルダの対応ファイルからランダムに1行選んで展開;ネストしたワイルドカードは最大5パスまで再展開;見つからないワイルドカードはそのまま送信;ImpactWildcardEncode/ProcessorノードはスキップしてComfyUIサーバー側(Impact Pack)が処理;単体生成・バッチ生成どちらでも機能",
helpGen17: "スタイルバッチ:左ペインのStyleタブでスタイルを選択し、バッチキューのStyle列を有効化してGenerateを実行 — 選択した各スタイルをPositiveおよびNegativeプロンプトに順番に適用;ワークフローコピーに適用されるため読み込み済みワークフローは変更されない;スタイルファイルはページロードのたびに user/default/Workflow-Studio/style/*.json から再読み込み",
helpFeederTitle: "GenerateUI Tab — Feeder サブタブ",
helpFeederDesc: "左ペイン上部の [Image Loop] / [Gallery] トグルで2つのモードを切り替えられます。",
helpFeederImgloopTitle: "Image Loop モード",
@@ -1611,6 +1630,8 @@ const LANGUAGES = {
helpGallery12: "Metadataボタン(緑、詳細パネルのタブバー内):選択画像をMetadataタブで開いて埋め込みデータを詳細確認。画像サムネイルのAlt+クリックでも同じ操作が可能",
helpGallery13: "Load GenUIボタン(青、詳細パネルのタブバー内):選択画像に埋め込まれたComfyUIワークフローをGenerateUIタブへ直接読み込んで切り替え。ワークフローが埋め込まれていない場合や非対応形式の場合は警告トーストを表示",
helpGallery14: "Taggerボタン(紫、詳細パネルのアクション行):選択画像をTaggerタブのSingleモードで直接開き、即座にタグ付けを開始できる",
helpGallery15: "Fボタン(シアン色オーバーレイ、各サムネイル左上):クリック一つで画像を __Feeder__ グループに追加/削除;グループ内の場合は常にシアン色で表示、非グループ時はホバー時のみ表示;FeederタブのGalleryモードへ素早く画像を追加できる",
helpGallery16: "Image Editボタン(ツールバー、Refreshボタン横):選択中の画像をImage Editタブに送信;既にレイヤーが存在する場合はキャンバスに合わせてスケールして新規レイヤーとして追加、存在しない場合はLayer 1になる",
// -- Tagger Tab --
helpTaggerTitle: "Taggerタブ",
@@ -1685,6 +1706,21 @@ const LANGUAGES = {
helpImageEdit28: "Space + ドラッグ:キャンバスをパン",
helpImageEdit29: "マウスホイール:ズームイン / アウト",
helpImageEdit30: "ダブルクリック(Selectツールでテキストレイヤー):テキストを再編集",
helpImageEdit7b: "Blur (≈):アクティブレイヤーにガウスぼかしまたはモザイクを適用 — 全体またはドラッグで矩形範囲指定;詳細は下の「Blur Tool」カードを参照",
helpImageEdit7c: "BG Remove (⬚):Lightweight(@imgly、ブラウザ内処理)またはBiRefNet(Pythonバックエンド、近日追加)でアクティブレイヤーの背景を除去;詳細は下の「BG Remove Tool」カードを参照",
helpImageEditBlurTitle: "Blur ツール (≈)",
helpImageEditBlur1: "Whole Blur:アクティブレイヤー全体にガウスぼかしを適用 — 強度スライダー(1〜50 px)で調整してApplyをクリック",
helpImageEditBlur2: "Whole Mosaic:アクティブレイヤー全体にピクセル化モザイクを適用 — ブロックサイズスライダー(5〜100 px)で調整してApplyをクリック",
helpImageEditBlur3: "Rect Blur:トグルをクリックして矩形モードに入る(ボタンが青く点灯)、キャンバス上でドラッグして矩形範囲を選択 — リリース時に選択範囲がぼかされる;モード有効化前後どちらでも強度を調整できる",
helpImageEditBlur4: "Rect Mosaic:Rect Blurと同様だがモザイクを適用;プレビューのアウトラインは橙色;スライダーでブロックサイズを調整",
helpImageEditBlur5: "Rect BlurとRect Mosaicは排他的 — 一方を有効にするともう一方は無効になる;アクティブなトグルを再クリックすると矩形モードを終了",
helpImageEditBlur6: "全操作でUndo(Ctrl+Z)に対応",
helpImageEditBgRemoveTitle: "BG Remove ツール (⬚)",
helpImageEditBgRemove1: "モデル — Lightweight(@imgly):CDNから読み込む @imgly/background-removal ライブラリを使用してブラウザ内で処理;サーバー不要;初回使用時にモデル(約40 MB)をダウンロードしてセッション中にキャッシュ",
helpImageEditBgRemove2: "モデル — BiRefNet:Workflow Studio Pythonバックエンド経由でBiRefNetモデルを使用する高品質な背景除去;ComfyUI/models/background_removal/ に birefnet.safetensors が必要(近日対応)",
helpImageEditBgRemove3: "New Layer(デフォルトON):結果をアクティブレイヤーの上に同じ位置・表示サイズの新規レイヤーとして追加 — 元レイヤーは保持",
helpImageEditBgRemove4: "New LayerをOFFにすると、アクティブレイヤーのキャンバスが背景除去済みの結果で直接置き換えられる",
helpImageEditBgRemove5: "Remove BGをクリックして処理開始;ステータステキストに「Loading model → Processing → Done」と表示;Undo(Ctrl+Z)に対応",
helpImageEditTabKbdTitle: "Image Edit タブのショートカット",
helpShortcutsTitle: "キーボード操作",
helpShortcuts1: "Escape:モーダル・パネルを閉じる",
@@ -2440,7 +2476,7 @@ const LANGUAGES = {
helpGen2: "从工作流标签页加载工作流(不支持App格式.app.json)。Reset Workflow按钮从磁盘重新读取当前工作流文件并重新加载编辑器。Save按钮(标签栏右端)将当前工作流(包括在编辑器中所做的编辑)保存为新的.json文件到工作流标签页;会显示以当前工作流名称为默认值的文件名对话框",
helpGen3: "5标签布局 — Input(提示词+图像)、Model、Settings、Feeder、Batch — Input/Model/Settings各含实时预览和直接编辑的Raw JSON列",
helpGen4: "Input标签:含Prompt和Image子标签(拖放上传);Prompt标签显示Positive Prompt、Negative Prompt,以及底部的Embeddings选择器(过滤+下拉+权重+Paste按钮)— Paste将(embedding:Name:weight)插入最后聚焦文本框的光标位置(未聚焦时默认追加到Positive)",
helpGen5: "Model标签:Checkpoint/VAE/LoRA(Single/Stack标签)/ControlNet/UNET/TextEncoder/Hypernetwork(带Strength输入)选择器(含筛选)",
helpGen5: "Model标签:Checkpoint/VAE/LoRA(Single/Stack标签)/ControlNet/Diffusion Model(支持UNETLoader / UnetLoaderGGUF / LoaderGGUF)/Text Encoder(支持CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — 含type和device选择器,DualCLIP显示两段模型选择)/Hypernetwork(带Strength输入)选择器(含筛选)",
helpGen6: "Settings标签:KSampler与Latent Image并排显示(各占50%宽度)",
helpGen7: "Raw JSON在每个标签右列常驻显示 — 直接编辑并Apply即时重载工作流",
helpGen8: "种子管理:随机/固定/递增/递减",
@@ -2452,6 +2488,7 @@ const LANGUAGES = {
helpGen14: "Batch标签 — 右窗格(批量队列):6列 — Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler;每列有启用复选框(单选行为,每次仅一种);每列显示数量",
helpGen15: "Sampler/Scheduler批次:在左窗格选择采样器或调度器,启用批次队列对应列后点击Generate;依次将每个值应用到KSampler节点逐一生成;列表从ComfyUI获取(需已连接)",
helpGen16: "SPA端通配符展开(A1111风格):当非ImpactWildcard系节点(如CLIPTextEncode)的提示词中含有__name__语法时,SPA在生成时从WFS通配符文件夹的对应文件中随机选取一行展开;嵌套通配符最多重复展开5次;未找到的通配符原样传递;ImpactWildcardEncode/Processor节点跳过(由ComfyUI服务端Impact Pack处理);单次生成和批量生成均有效",
helpGen17: "样式批处理:在左窗格Style标签中选择样式,启用批次队列Style列后点击Generate — 每个选中样式依次应用到正向和负向提示词;样式应用于工作流副本,不会修改已加载的工作流;每次页面加载时从 user/default/Workflow-Studio/style/*.json 重新读取样式文件",
helpFeederTitle: "GenerateUI Tab — Feeder 子标签",
helpFeederDesc: "通过左侧面板顶部的 [图片循环] / [图库] 切换按钮可在两种模式间切换。",
helpFeederImgloopTitle: "图片循环模式",
@@ -2529,6 +2566,8 @@ const LANGUAGES = {
helpGallery12: "Metadata按钮(绿色,位于详情面板标签栏):在Metadata标签中打开所选图像以全面查看嵌入数据;Alt+点击任意图像缩略图效果相同",
helpGallery13: "Load GenUI按钮(蓝色,位于详情面板标签栏):将所选图像中嵌入的ComfyUI工作流直接加载到GenerateUI标签并切换过去;如果没有嵌入工作流或格式不受支持,则显示警告提示",
helpGallery14: "Tagger按钮(紫色,位于详情面板操作行):将所选图像直接在Tagger标签的Single模式中打开,即可立即进行标注",
helpGallery15: "F按钮(青色悬浮按钮,每个缩略图左上角):单击即可将图像添加到/从__Feeder__组中移除;图像在组中时始终显示青色,不在组中时仅悬停时可见;可快速为Feeder标签Gallery模式添加队列图像",
helpGallery16: "Image Edit按钮(工具栏,Refresh按钮旁):将当前选中的图像发送到Image Edit标签;如果已有图层则按比例缩放添加为新图层,否则将成为Layer 1",
// -- Tagger Tab --
helpTaggerTitle: "Tagger标签",
@@ -2603,6 +2642,21 @@ const LANGUAGES = {
helpImageEdit28: "Space+拖动:平移画布",
helpImageEdit29: "鼠标滚轮:放大/缩小",
helpImageEdit30: "双击(Select工具点击文字图层):重新编辑文字",
helpImageEdit7b: "Blur (≈):对活动图层应用高斯模糊或马赛克 — 整层或拖动矩形区域;详细内容参见下方「Blur Tool」卡片",
helpImageEdit7c: "BG Remove (⬚):使用Lightweight(@imgly,在浏览器中运行)或BiRefNet(Python后端,即将推出)去除活动图层背景;详细内容参见下方「BG Remove Tool」卡片",
helpImageEditBlurTitle: "Blur 工具 (≈)",
helpImageEditBlur1: "Whole Blur:对整个活动图层应用高斯模糊 — 调整强度滑块(1–50 px),点击Apply",
helpImageEditBlur2: "Whole Mosaic:对整个活动图层应用像素化马赛克 — 调整块大小滑块(5–100 px),点击Apply",
helpImageEditBlur3: "Rect Blur:点击切换按钮进入矩形模式(按钮变蓝),在画布上拖动绘制矩形 — 释放后对选区应用模糊;可在启用模式前后调整强度",
helpImageEditBlur4: "Rect Mosaic:与Rect Blur相同但应用马赛克;预览轮廓为橙色;用滑块调整块大小",
helpImageEditBlur5: "Rect Blur和Rect Mosaic互斥 — 启用一个会禁用另一个;再次点击活动切换按钮退出矩形模式",
helpImageEditBlur6: "所有操作均支持撤销(Ctrl+Z)",
helpImageEditBgRemoveTitle: "BG Remove 工具 (⬚)",
helpImageEditBgRemove1: "模型 — Lightweight(@imgly):使用从CDN加载的@imgly/background-removal库在浏览器内处理;无需服务器;首次使用时下载模型(约40 MB)并在会话期间缓存",
helpImageEditBgRemove2: "模型 — BiRefNet:通过Workflow Studio Python后端使用BiRefNet模型进行高质量背景去除;需要将birefnet.safetensors放置在ComfyUI/models/background_removal/(即将支持)",
helpImageEditBgRemove3: "New Layer(默认勾选):结果作为新图层添加到活动图层上方,位置和显示尺寸相同 — 原始图层保留",
helpImageEditBgRemove4: "取消勾选New Layer时,活动图层的画布将被去除背景的结果直接替换",
helpImageEditBgRemove5: "点击Remove BG开始处理;状态文字显示「Loading model → Processing → Done」;支持撤销(Ctrl+Z)",
helpImageEditTabKbdTitle: "图像编辑选项卡快捷键",
helpShortcutsTitle: "键盘操作",
helpShortcuts1: "Escape:关闭弹窗/面板",
+337 -2
View File
@@ -17,13 +17,32 @@ const TOOL_DEFS = [
{ id: "text", icon: "T", label: "Text", ready: true },
{ id: "shape", icon: "□", label: "Shape", ready: true },
{ id: "mask", icon: "🎭", label: "Mask", ready: false },
{ id: "blur", icon: "≈", label: "Blur", ready: false },
{ id: "blur", icon: "≈", label: "Blur", ready: true },
{ id: "filter", icon: "★", label: "Filter", ready: false },
{ id: "bgremove", icon: "⬚", label: "BG Remove", ready: false },
{ id: "bgremove", icon: "⬚", label: "BG Remove", ready: true },
];
const UNDO_LIMIT = 20;
function _applyMosaicToRegion(ctx, x, y, w, h, size) {
if (w <= 0 || h <= 0 || size < 1) return;
const imgData = ctx.getImageData(x, y, w, h);
const d = imgData.data;
for (let py = 0; py < h; py += size) {
for (let px = 0; px < w; px += size) {
const i = (py * w + px) * 4;
const r = d[i], g = d[i + 1], b = d[i + 2], a = d[i + 3];
for (let by = py; by < Math.min(py + size, h); by++) {
for (let bx = px; bx < Math.min(px + size, w); bx++) {
const j = (by * w + bx) * 4;
d[j] = r; d[j + 1] = g; d[j + 2] = b; d[j + 3] = a;
}
}
}
}
ctx.putImageData(imgData, x, y);
}
function fitToCanvas(imgW, imgH, canvasW, canvasH) {
const scale = Math.min(1, canvasW / imgW, canvasH / imgH);
return { w: Math.round(imgW * scale), h: Math.round(imgH * scale) };
@@ -50,6 +69,11 @@ class ImageEditTab {
this._editingTextLayer = null; // テキスト再編集中のレイヤー参照
this._initialized = false;
this._shapeTool = null;
// Blur ツール
this._blurRectMode = null; // null | 'blur' | 'mosaic'
this._blurDragging = false;
this._blurDragStart = null;
this._blurDragCur = null;
}
// ── 初期化 ────────────────────────────────────
@@ -81,6 +105,15 @@ class ImageEditTab {
if (this._activeTool === "text") this._textTool?.deactivate();
if (this._activeTool === "select") this._selectTool?.deactivate();
if (this._activeTool === "shape") this._shapeTool?.deactivate();
if (this._activeTool === "blur") {
this._blurRectMode = null;
this._blurDragging = false;
const overlay = document.getElementById("ie-canvas-overlay");
if (overlay) {
overlay.style.cursor = "";
overlay.getContext("2d").clearRect(0, 0, overlay.width, overlay.height);
}
}
this._activeTool = toolId;
@@ -109,6 +142,8 @@ class ImageEditTab {
this._shapeTool.setCanvas(overlayCanvas);
this._shapeTool.activate();
if (overlayCanvas) overlayCanvas.style.cursor = "crosshair";
} else if (this._activeTool === "blur") {
if (overlayCanvas) overlayCanvas.style.cursor = this._blurRectMode ? "crosshair" : "default";
}
}
@@ -350,6 +385,98 @@ class ImageEditTab {
});
document.getElementById("ie-shape-undo-btn")?.addEventListener("click", () => this._undo());
} else if (toolId === "blur") {
const blurOn = this._blurRectMode === "blur";
const mosaicOn = this._blurRectMode === "mosaic";
el.innerHTML = `
<div class="ie-opt-group">
<span style="font-size:11px;color:var(--wfm-text-secondary);">Whole:</span>
</div>
<div class="ie-opt-group">
<label style="font-size:11px;">Blur</label>
<input type="range" id="ie-whole-blur" min="1" max="50" value="10" style="width:70px;">
<span id="ie-whole-blur-val" style="font-size:11px;min-width:22px;">10</span>px
<button class="wfm-btn wfm-btn-sm" id="ie-whole-blur-apply">Apply</button>
</div>
<div class="ie-opt-group">
<label style="font-size:11px;">Mosaic</label>
<input type="range" id="ie-whole-mosaic" min="5" max="100" value="20" style="width:70px;">
<span id="ie-whole-mosaic-val" style="font-size:11px;min-width:22px;">20</span>px
<button class="wfm-btn wfm-btn-sm" id="ie-whole-mosaic-apply">Apply</button>
</div>
<div style="width:1px;height:22px;background:var(--wfm-border);margin:0 6px;flex-shrink:0;"></div>
<div class="ie-opt-group">
<span style="font-size:11px;color:var(--wfm-text-secondary);">Rect:</span>
</div>
<div class="ie-opt-group">
<button class="wfm-btn wfm-btn-sm${blurOn ? " ie-opt-active" : ""}" id="ie-rect-blur-toggle"
style="${blurOn ? "background:var(--wfm-accent,#4682e6);color:#fff;" : ""}">
Rect Blur: ${blurOn ? "ON" : "OFF"}
</button>
<input type="range" id="ie-rect-blur" min="1" max="50" value="10" style="width:70px;">
<span id="ie-rect-blur-val" style="font-size:11px;min-width:22px;">10</span>px
</div>
<div class="ie-opt-group">
<button class="wfm-btn wfm-btn-sm${mosaicOn ? " ie-opt-active" : ""}" id="ie-rect-mosaic-toggle"
style="${mosaicOn ? "background:var(--wfm-accent,#4682e6);color:#fff;" : ""}">
Rect Mosaic: ${mosaicOn ? "ON" : "OFF"}
</button>
<input type="range" id="ie-rect-mosaic" min="5" max="50" value="15" style="width:70px;">
<span id="ie-rect-mosaic-val" style="font-size:11px;min-width:22px;">15</span>px
</div>
`;
document.getElementById("ie-whole-blur")?.addEventListener("input", e => {
document.getElementById("ie-whole-blur-val").textContent = e.target.value;
});
document.getElementById("ie-whole-mosaic")?.addEventListener("input", e => {
document.getElementById("ie-whole-mosaic-val").textContent = e.target.value;
});
document.getElementById("ie-whole-blur-apply")?.addEventListener("click", () => {
this._applyWholeBlur(parseInt(document.getElementById("ie-whole-blur").value));
});
document.getElementById("ie-whole-mosaic-apply")?.addEventListener("click", () => {
this._applyWholeMosaic(parseInt(document.getElementById("ie-whole-mosaic").value));
});
document.getElementById("ie-rect-blur-toggle")?.addEventListener("click", () => {
this._blurRectMode = this._blurRectMode === "blur" ? null : "blur";
this._renderToolOptions("blur");
const ov = document.getElementById("ie-canvas-overlay");
if (ov) ov.style.cursor = this._blurRectMode ? "crosshair" : "default";
});
document.getElementById("ie-rect-mosaic-toggle")?.addEventListener("click", () => {
this._blurRectMode = this._blurRectMode === "mosaic" ? null : "mosaic";
this._renderToolOptions("blur");
const ov = document.getElementById("ie-canvas-overlay");
if (ov) ov.style.cursor = this._blurRectMode ? "crosshair" : "default";
});
document.getElementById("ie-rect-blur")?.addEventListener("input", e => {
document.getElementById("ie-rect-blur-val").textContent = e.target.value;
});
document.getElementById("ie-rect-mosaic")?.addEventListener("input", e => {
document.getElementById("ie-rect-mosaic-val").textContent = e.target.value;
});
} else if (toolId === "bgremove") {
el.innerHTML = `
<div class="ie-opt-group">
<label>Model</label>
<select id="ie-bgremove-model" class="ie-opt-select">
<option value="imgly">Lightweight (@imgly)</option>
<option value="birefnet" disabled>BiRefNet (coming soon)</option>
</select>
</div>
<div class="ie-opt-group">
<label style="font-size:11px;cursor:pointer;">
<input type="checkbox" id="ie-bgremove-new-layer" checked> New Layer
</label>
</div>
<div class="ie-opt-group">
<button class="wfm-btn wfm-btn-sm" id="ie-bgremove-btn">Remove BG</button>
</div>
<span id="ie-bgremove-status" style="font-size:11px;color:var(--wfm-text-secondary);margin-left:4px;"></span>
`;
document.getElementById("ie-bgremove-btn")?.addEventListener("click", () => this._applyBgRemove());
} else {
const def = TOOL_DEFS.find(d => d.id === toolId);
el.innerHTML = `<span style="font-size:12px;color:var(--wfm-text-secondary);">${def?.label ?? toolId}: coming soon</span>`;
@@ -465,6 +592,10 @@ class ImageEditTab {
// move / resize / rotate → undo を事前に保存
this._saveUndo();
}
} else if (this._activeTool === "blur" && this._blurRectMode) {
this._blurDragging = true;
this._blurDragStart = { x: pos.x, y: pos.y };
this._blurDragCur = { x: pos.x, y: pos.y };
}
}
@@ -474,6 +605,10 @@ class ImageEditTab {
if (this._activeTool === "draw") this._drawTool?.onMouseMove(pos.x, pos.y);
if (this._activeTool === "shape") this._shapeTool?.onMouseMove(pos.x, pos.y);
if (this._activeTool === "select") this._selectTool?.onMouseMove(pos.x, pos.y);
if (this._activeTool === "blur" && this._blurDragging) {
this._blurDragCur = pos;
this._drawBlurPreview();
}
}
_onToolMouseUp(e) {
@@ -481,12 +616,23 @@ class ImageEditTab {
if (this._activeTool === "draw") this._drawTool?.onMouseUp();
if (this._activeTool === "shape") this._shapeTool?.onMouseUp();
if (this._activeTool === "select") this._selectTool?.onMouseUp();
if (this._activeTool === "blur" && this._blurDragging) {
this._blurDragging = false;
this._applyRectEffect();
const overlay = document.getElementById("ie-canvas-overlay");
if (overlay) overlay.getContext("2d").clearRect(0, 0, overlay.width, overlay.height);
}
}
_onToolMouseLeave() {
if (this._activeTool === "draw") this._drawTool?.onMouseLeave();
if (this._activeTool === "shape") this._shapeTool?.onMouseLeave();
if (this._activeTool === "select") this._selectTool?.onMouseLeave();
if (this._activeTool === "blur" && this._blurDragging) {
this._blurDragging = false;
const overlay = document.getElementById("ie-canvas-overlay");
if (overlay) overlay.getContext("2d").clearRect(0, 0, overlay.width, overlay.height);
}
}
// ── 画像ロード ────────────────────────────────
@@ -1110,6 +1256,195 @@ class ImageEditTab {
});
ctx.restore();
}
// ── ぼかし / モザイク ─────────────────────────
_applyWholeBlur(amount) {
if (!this._layerMgr) return;
const layer = this._layerMgr.activeLayer;
if (!layer) { showToast("No active layer", "error"); return; }
this._saveUndo();
const w = layer.canvas.width, h = layer.canvas.height;
const tmp = document.createElement("canvas");
tmp.width = w; tmp.height = h;
const tc = tmp.getContext("2d");
tc.filter = `blur(${amount}px)`;
tc.drawImage(layer.canvas, 0, 0);
layer.ctx.clearRect(0, 0, w, h);
layer.ctx.drawImage(tmp, 0, 0);
this._updateCompositeView();
this._refreshLayerList();
}
_applyWholeMosaic(size) {
if (!this._layerMgr) return;
const layer = this._layerMgr.activeLayer;
if (!layer) { showToast("No active layer", "error"); return; }
this._saveUndo();
_applyMosaicToRegion(layer.ctx, 0, 0, layer.canvas.width, layer.canvas.height, size);
this._updateCompositeView();
this._refreshLayerList();
}
// canvas座標 (cx,cy) → layer.canvas 座標への逆変換
_canvasToLayerCoords(layer, cx, cy) {
const centerX = layer.x + layer.displayW / 2;
const centerY = layer.y + layer.displayH / 2;
const dx = cx - centerX, dy = cy - centerY;
const angle = -(layer.rotation || 0) * Math.PI / 180;
const rdx = dx * Math.cos(angle) - dy * Math.sin(angle);
const rdy = dx * Math.sin(angle) + dy * Math.cos(angle);
const scaleX = layer.displayW / layer.canvas.width;
const scaleY = layer.displayH / layer.canvas.height;
let lx = rdx / scaleX + layer.canvas.width / 2;
let ly = rdy / scaleY + layer.canvas.height / 2;
if (layer.flipX) lx = layer.canvas.width - lx;
if (layer.flipY) ly = layer.canvas.height - ly;
return { x: lx, y: ly };
}
_drawBlurPreview() {
const overlay = document.getElementById("ie-canvas-overlay");
if (!overlay) return;
const ctx = overlay.getContext("2d");
ctx.clearRect(0, 0, overlay.width, overlay.height);
const s = this._blurDragStart, c = this._blurDragCur;
if (!s || !c) return;
const x = Math.min(s.x, c.x), y = Math.min(s.y, c.y);
const w = Math.abs(c.x - s.x), h = Math.abs(c.y - s.y);
ctx.strokeStyle = this._blurRectMode === "blur" ? "#4af" : "#fa4";
ctx.lineWidth = 1 / this._zoom;
ctx.setLineDash([4 / this._zoom, 2 / this._zoom]);
ctx.strokeRect(x, y, w, h);
ctx.setLineDash([]);
}
_applyRectEffect() {
const layer = this._layerMgr?.activeLayer;
if (!layer || !this._blurDragStart || !this._blurDragCur) return;
const s = this._blurDragStart, c = this._blurDragCur;
if (Math.abs(c.x - s.x) < 3 || Math.abs(c.y - s.y) < 3) return;
const minX = Math.min(s.x, c.x), minY = Math.min(s.y, c.y);
const maxX = Math.max(s.x, c.x), maxY = Math.max(s.y, c.y);
const p1 = this._canvasToLayerCoords(layer, minX, minY);
const p2 = this._canvasToLayerCoords(layer, maxX, maxY);
const lx = Math.round(Math.max(0, Math.min(p1.x, p2.x)));
const ly = Math.round(Math.max(0, Math.min(p1.y, p2.y)));
const lw = Math.round(Math.min(layer.canvas.width - lx, Math.abs(p2.x - p1.x)));
const lh = Math.round(Math.min(layer.canvas.height - ly, Math.abs(p2.y - p1.y)));
if (lw <= 0 || lh <= 0) return;
this._saveUndo();
if (this._blurRectMode === "blur") {
const amount = parseInt(document.getElementById("ie-rect-blur")?.value ?? "10");
const tmp = document.createElement("canvas");
tmp.width = layer.canvas.width; tmp.height = layer.canvas.height;
const tc = tmp.getContext("2d");
tc.filter = `blur(${amount}px)`;
tc.drawImage(layer.canvas, 0, 0);
layer.ctx.drawImage(tmp, lx, ly, lw, lh, lx, ly, lw, lh);
} else {
const size = parseInt(document.getElementById("ie-rect-mosaic")?.value ?? "15");
_applyMosaicToRegion(layer.ctx, lx, ly, lw, lh, size);
}
this._updateCompositeView();
this._refreshLayerList();
}
// ── 背景除去 ─────────────────────────────────
async _bgRemoveImgly(dataUrl, onStatus) {
if (!window._wfmImglyRemoveBg) {
onStatus("Loading model...");
const mod = await import("https://esm.sh/@imgly/background-removal@1.5.7?bundle&target=es2022");
window._wfmImglyRemoveBg = mod.removeBackground;
}
onStatus("Processing...");
const res = await fetch(dataUrl);
const blob = await res.blob();
const resultBlob = await window._wfmImglyRemoveBg(blob, {
publicPath: "https://staticimgly.com/@imgly/background-removal-data/1.5.7/dist/",
});
return await new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result);
reader.onerror = reject;
reader.readAsDataURL(resultBlob);
});
}
async _bgRemoveBiRefNet(dataUrl, onStatus) {
// TODO: POST /api/wfm/bg-remove — Python backend using comfy.bg_removal_model
// Returns RGBA PNG data-URL with background removed
throw new Error("BiRefNet not yet implemented");
}
async _applyBgRemove() {
if (!this._layerMgr) { showToast("No image loaded", "error"); return; }
const layer = this._layerMgr.activeLayer;
if (!layer) { showToast("No active layer", "error"); return; }
const model = document.getElementById("ie-bgremove-model")?.value ?? "imgly";
const asNew = document.getElementById("ie-bgremove-new-layer")?.checked ?? true;
const statusEl = document.getElementById("ie-bgremove-status");
const btn = document.getElementById("ie-bgremove-btn");
const setStatus = msg => { if (statusEl) statusEl.textContent = msg; };
if (btn) btn.disabled = true;
setStatus("Starting...");
try {
const dataUrl = layer.canvas.toDataURL("image/png");
let resultDataUrl;
if (model === "imgly") {
resultDataUrl = await this._bgRemoveImgly(dataUrl, setStatus);
} else {
resultDataUrl = await this._bgRemoveBiRefNet(dataUrl, setStatus);
}
const img = await new Promise((resolve, reject) => {
const i = new Image();
i.onload = () => resolve(i);
i.onerror = () => reject(new Error("Result image load failed"));
i.src = resultDataUrl;
});
this._saveUndo();
if (asNew) {
const newL = this._layerMgr.addLayer("image", layer.name + " (no bg)", {
contentW: img.width, contentH: img.height,
displayW: layer.displayW, displayH: layer.displayH,
x: layer.x, y: layer.y,
});
newL.ctx.drawImage(img, 0, 0);
this._layerMgr.setActive(newL.id);
if (this._activeTool === "select") this._selectTool?.setLayer(newL);
} else {
layer.canvas.width = img.width;
layer.canvas.height = img.height;
layer.ctx = layer.canvas.getContext("2d");
layer.ctx.drawImage(img, 0, 0);
}
this._updateCompositeView();
this._refreshLayerList();
setStatus("Done!");
setTimeout(() => setStatus(""), 3000);
showToast("Background removed", "success");
} catch (err) {
setStatus("Error: " + err.message);
showToast("BG remove failed: " + err.message, "error");
} finally {
if (btn) btn.disabled = false;
}
}
}
export const imageEditTab = new ImageEditTab();
+14 -5
View File
@@ -157,17 +157,26 @@ function applyToGenUI(modelName, modelType) {
} else {
const { key, inputKey } = mapping;
const nodeId = Object.keys(comfyUI.currentWorkflow).find((id) => {
const node = comfyUI.currentWorkflow[id];
return node.inputs && inputKey in node.inputs;
});
// unet タイプは LoaderGGUF (gguf_name)、textencoder タイプは CLIPLoader (clip_name) も対応
const searchKeys = modelType === "unet" ? [inputKey, "gguf_name"]
: modelType === "textencoder" ? [inputKey, "clip_name"]
: [inputKey];
let nodeId = null;
let actualInputKey = inputKey;
for (const ik of searchKeys) {
nodeId = Object.keys(comfyUI.currentWorkflow).find((id) => {
const node = comfyUI.currentWorkflow[id];
return node.inputs && ik in node.inputs;
});
if (nodeId) { actualInputKey = ik; break; }
}
if (!nodeId) {
showToast(t("modelsGenUINoNode", TYPE_LABELS[modelType] || modelType), "warning");
return;
}
comfyUI.currentWorkflow[nodeId].inputs[inputKey] = modelName;
comfyUI.currentWorkflow[nodeId].inputs[actualInputKey] = modelName;
selectEl = document.getElementById(`wfm-model-${key}`);
}
+51 -6
View File
@@ -260,6 +260,11 @@
<button id="wfm-gen-connect-btn" class="wfm-btn wfm-btn-sm">Connect</button>
<button id="wfm-gen-model-refresh-btn" class="wfm-btn wfm-btn-sm">Refresh Models</button>
<button id="wfm-gen-reset-workflow-btn" class="wfm-btn wfm-btn-sm">Reset Workflow</button>
<label id="wfm-style-label" style="display:flex;align-items:center;gap:4px;font-size:12px;cursor:pointer;white-space:nowrap;">
<input type="checkbox" id="wfm-style-enabled" style="cursor:pointer;">
Style
</label>
<select id="wfm-style-select" class="wfm-input" style="font-size:12px;padding:2px 6px;height:26px;min-width:120px;max-width:220px;"></select>
</div>
<div class="wfm-toolbar-right" style="display:flex;align-items:center;gap:8px;">
<span id="wfm-gen-wf-name" style="color:var(--wfm-text-secondary);font-size:13px;">No workflow loaded</span>
@@ -344,6 +349,7 @@
<button class="wfm-batch-left-tab active" data-left-tab="checkpoint">Checkpoints</button>
<button class="wfm-batch-left-tab" data-left-tab="sampler">Sampler</button>
<button class="wfm-batch-left-tab" data-left-tab="scheduler">Scheduler</button>
<button class="wfm-batch-left-tab" data-left-tab="style">Style</button>
</div>
<div id="wfm-batch-left-checkpoint" class="wfm-batch-left-content active">
<div class="wfm-batch-toolbar">
@@ -367,6 +373,13 @@
</div>
<div id="wfm-scheduler-list" class="wfm-batch-list"></div>
</div>
<div id="wfm-batch-left-style" class="wfm-batch-left-content">
<div class="wfm-batch-toolbar">
<button type="button" id="wfm-style-batch-select-all" class="wfm-btn wfm-btn-sm">All</button>
<button type="button" id="wfm-style-batch-deselect-all" class="wfm-btn wfm-btn-sm">None</button>
</div>
<div id="wfm-batch-style-list" class="wfm-batch-list"></div>
</div>
</div>
<!-- Center pane: group-based selection with inner tabs -->
@@ -447,6 +460,14 @@
<div id="wfm-batch-scheduler-count" class="wfm-batch-count"></div>
<div id="wfm-batch-scheduler-list" class="wfm-batch-preview-list"></div>
</div>
<div class="wfm-batch-queue-col">
<div class="wfm-batch-queue-col-header">
<span>Style</span>
<input type="checkbox" class="wfm-batch-type-cb" data-batch-type="style" title="Style batch を有効にする">
</div>
<div id="wfm-batch-style-count" class="wfm-batch-count"></div>
<div id="wfm-batch-style-preview-list" class="wfm-batch-preview-list"></div>
</div>
</div>
</div>
</div>
@@ -1037,20 +1058,21 @@
<h3>GenerateUI Tab</h3>
<ul>
<li id="wfm-help-gen-1">Connect/disconnect ComfyUI and check connection status</li>
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor; <b>Save</b> button (right end of the tab bar) saves the current workflow — including any edits made in the editor — as a new .json file to the Workflow tab; a filename dialog appears with the current workflow name as the default</li>
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor; <b>Save</b> button (right end of the tab bar) saves the current workflow — including any edits made in the editor — as a new .json file to the Workflow tab; a filename dialog appears with the current workflow name as the default; <b>Style</b> checkbox and dropdown (next to Reset Workflow): enable to apply a Fooocus-style JSON style to the positive and negative prompts at generation time — style files are loaded from <code>user/default/Workflow-Studio/style/*.json</code>; the style's <code>{prompt}</code> placeholder is replaced with the original prompt, or the style text is appended if no placeholder exists</li>
<li id="wfm-help-gen-3">5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
<li id="wfm-help-gen-4">Input tab: inner tabs — <b>Prompt</b> and <b>Image</b> (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an <b>Embeddings</b> selector at the bottom — select a model, set Weight (default 1.0), then click <b>Paste</b> to insert <code>(embedding:Name:weight)</code> at the cursor position of the last focused textarea (defaults to Positive if neither is focused)</li>
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA, ControlNet, UNET, TextEncoder, <b>Hypernetwork</b> (with Strength field) selectors with filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones</li>
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA (Single/Stack tabs), ControlNet, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors), Hypernetwork (with Strength field) selectors with filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones</li>
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
<li id="wfm-help-gen-7">Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow</li>
<li id="wfm-help-gen-8">Seed control: random, fixed, increment, decrement — seed input and mode selector stacked vertically for readability</li>
<li id="wfm-help-gen-9">Generate, progress display, stop, and view results</li>
<li id="wfm-help-gen-10">Eagle integration: auto-save generated images to Eagle</li>
<li id="wfm-help-gen-11">Batch tab — enable one batch type at a time by checking the checkbox in the Batch Queue column header; Generate then runs through all queued items sequentially with Pause/Resume and Stop controls</li>
<li id="wfm-help-gen-12">Batch tab — Left pane has 3 tabs: <b>Checkpoints</b> (folder tree with Filter/All/None; (root) header checkbox selects all), <b>Sampler</b> (KSampler sampler_name list with (root) checkbox), <b>Scheduler</b> (KSampler scheduler list with (root) checkbox); All/None toolbar buttons also available for each tab</li>
<li id="wfm-help-gen-12">Batch tab — Left pane has 4 tabs: <b>Checkpoints</b> (folder tree with Filter/All/None; (root) header checkbox selects all), <b>Sampler</b> (KSampler sampler_name list with (root) checkbox), <b>Scheduler</b> (KSampler scheduler list with (root) checkbox), <b>Style</b> (flat list of all styles loaded from <code>Workflow-Studio/style/</code> with All/None buttons); All/None toolbar buttons available for each tab</li>
<li id="wfm-help-gen-13">Batch tab — Center pane: group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint tab shows groups defined in the Models tab — check a group header to select all its members, or expand ▶ to check individual models; group membership always reflects the current Models tab state</li>
<li id="wfm-help-gen-14">Batch tab — Right pane (Batch Queue): 6 columns — Checkpoint, Lora, Prompt, Workflow, Sampler, Scheduler; each column has an enable checkbox; only one type active at a time; count shown per column</li>
<li id="wfm-help-gen-14">Batch tab — Right pane (Batch Queue): 7 columns — Checkpoint, Lora, Prompt, Workflow, Sampler, Scheduler, <b>Style</b>; each column has an enable checkbox; only one type active at a time; count shown per column</li>
<li id="wfm-help-gen-15">Sampler/Scheduler batch: select one or more samplers or schedulers from the left pane, enable the column in Batch Queue, then Generate to run each value through the KSampler node sequentially; sampler/scheduler lists are fetched from ComfyUI (requires connection)</li>
<li id="wfm-help-gen-17">Style batch: select styles in the left pane Style tab, enable the Style column in Batch Queue, then Generate — each selected style is applied in sequence to the positive and negative prompts; styles are applied to workflow copies so the loaded workflow is not modified; style files are re-read each time the page loads from <code>user/default/Workflow-Studio/style/*.json</code></li>
<li id="wfm-help-gen-16">SPA-side wildcard expansion (A1111-style): when prompt text in non-ImpactWildcard nodes (e.g. CLIPTextEncode) contains __name__ syntax, the SPA expands it at generation time by randomly picking a line from the matching file in the WFS wildcard folder; nested wildcards are re-expanded up to 5 passes; unresolved wildcards are passed through unchanged; ImpactWildcardEncode/Processor nodes are skipped (handled server-side by Impact Pack); works in both single and batch generation</li>
</ul>
</div>
@@ -1270,6 +1292,8 @@
<li id="wfm-help-imageedit-5">Draw (B): freehand brush drawing onto the active draw layer; Tool Options: color, brush size, blend mode</li>
<li id="wfm-help-imageedit-6">Text (T): click on the canvas to place a text input overlay; configure font family, size, bold/italic, align, color in the Tool Options bar; click OK to place the text as an exact-size Text layer; double-click an existing text layer with the Select tool to re-edit</li>
<li id="wfm-help-imageedit-7">Shape (S): draw geometric shapes onto the canvas; each committed shape becomes an independent draw layer; Tool Options: Shape type (Rect / Ellipse / Line / FreeLine), Rounded checkbox (Rect / Ellipse only), Fill color + None toggle (hidden for Line / FreeLine), Stroke color + width + None toggle (None hidden for Line / FreeLine where stroke is always active), Opacity slider, ↩ Undo button; drag to draw — a blue dashed outline previews the shape; release to commit</li>
<li id="wfm-help-imageedit-7b">Blur (≈): apply Gaussian blur or mosaic to the active layer — whole-layer or region-based (drag a rectangle); see the Blur Tool card below for details</li>
<li id="wfm-help-imageedit-7c">BG Remove (⬚): remove the background from the active layer using Lightweight (@imgly, runs in browser) or BiRefNet (Python backend, coming soon); see the BG Remove Tool card below for details</li>
</ul>
</div>
<div class="wfm-help-card">
@@ -1283,6 +1307,27 @@
<li id="wfm-help-imageedit-13">Delete key: removes the selected layer (only when 2+ layers exist)</li>
</ul>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-imageedit-blur-title">Blur Tool (≈)</h3>
<ul>
<li id="wfm-help-imageedit-blur-1">Whole Blur: applies a Gaussian blur to the entire active layer — adjust the intensity slider (1–50 px) and click Apply</li>
<li id="wfm-help-imageedit-blur-2">Whole Mosaic: applies a pixelation mosaic to the entire active layer — adjust the block size slider (5–100 px) and click Apply</li>
<li id="wfm-help-imageedit-blur-3">Rect Blur: click the toggle to enter rect mode (button turns blue), then drag on the canvas to draw a rectangle — the selected region is blurred on release; adjust intensity before or after enabling the mode</li>
<li id="wfm-help-imageedit-blur-4">Rect Mosaic: same as Rect Blur but applies mosaic; preview outline is orange; adjust block size with the slider</li>
<li id="wfm-help-imageedit-blur-5">Rect Blur and Rect Mosaic are mutually exclusive — enabling one disables the other; click the active toggle again to exit rect mode</li>
<li id="wfm-help-imageedit-blur-6">All operations support Undo (Ctrl+Z)</li>
</ul>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-imageedit-bgremove-title">BG Remove Tool (⬚)</h3>
<ul>
<li id="wfm-help-imageedit-bgremove-1">Model — Lightweight (@imgly): runs entirely in the browser using the @imgly/background-removal library loaded from CDN; no server required; first use downloads the model (~40 MB) and caches it for the session</li>
<li id="wfm-help-imageedit-bgremove-2">Model — BiRefNet: high-quality background removal using the BiRefNet model via the Workflow Studio Python backend; requires birefnet.safetensors placed in ComfyUI/models/background_removal/ (coming soon)</li>
<li id="wfm-help-imageedit-bgremove-3">New Layer (checked by default): the result is added as a new layer above the active layer at the same position and display size — the original layer is preserved</li>
<li id="wfm-help-imageedit-bgremove-4">When New Layer is unchecked, the active layer's canvas is replaced in-place with the background-removed result</li>
<li id="wfm-help-imageedit-bgremove-5">Click Remove BG to start processing; status text shows Loading model → Processing → Done; supports Undo (Ctrl+Z)</li>
</ul>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-imageedit-text-title">Text Object Quality</h3>
<ul>
@@ -1533,9 +1578,9 @@
<button class="ie-tool-btn" data-tool="text" title="Text (T)">T</button>
<button class="ie-tool-btn" data-tool="shape" title="Shape (S)">□</button>
<button class="ie-tool-btn ie-tool-placeholder" data-tool="mask" title="Mask">🎭</button>
<button class="ie-tool-btn ie-tool-placeholder" data-tool="blur" title="Blur">≈</button>
<button class="ie-tool-btn" data-tool="blur" title="Blur">≈</button>
<button class="ie-tool-btn ie-tool-placeholder" data-tool="filter" title="Filter">★</button>
<button class="ie-tool-btn ie-tool-placeholder" data-tool="bgremove" title="BG Remove">⬚</button>
<button class="ie-tool-btn" data-tool="bgremove" title="BG Remove">⬚</button>
</div>
<!-- Center -->