Compare commits

...
11 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 4.6 cbec20633e release: v0.3.65 — Mask Editor One 連携修正・トップバーアイコン修正・Mask ABRブラシ対応
- Mask Editor One store_image API フィールド名不一致修正 (image_b64 → bg_image_b64、後方互換対応)
- トップバーアイコン消滅バグ修正: MutationObserver でVue再レンダリング後もSVGを再適用
- Mask Tool ABRブラシライブラリ対応 (Mask Editor One v0.1.9+ 必須)
  - プロパティパネルに Select ボタン・Spacing・Angle・Sz Jitter・Rot. Jitter コントロール追加
  - ABRボタンをオプションバーからプロパティパネルに移動
  - ブラシサイズJitter時の0px防止 (IndexSizeError修正)
- Mask ブラシカーソルをキャンバス外では非表示に
- ヘルプ更新: Mask Tool (SAM3・ABRブラシ) / BG Remove (BiRefNet) / i18n 3言語
- README 更新: v0.3.65 / Mask Editor One 必須要件・機能説明追記
- DEVLOG 更新: v0.3.65 エントリ追加

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 12:04:20 +09:00
ketle-manandClaude Sonnet 4.6 8b82a3103d feat: Image Edit mask Add/Subtract, BiRefNet BG Remove, SAM3 segmentation
- LayerManager: add `operation` property (add/subtract) to mask layers with toJSON/fromJSON support and toggleOperation()
- _updateCompositeView: detect consecutive maskApply mask groups, composite with lighten(add)/destination-out(subtract) matching Mask Editor One logic
- Layer panel: A/S toggle button on mask layers (green=add, red=subtract); sync MaskTool.mode on layer select
- BG Remove: BiRefNet option via Mask Editor One API (store_image → birefnet/remove_bg → grayscale-to-RGBA)
- Mask tool: SAM3 button with text prompt, max masks selector, multi-select thumbnails, Add/Erase mode, Apply Selected
- Bugfix: maskApply mask at layers end (no target) now falls back to overlay-only instead of disappearing
- Bugfix: brush cursor dot appearing outside Image Edit tab (rect.width===0 guard)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 16:15:29 +09:00
ketle-manandClaude Sonnet 4.6 d70905d032 fix: Image Edit ツールメニューを画像読み込み前にも表示
Select/Draw/Text/Shape の _renderToolOptions 条件に
this._xxxTool の存在チェックが含まれており、画像読み込み前は
全ツールが null → else(coming soon)に落ちていた。

コンストラクタでデフォルト値で早期初期化することで修正。
_initCanvases() での再生成と衝突しない。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 14:11:00 +09:00
ketle-manandClaude Sonnet 4.6 390921a13d release: v0.3.63 — ノードタブ複数選択・全タブフィルタークリア・検索Xボタン
- Nodes tab: Ctrl+click / Shift+click multi-select with bulk action bar (add/remove/create group, bulk favorite/unfavorite)
- All tabs (Workflow/Nodes/Models/Gallery): ✕ Clear button resets all filters in one click
- All tabs: inline ✕ overlay button on search inputs clears text immediately
- Fix: node bulk bar layout collapse (moved outside flex container)
- Fix: search clear button not showing (display:'flex' instead of '')
- Fix: node card multi-selected style not applied (added .wfm-card.multi-selected to main.css)
- docs/12_Tagger.png, docs/13_ImageEdit.png added (missed in v0.3.62)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 13:23:15 +09:00
ketle-manandClaude Sonnet 4.6 78b34c99f7 feat: WFS_PromptText を GenerateUI Prompt タブで認識・ドロップ title 固定
- analyzeWorkflow に WFS_PromptText 検出を追加(positive/negative を個別の prompt_node として登録)
- _getWidgetMapping に WFS_PromptText フォールバックマッピングを追加(UI→API 変換対応)
- placePromptNode のドロップ時 title をプリセット名から「Wfs Prompt」固定に変更

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 21:58:27 +09:00
ketle-manandClaude Sonnet 4.6 71ed9788a6 release: v0.3.62 — Send GenUI Image ボタン追加・tagger_settings.json バグ修正
- Gallery タブツールバーに Send GenUI Image ボタンを追加(Image Edit ボタン右隣)
  選択画像を ComfyUI へアップロードし GenerateUI Input Image スロット 0 に自動適用
- tagger_settings.json がデータエクスポート対象から漏れていたバグを修正
- ヘルプ helpGallery17 を EN/JA/ZH で追加
- README: v0.3.62 Changelog・スクリーンショット(Tagger/Image Edit)追加
- DEVLOG 更新・pyproject.toml バージョン 0.3.62 に更新

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 18:10:47 +09:00
ketle-manandClaude Sonnet 4.6 4cfc793c76 docs: Send GenUI Image ボタンのヘルプを追加(helpGallery17)
- templates/index.html: wfm-help-gallery-17 エントリ追加
- static/js/i18n.js: helpGallery17 キー追加(EN/JA/ZH)
- static/js/app.js: helpIdMap に wfm-help-gallery-17 → helpGallery17 追加

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 17:54:06 +09:00
ketle-manandClaude Sonnet 4.6 a7b5667a50 feat: ギャラリータブに Send GenUI Image ボタンを追加
ギャラリーツールバーの Image Edit ボタン右隣に「Send GenUI Image」ボタンを
設置。選択中の画像をギャラリーから取得し、ComfyUI にアップロードした後、
GenerateUI タブの Input > Image スロット 0 へ自動的に適用する。

- templates/index.html: Send GenUI Image ボタン追加
- static/js/comfyui-editor.js: comfyEditor.applyImageToSlot() メソッド追加
- static/js/gallery-tab.js: comfyUI/comfyEditor をインポート、ボタンハンドラ追加
- static/js/i18n.js: galleryNoLoadImageNode / gallerySentGenUI キー追加(EN/JA/ZH)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 17:49:14 +09:00
ketle-manandClaude Sonnet 4.6 1eaf4b2158 fix: tagger_settings.json をデータエクスポート/インポート対象に追加
settings_routes.py の _DATA_FILES リストから tagger_settings.json が
漏れており、データバックアップ時にTagger設定が含まれなかった。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 17:36:29 +09:00
ketle-manandClaude Sonnet 4.6 cbf35e8ddf feat: v0.3.61 — G'MIC バグ修正・セキュリティ・Draw/Mask ブラシ操作性改善
- G'MIC-Qt 引数順序修正 (-o output input が正しい順序)
- CREATE_NEW_CONSOLE フラグ追加(Windows GUI 表示に必須)
- G'MIC 設定パスのプレースホルダーを汎用パスに変更
- handle_result パストラバーサル対策(gmic_temp 外を 403 拒否)
- ヘルプ追加: G'MIC Filter 使い方・インストール手順(EN/JA/ZH)
- Draw/Mask ブラシカーソルを円形オーバーレイに変更(ブラシサイズ連動)
- キャンバス余白からのドラッグ開始対応(ie-canvas-wrap.mousedown)
- キャンバス外へのストローク継続対応(window mousemove/mouseup 追跡)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 16:43:07 +09:00
ketle-man b985f73d35 v0.3.60: Image Edit Filter Tool - G'MIC-Qt integration
Implement G'MIC-Qt filter tool in the Image Edit tab:
- Add gmic_routes.py (new): /api/wfm/gmic/open, /status/{id}, /result endpoints
- Register gmic_routes in wfm.py
- Enable Filter button in index.html (remove ie-tool-placeholder)
- Implement _gmicOpenGui, _gmicWaitForJob, _gmicApplyResult, _gmicAbort in image-edit-tab.js
- Add G'MIC-Qt path setting UI and save logic to settings-tab.js
2026-06-27 14:51:58 +09:00
26 changed files with 2811 additions and 94 deletions
+606
View File
@@ -1,5 +1,611 @@
# DEVLOG - ComfyUI-Workflow-Studio
---
## 計画: Image Edit 拡張 — ABRブラシ連携 + Mask Editor One 統合
**方針**: Mask Editor One(同作者)のインストールを前提に、WFS Image Edit タブに2つの拡張を加える。
### フェーズ1: Draw ツール — ABRブラシ対応
#### 概要
WFS の Draw ツール(`DrawTool.js`)に画像ブラシ(PNG スタンプ)描画機能を追加する。
ブラシデータは Mask Editor One の API エンドポイントを介して取得・管理する。
#### バックエンド(Mask Editor One API 共用)
Mask Editor One がインストールされていれば以下のエンドポイントが利用可能:
| エンドポイント | 用途 |
|---------------|------|
| `GET /mask_editor/brushes/list` | フォルダツリー + ブラシ一覧取得 |
| `GET /mask_editor/brushes/raw?path=…` | ブラシ PNG 画像をサーブ |
| `POST /mask_editor/brushes/import` | PNG フォルダ一括インポート |
| `POST /mask_editor/brushes/upload_abr` | ABR ファイルインポート(パーサーは Mask Editor One 側) |
ブラシの格納先は Mask Editor One のフォルダ(`comfyui-mask-editor-one/brushes/`)を共用。
一度インポートすれば WFS / Mask Editor One の両方で同じブラシが使える。
#### フロントエンド変更
**`DrawTool.js`**
- `brushType: "soft"` | `"image"` プロパティ追加
- `imageBrush: { canvas, width, height }` — スタンプ用 OffscreenCanvas をキャッシュ
- `_stamp()` を改修: `"image"` モード時は `ctx.drawImage(stamp)` で描画(Jitter は phase 2 以降)
- サイズは `brushSize` を高さ基準に、アスペクト比を維持してスケーリング
**Image Edit タブ (`image-edit-tab.js`)**
- Draw ツール Options パネルに「Brush Library」ボタンを追加
- Mask Editor One 未検出時はボタンをグレーアウト + ツールチップ表示
**ブラシライブラリ UI(新規モーダルまたはサイドパネル)**
- Mask Editor One API 未応答時は「Mask Editor One が必要です」メッセージ
- 応答時: フォルダツリー + ブラシサムネイルグリッド表示
- クリックでブラシを選択 → `DrawTool` に適用
- Import Folder / Import ABR ボタン(Mask Editor One の import エンドポイントを呼ぶ)
#### Mask Editor One 検出ロジック
```javascript
// /mask_editor/brushes/list に HEAD または GET を投げて 200 なら存在確認
async function detectMaskEditorOne() {
try {
const r = await fetch("/mask_editor/brushes/list");
return r.ok;
} catch { return false; }
}
```
---
### フェーズ2: Mask Editor One 連携ボタン
#### 概要
WFS Image Edit タブのツールバーまたは Mask ツールのオプションパネルに
「Mask Editor で開く」ボタンを追加する。
現在のキャンバスレイヤーを画像として Mask Editor One に渡し、編集結果を WFS に戻す。
#### 実装ポイント
- WFS のキャンバス合成画像 (`_exportComposite()`) を Blob として取得
- Mask Editor One の `/mask_editor/store_image` に POST してキャッシュ
- Mask Editor One のモーダルを JavaScript から起動(`window.maskEditorOpen()` など)
- Apply 後のコールバックで Mask Editor One の結果マスク PNG を取得
- WFS の mask レイヤーとして追加
#### Mask Editor One 未インストール時
- ボタンを非表示(検出ロジックで判定)
---
### 変更ファイル予定
| ファイル | 変更内容 |
|---------|---------|
| `static/js/image-edit/DrawTool.js` | 画像ブラシ描画対応 |
| `static/js/image-edit-tab.js` | Brush Library ボタン・Mask Editor 連携ボタン |
| `static/js/image-edit/BrushLibrary.js` | 新規: ブラシライブラリモーダル UI |
| `py/routes/` | 不要(Mask Editor One API を直接利用) |
| `static/css/main.css` | ブラシライブラリ UI スタイル |
| `static/js/i18n.js` | ブラシ関連 i18n キー追加 |
| `templates/index.html` | 不要(動的生成) |
---
### 実装順序
1. `DrawTool.js` に画像ブラシ描画機能を追加(スタンプモード)
2. Mask Editor One 検出ロジックを実装
3. `BrushLibrary.js` 新規作成(ライブラリモーダル UI)
4. Draw ツール Options パネルに Brush Library ボタンを接続
5. フェーズ2: Mask Editor 連携ボタンを追加
---
## 2026-06-29: v0.3.65 — Mask Editor One 連携修正・トップバーアイコン修正・Mask ABRブラシ対応
**変更ファイル**: `static/js/image-edit-tab.js`, `static/js/image-edit/MaskTool.js`, `web/comfyui/top_menu_extension.js`, `custom_nodes/comfyui-mask-editor-one/server.py`(インストール済み)
**Mask Editor One 対応バージョン**: v0.1.9+(BiRefNet / SAM3 / ABRブラシライブラリ連携)
### 概要
Mask Editor One の仕様変更に伴う連携修正、プロパティパネル開閉によるトップバーアイコン消滅バグの修正、および Mask ツールへの ABR ブラシサポート追加。
---
### Mask Editor One 連携修正(BiRefNet / SAM3)
#### 問題
Mask Editor One の `store_image` API エンドポイントがフィールド名を `image_b64` から `bg_image_b64` に変更(仕様変更)したが、WFS 側が追随していなかったため、BiRefNet・SAM3 推論時に「no image available for this node」エラーが発生。
#### 修正内容
- **`image-edit-tab.js`**: SAM3・BiRefNet の `store_image` 呼び出しで `image_b64` → `bg_image_b64` に修正(2箇所)
- **`server.py`(インストール済み)**: `store_image` エンドポイントが `bg_image_b64` と旧キー `image_b64` の両方を受け付けるよう後方互換対応を追加
```python
# Before
entry["bg_image_b64"] = data.get("bg_image_b64")
# After
img = data.get("bg_image_b64") or data.get("image_b64")
entry["bg_image_b64"] = img
```
> **Mask Editor One リポジトリ側**: 開発元 `server.py` にも同修正を適用済み。PR 時に含めること。
---
### トップバーアイコン消滅バグ修正(MutationObserver 追加)
#### 問題
サブグラフノード選択時などにプロパティパネルを開くと、Vue がアクションバーを再レンダリングし、WFS・Snapshot・Node Sets のカスタム SVG アイコンが `<i>` タグにリセットされて消滅する([ComfyUI-Lora-Manager #996](https://github.com/willmiao/ComfyUI-Lora-Manager/issues/996) と同根)。
#### 修正内容(`top_menu_extension.js`)
- `replaceButtonIcons` を `applyIconToButton` + `pollUntilFound` に分割
- SVG が既存の場合はスキップ(`btn.querySelector("svg")` チェック)
- `MutationObserver` を追加して Vue 再レンダリング後も即座に SVG を再適用
- `btn.querySelector("i")` で `<i>` リセットを検知 → `applyIconToButton` 再実行
- 監視ノード: `[data-testid="action-bar-buttons"]` → `.actionbar-container` → `document.body`(フォールバック順)
- Observer 参照を `window.__wfmIconObserver` に保持
```javascript
// 旧: 一度だけ適用、Vue 再レンダリングで消滅
const replaceButtonIcons = () => { ... btn.innerHTML = cfg.getIcon(); };
// 新: MutationObserver で監視・再適用
const applyIconToButton = (btn, cfg) => {
if (btn.querySelector("svg")) return; // 既存なら skip
btn.innerHTML = cfg.getIcon();
...
};
observer.observe(watchNode, { childList: true, subtree: true });
```
---
### Mask ツール — ABRブラシ対応(Mask Editor One オプション)
Mask Editor One がインストールされている場合のみ有効。未インストール時は従来の円形ブラシのみで動作(機能維持)。
#### MaskTool.js 変更
| 追加プロパティ | 説明 |
|---|---|
| `brushImage` / `brushName` | ABR 画像ブラシ(null = デフォルト円形) |
| `spacing` (0.05–1.0) | スタンプ間隔(ブラシサイズの倍率) |
| `angle` (0–359°) | ブラシ固定回転角 |
| `sizeJitter` / `sizeJitterAmount` | スタンプごとのサイズランダム変動 |
| `rotationJitter` | スタンプごとの角度ランダム変動 (0–360°) |
- `setImageBrush(img, name)` / `clearImageBrush()` メソッド追加
- **ストロークバッファ**: `_initStrokeBuffer` / `_mergeStroke` — PaintTool.js と同パターンで intra-stroke 蓄積を防止(`lighten` ブレンド)
- `_getImageStamp()`: アルファチャンネル自動判定(ABR 透過 PNG 対応、グレースケール PNG は輝度から逆算)
- `_paintImageBrush()`: `angle` 非ゼロ時に translate + rotate で描画
- `_paintToStroke()`: Jitter 有効時は各スタンプに適用後、状態をリストア(PaintTool.js 同様)
#### image-edit-tab.js 変更
**初期化**
- `_abrAvailable`、`_abrBrushTree` を追加
- 起動時に `_checkAbrAvailability()` を非同期実行(`/mask_editor/brushes/list` が空でなければ有効)
**プロパティパネル(Paint サブツール)**
```
Mode [Add] [Erase]
Size ━━━━━━ 30px
Hardness ━━━━━━ 85% ← ABRブラシ選択中は disabled
─── MASK EDITOR ONE ───
Brush Circle [Select] [✕]
↓ ブラシ選択後
Spacing ━━━━━━ 25%
Angle ━━━━━━ 0°
Sz Jitter━━━━━━ 50%
Rot. Jitter □ On
```
- **Select ボタン**: ABR ブラシライブラリピッカーモーダルを開く
- **✕ ボタン**: Circle(デフォルト)に戻す(ブラシ選択中のみ表示)
- ABR セクションは Mask Editor One インストール済みの場合のみ表示
**ABR ブラシライブラリピッカー** (`_openAbrBrushPicker()`)
- フォルダツリー(左)+ブラシサムネイルグリッド(右)のモーダル
- サムネイル生成: BrushLibrary.js と同ロジック(アルファ判定・輝度変換・タイトルトリム)
- 「Round Brush (default)」ボタンでリセット
- ブラシクリック → `setImageBrush()` 適用後モーダル閉じる
---
## 2026-06-28: v0.3.64 — Image Edit マスク Add/Subtract・BiRefNet BG Remove・SAM3 セグメンテーション・ブラシカーソルバグ修正
**変更ファイル**: `static/js/image-edit-tab.js`, `static/js/image-edit/LayerManager.js`
### 概要
Image Edit タブのマスク機能を強化。Mask Editor One インストール済み環境向けに BiRefNet 背景削除と SAM3 テキストプロンプトセグメンテーションを追加。また独立機能としてマスクレイヤーの合成モード(Add/Subtract)を実装。
---
### マスクレイヤー Add/Subtract 合成モード
#### LayerManager.js
- `Layer` クラスに `operation: "add"` プロパティ追加(`maskApply` 用)
- `toJSON()` / `fromJSON()` で保存・復元対応
- `LayerManager.toggleOperation(id)` メソッド追加(add ⇔ subtract トグル)
#### image-edit-tab.js — レイヤーパネル
- マスクレイヤー行に **A/S トグルボタン** を追加(緑=Add、赤=Subtract)
- クリックで `toggleOperation()` を呼び出し、合成ビューと一覧を再描画
- マスクレイヤー選択時、`operation` に合わせて MaskTool の `mode` を自動同期(subtract → erase)
#### image-edit-tab.js — `_updateCompositeView()` 改修
- 連続する `maskApply: true` マスクレイヤーをグループとして検出
- グループを back→front 順で合成(Mask Editor One `CanvasCompositor` と同ロジック)
- `add` → `globalCompositeOperation = "lighten"`
- `subtract` → `globalCompositeOperation = "destination-out"`
- 合成マスクでターゲットレイヤーを `destination-in` でクリップ
- バグ修正: `maskApply=true` マスクが layers 末尾(ターゲットなし)の場合にオーバーレイ表示のみにフォールバック
---
### BG Remove — BiRefNet(Mask Editor One 連携)
- BG Remove ツール起動時に `/mask_editor/birefnet/status` を確認
- Mask Editor One 未インストール時: BiRefNet オプションを `disabled`("Mask Editor One required" 表示)
- インストール済み時: BiRefNet 選択可能
- 実行フロー:
1. `store_image` でアクティブレイヤー画像を Mask Editor One キャッシュに送信(`node_id: "wfs_bgremove"`)
2. `birefnet/remove_bg` で推論
3. グレースケールマスク(白=前景)→ RGBA PNG に変換(`_applyMaskToImage()`)
4. 既存の BG Remove フロー(New Layer / 上書き)で結果を適用
---
### SAM3 セグメンテーション(Mask Editor One 連携)
- Mask ツールの上部メニューに **[SAM3] ボタン**を追加(Paint の隣)
- 起動時に `/mask_editor/sam3/status` を確認して有効/無効を制御
#### SAM3 モードの上部メニュー
| 要素 | 説明 |
|------|------|
| テキスト入力 | セグメント対象のプロンプト("cat", "person" 等) |
| Max セレクト | 最大マスク取得数(3/6/9/12) |
| Segment ボタン | 推論実行 |
#### プロパティペイン(SAM3)
| 要素 | 説明 |
|------|------|
| Mode: Add/Erase | 適用モード切り替え |
| サムネイルグリッド | 候補マスクをクリックで選択/解除(青ボーダー + ✓ マーク) |
| Apply Selected (N) | 選択マスクをまとめて適用 |
#### 実行フロー
1. `store_image` でイメージレイヤーを送信(`node_id: "wfs_sam3"`)
2. `sam3/segment` で推論 → 複数マスク候補をプロパティペインに表示
3. サムネイルをクリックして複数選択(新規 Segment 時に選択リセット)
4. Apply Selected でまとめて合成適用
- Add → `source-over`(既存マスクに重ね塗り)
- Erase → `destination-out`(既存マスクから消去)
5. アクティブレイヤーがマスクでない場合は新規マスクレイヤーを自動作成
---
## 2026-06-28: v0.3.63 — ノードタブ複数選択・全タブフィルタークリア・検索Xボタン
**変更ファイル**: `static/js/nodes-tab.js`, `static/js/workflow-tab.js`, `static/js/models-tab.js`, `static/js/gallery-tab.js`, `static/js/util.js`, `static/js/i18n.js`, `static/css/main.css`, `templates/index.html`
### 概要
ノードタブにギャラリー同様の複数選択+一括グループ・お気に入り操作を追加。ワークフロー/ノード/モデル/ギャラリーの4タブ全てに「✕ クリア」ボタンと検索入力オーバーレイXボタンを追加。
---
### ノードタブ: 複数選択バルクメニュー
#### 操作方法
| 操作 | 動作 |
|------|------|
| Ctrl+クリック | 個別選択/解除トグル |
| Shift+クリック | アンカーから範囲一括選択 |
| カードビュー・テーブルビュー | 両対応 |
#### 一括操作バー(選択時に自動表示)
- **グループに追加** — 既存グループに選択ノードを一括追加
- **グループから削除** — 既存グループから選択ノードを一括削除
- **作成して追加** — 新規グループを作成して一括追加
- **★ お気に入り追加(全件)** — 選択ノードを全件お気に入り登録
- **☆ お気に入り解除(全件)** — 選択ノードを全件お気に入り解除
- **選択解除** — 選択状態をリセット
#### 実装詳細
- `state.selectedNodes`(Set)と `state.lastSelectionIndex` を追加
- `_applyNodeSelectionToDOM()` — 再レンダリング後に選択状態を DOM に同期
- `updateNodeBulkBar()` — バー表示/非表示とグループセレクト更新
- バルクバーを `wfm-workflow-area`(flex コンテナ)の**外**に配置(レイアウト崩れ防止)
- `.wfm-card.multi-selected` スタイルを `main.css` に追加(オレンジ `#f59e0b` でギャラリーと統一)
---
### 全タブ: フィルタークリアボタン(✕ クリア)
各タブのツールバー最右端に「✕ クリア」ボタンを追加。クリックで全フィルターを一括リセット。
| タブ | リセット対象 |
|------|-------------|
| ワークフロー | 検索テキスト・グループ・バッジフィルタ(ALL に戻す)・バッチ表示フラグ |
| ノード | 検索テキスト・カテゴリ・パッケージ・タグ・グループ・お気に入りフラグ |
| モデル | 検索テキスト・タグ・フォルダ・グループ・ステータス・お気に入り・バッチフラグ |
| ギャラリー | 検索テキスト・タグ・グループ・お気に入りフラグ(ソート順は維持) |
---
### 全タブ: 検索入力オーバーレイ X ボタン
検索テキストボックス右端に `✕` ボタンをオーバーレイ表示。
- 入力が**空のときは非表示**、文字を入力すると自動表示
- クリックで入力をクリアしてフォーカスを戻し、即時フィルタリング更新
- 汎用関数 `setupSearchClearBtn(inputId, clearBtnId, onClear)` を `util.js` に追加し4タブで共通使用
- `.wfm-search-wrap` / `.wfm-search-clear-btn` スタイルを `main.css` に追加
#### 対象
- ワークフロータブ: `wfm-search`
- ノードタブ: `wfm-nodes-search`
- モデルタブ: `wfm-models-search`
- ギャラリータブ: `wfm-gallery-search`
---
### バグ修正
- **ノードバルクバーレイアウト崩れ** — バルクバーを `wfm-nodes-browser`(`display:flex` コンテナ)内から外側に移動
- **検索Xボタン非表示** — `btn.style.display = ""` がCSS `display:none` を復元してしまうバグを `"flex"` 明示指定に修正
- **ノードカード multi-selected 未適用** — `.wfm-card.multi-selected` が `main.css` になく視覚変化なしだったため追加
---
## 2026-06-27: WFS_PromptText の GenerateUI 対応・ドロップ時 title 固定
**変更ファイル**: `static/js/comfyui-workflow.js`, `web/comfyui/node_sets_menu.js`
### 概要
`WFS_PromptText` ノードを含むワークフローを GenerateUI タブで読み込んだ際に、Prompt タブの Positive/Negative テキストエリアへ正しく反映されるよう対応。あわせてサイドバーのプロンプトプリセットをキャンバスにドロップしたときのノード title をプリセット名から「Wfs Prompt」固定に変更し、ワークフローの再利用性を向上。
---
### WFS_PromptText → GenerateUI Prompt タブ対応
#### 変更内容(`static/js/comfyui-workflow.js`)
- **`analyzeWorkflow` Pass2** に `WFS_PromptText` 検出を追加
- `inputs.positive` が文字列 → `role: "positive"`, `textKey: "positive"` で `prompt_nodes` に登録
- `inputs.negative` が文字列 → `role: "negative"`, `textKey: "negative"` で `prompt_nodes` に登録
- 同一ノードが positive/negative の両ロールを持つため(CLIPTextEncode 経由の伝播で両参照される)、`getRole()` に依存せず固定ロールで登録
- **`_getWidgetMapping`** に `WFS_PromptText: ["positive", "negative"]` を追加
- UI 形式 → API 形式変換時のフォールバック: `widgets_values[0]` → `inputs.positive`、`[1]` → `inputs.negative`
#### 動作
| 手順 | 内容 |
|------|------|
| UI 形式読み込み | `convertUiToApi` が `widgets_values` を `inputs.positive/negative` にマップ |
| 解析 | `analyzeWorkflow` が `WFS_PromptText` を positive/negative 2 つの `prompt_node` として認識 |
| 表示 | Prompt タブのセレクトに `ID:X Wfs Prompt [positive]` / `[negative]` が表示される |
| Apply | `textKey: "positive"/"negative"` でワークフローへ書き戻し |
---
### ドロップ時 title 固定(`web/comfyui/node_sets_menu.js`)
- `placePromptNode` 内の `if (promptName) node.title = promptName;` を `node.title = "Wfs Prompt";` に変更
- サイドバーの Prompts タブからどのプリセットをドロップしても title が「Wfs Prompt」固定になる
- プリセット内容(positive/negative テキスト)はウィジェット値として保存されるため変わらない
---
## 2026-06-27: v0.3.62 — Send GenUI Image ボタン追加・tagger_settings.json バグ修正・README 更新
**変更ファイル**: `static/js/gallery-tab.js`, `static/js/comfyui-editor.js`, `static/js/i18n.js`, `static/js/app.js`, `templates/index.html`, `py/routes/settings_routes.py`, `README.md`
### 概要
ギャラリータブのツールバーに **Send GenUI Image** ボタンを追加。選択画像を GenerateUI タブの Input → Image スロット 0 へ自動適用できるようになった。データエクスポートのバグ修正(tagger_settings.json 漏れ)も同梱。
---
### Send GenUI Image ボタン(Gallery タブ)
#### 実装内容
- `templates/index.html` — ギャラリーツールバーの Image Edit ボタン右隣に `#wfm-gallery-send-genui-image-btn` を追加
- `static/js/comfyui-editor.js` — `comfyEditor.applyImageToSlot(file, slotIndex)` メソッドを追加:
- `comfyUI.currentAnalysis.load_image_nodes[slotIndex]` でターゲットノードを特定
- `comfyUI.uploadImage()` で ComfyUI input フォルダへアップロード
- `currentWorkflow[node.id].inputs.image` を更新してワークフローへ即時反映
- GenerateUI の Input > Image スロット UI(プレビュー・ファイル名・ステータス)を即時更新
- `static/js/gallery-tab.js` — ボタンクリックハンドラを追加:
- 選択画像の blob を fetch → File オブジェクト化
- DOM クリックチェーン(main tab → subtab → inner tab)で GenerateUI Input Image タブへ自動遷移
- `comfyEditor.applyImageToSlot(file, 0)` 呼び出し後にサクセストーストを表示
- `static/js/i18n.js` — `galleryNoLoadImageNode` / `gallerySentGenUI` / `helpGallery17` を EN/JA/ZH で追加
- `static/js/app.js` — `helpIdMap` に `"wfm-help-gallery-17": "helpGallery17"` を追加
- `templates/index.html` — ヘルプ `#wfm-help-gallery-17` を追加
#### 動作条件
- ワークフローが GenerateUI に読み込まれており、LoadImage ノードが 1 つ以上存在すること
- 画像が Gallery で選択されていること
---
### データ管理バグ修正 — tagger_settings.json をエクスポート対象に追加
- `py/routes/settings_routes.py` の `_DATA_FILES` リストに `"tagger_settings.json"` を追加
- Tagger のカスタムモデルディレクトリ・閾値設定がエクスポート/インポートされない問題を修正
- `tagger.db`(SQLite)と `wildcard/`(ディレクトリ)は JSON バンドル非対応のため除外継続
---
## 2026-06-27: データ管理バグ修正 — tagger_settings.json をエクスポート対象に追加
**変更ファイル**: `py/routes/settings_routes.py`
### 概要
設定タブのデータエクスポート/インポート機能(`_DATA_FILES`リスト)に `tagger_settings.json` が漏れていたバグを修正。
`config.py` で定義されている全JSONデータファイルと `_DATA_FILES` を照合したところ、Taggerの設定ファイル(カスタムモデルディレクトリ・タグ閾値など)がバックアップ対象から除外されていた。`settings_routes.py` の `_DATA_FILES` リストに `"tagger_settings.json"` を追加して修正。
`tagger.db`(SQLite)と `wildcard/`(ディレクトリ)はJSONバンドルに含められないため除外のまま。
---
## 2026-06-27: v0.3.61 — G'MIC バグ修正・セキュリティ・Draw/Mask ブラシ操作性改善
**変更ファイル**: `py/routes/gmic_routes.py`, `static/js/image-edit-tab.js`, `static/js/image-edit/DrawTool.js`, `static/js/image-edit/MaskTool.js`, `static/js/settings-tab.js`, `static/js/i18n.js`, `static/js/app.js`, `templates/index.html`
### 概要
v0.3.60 で実装した G'MIC-Qt 連携の動作修正・セキュリティ強化と、Draw / Mask ツールのブラシ操作性を大幅に改善した。
---
### G'MIC バグ修正
#### 引数順序の修正
`gmic_qt.exe` の起動引数を正しい順序 `-o <output> <input>` に修正。以前の順序(`<input> -o <output>`)では G'MIC-Qt Standalone が即時終了してGUIが開かなかった。
#### `CREATE_NEW_CONSOLE` フラグ追加
Windows でバックグラウンドプロセス(ComfyUI)からGUIウィンドウを表示するために必須のフラグ。一度削除したが eagle_comic_creater_web の参考実装を確認して再追加した。
#### 設定パスのプレースホルダー修正
`settings-tab.js` の G'MIC-Qt パス入力フィールドのデフォルト値とプレースホルダーからユーザー固有のパス(`statsu-11`)を削除し、汎用的な `C:\path\to\gmic_qt.exe` に変更。`gmic_routes.py` のフォールバック値も同様に空文字に変更。
---
### セキュリティ修正
#### `handle_result` パストラバーサル対策
`POST /api/wfm/gmic/result` の `result_path` は以前リクエストボディから直接 `open()` に渡していた。`Path.resolve().relative_to(gmic_temp)` による検証を追加し、`gmic_temp` ディレクトリ外のパスは 403 を返すように変更。eagle_comic_creater_web の同等実装と同じパターン。
---
### ヘルプ更新(3点セット)
`templates/index.html` / `static/js/i18n.js`(EN/JA/ZH)/ `static/js/app.js`(helpIdMap)を同時更新。
追加したヘルプカード(Mask Tool カードの直後):
| カード | 内容 |
|---|---|
| **G'MIC Filter** | Edit with G'MIC ボタンの使い方、OKから「filter output」ウィンドウを閉じるまでのフロー |
| **G'MIC-Qt Installation** | `gmic.eu/download.html` からのダウンロード手順、解凍先、設定タブへのパス設定方法 |
---
### Draw / Mask ツール改善
#### ブラシカーソルを円に変更
- `DrawTool.activate()` / `MaskTool.activate()` のカーソルを `"crosshair"` → `"none"` に変更
- `image-edit-tab.js` に `_initBrushCursor()` / `_updateBrushCursor(e)` / `_hideBrushCursor()` を追加
- `<body>` に固定配置の `#ie-brush-cursor` div を動的生成(白枠 + 黒シャドウで背景色に依存しない表示)
- `window.mousemove` でキャンバスの `getBoundingClientRect().width / canvas.width` を用いてブラシサイズ(canvas 座標)を CSS px に変換し、円サイズを毎フレーム更新
- ツール切り替え・mouseleave 時に非表示
#### キャンバス外からのドラッグ開始
`ie-canvas-wrap`(キャンバスを囲む余白エリア)の `mousedown` に draw / mask 用の処理を追加。`e.target` が `drawCanvas` / `overlayCanvas` の場合は既存ハンドラに委譲し、余白部分のクリックは `DrawTool.getCanvasPos(drawCanvas, e)` でキャンバス相対座標に変換して描画を開始。
#### キャンバス外でのストローク継続
- `window.mousemove` に draw / mask の描画継続ロジックを追加(`_drawing` フラグが true の間はキャンバス外でも `_onToolMouseMove` を呼ぶ)
- `window.mouseup` に描画終了ロジックを追加(キャンバス外でボタンを離した場合も正常終了)
- `_onToolMouseLeave()` から draw / mask の `onMouseLeave()` 呼び出しを削除(`mouseleave` で描画が中断されなくなった)
---
## 2026-06-27: v0.3.60 — Image Edit Filter Tool (G'MIC-Qt 連携) 実装
**変更ファイル**: `py/routes/gmic_routes.py`(新規), `py/wfm.py`, `templates/index.html`, `static/js/image-edit-tab.js`, `static/js/settings-tab.js`
### 概要
Image Edit タブの「★ Filter」ツール(これまで非アクティブ)に G'MIC-Qt GUI 連携機能を実装。アクティブレイヤーの画像を G'MIC-Qt で開き、フィルター適用後の結果をレイヤーに反映できる。処理中は進行状況を表示し、Undo/Redo にも対応。
---
### バックエンド
#### `py/routes/gmic_routes.py`(新規)
G'MIC-Qt 連携用の API ルートを新規作成。
| エンドポイント | 概要 |
|---|---|
| `POST /api/wfm/gmic/open` | base64 画像を受け取り一時 PNG に保存→ `gmic_qt.exe -o <out> <in>` をバックグラウンドスレッドで起動。`job_id` を返す |
| `GET /api/wfm/gmic/status/{job_id}` | ジョブの進行状況(`pending` / `processing` / `completed` / `failed`)を返す |
| `POST /api/wfm/gmic/result` | `result_path` を受け取り、処理済み画像を base64 エンコードして返す |
- G'MIC-Qt の実行パスは Settings に保存された `gmic_qt_path` を参照。未設定の場合はデフォルトパス `C:\Users\statsu-11\gmic-3.6.5-qt-win64\gmic_qt.exe` にフォールバック。
- プロセスは `subprocess.Popen` + `CREATE_NEW_CONSOLE` でノンブロッキングに起動し、スレッド内でポーリングして完了を検出。
#### `py/wfm.py`
`gmic_routes` を import し、`gmic_routes.setup_routes(app)` をルート登録リストに追加。
---
### フロントエンド
#### `templates/index.html`
左サイドバーの「★ Filter」ボタンから `ie-tool-placeholder` クラスを削除し、クリック可能な通常ボタンに変更。
#### `static/js/image-edit-tab.js`
- `TOOL_DEFS` の `filter` を `ready: false` → `ready: true` に変更
- コンストラクタに `this._gmicState`(`lastResultJobId` / `processing` / `aborted`)を追加
- `_setActiveTool("filter")` → 他ツールへ切り替えた際に `_gmicAbort()` を呼ぶ
- `_renderToolOptions("filter")` — 以下の UI を生成:
- **「G'MIC GUI で編集」ボタン** — 処理中は disabled
- **「結果を反映」ボタン** — 処理完了後に有効化
- **進行状況テキスト** — サーバーからのステータスメッセージを表示
- **「中断」ボタン** — 赤色。クリックでポーリングを停止し UI をリセット
| 新規メソッド | 概要 |
|---|---|
| `_gmicOpenGui()` | アクティブレイヤーを PNG (base64) に変換→ `/api/wfm/gmic/open` で起動 |
| `_gmicWaitForJob(jobId)` | 2 秒間隔でステータスをポーリング(最大 10 分)。完了で「結果を反映」を有効化 |
| `_gmicApplyResult()` | `result_path` 経由で処理済み画像を取得→ `_saveUndo()` → アクティブレイヤーに上書き描画 |
| `_gmicAbort()` | `_gmicState.aborted = true` でポーリングを中断し UI をリセット |
#### `static/js/settings-tab.js`
Settings タブに「**G'MIC-Qt Integration**」セクション(`<details>`)を追加。
- G'MIC-Qt 実行ファイルパス入力フィールド(`id="wfm-settings-gmic-path"`)と「Save」ボタン
- Save クリックで `saveServerSettings({ gmic_qt_path: path })` を呼び出し `settings.json` に永続化
- 保存結果を下部ステータステキストで通知
---
### 使用フロー
1. Settings タブ → 「G'MIC-Qt Integration」セクションで `gmic_qt.exe` のパスを設定・保存
2. Image Edit タブで画像をロードし、左サイドバーの「**★ Filter**」ツールを選択
3. 上部ツールオプションバーの「**G'MIC GUI で編集**」をクリック
4. G'MIC-Qt ウィンドウが起動し、アクティブレイヤーの画像が表示される
5. フィルターを選択し「OK」をクリック
6. WFS が完了を検出し「**結果を反映**」ボタンが有効化される
7. 「結果を反映」をクリックするとアクティブレイヤーに処理済み画像が適用される
8. **Ctrl+Z** でフィルター適用前の状態に戻すことも可能
---
## 2026-06-27: v0.3.59 — Image Edit Mask Tool 実装・Draw/Mask 描画バグ修正・クリッピング保存対応
**変更ファイル**: `static/js/image-edit-tab.js`, `static/js/image-edit/MaskTool.js`, `static/js/image-edit/DrawTool.js`, `static/js/image-edit/LayerManager.js`, `templates/index.html`, `static/css/image-edit-tab.css`, `static/js/i18n.js`, `static/js/app.js`
+59 -6
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.59-green)
![Version](https://img.shields.io/badge/version-0.3.65-green)
## Screenshots
@@ -42,6 +42,10 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
|:---:|:---:|
| ![WS Library](docs/6_ws_library.png) | ![Library Information](docs/7_library_Infomation.png) |
| Tagger Tab | Image Edit Tab |
|:---:|:---:|
| ![Tagger Tab](docs/12_Tagger.png) | ![Image Edit Tab](docs/13_ImageEdit.png) |
| Customize | |
|:---:|:---:|
| ![Customize](docs/8_Customize.png) | |
@@ -60,6 +64,8 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **AI summary** — generate workflow descriptions using Ollama
- **Import / Export** — import workflows from files or clipboard; **Send to Canvas** button sends the selected workflow directly to the ComfyUI canvas (UI and API formats both supported)
- **Default view setting** — persist your preferred view mode (Thumbnail / Table)
- **Search clear (✕)** — inline ✕ button appears inside the search box whenever text is entered; click to clear immediately
- **Clear all filters (✕ Clear)** — rightmost toolbar button; resets search text, group filter, and badge filter (ALL) in one click
### Canvas Snapshot (v0.1.2)
- **One-click capture** — click the camera button in ComfyUI's top bar to snapshot the current workflow canvas
@@ -146,6 +152,7 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **Text Size** — one slider (10–28 px) adjusts font size for all prompt and chat textareas at once: Generate UI positive/negative prompts, AI Assistant chat input, Preset prompts, Wildcard prompt and file editor, and Metadata prompt full preview; takes effect immediately and saved with Save Settings
- **RAW JSON Colors** — customize the 6 syntax highlight colors for the Raw JSON editor in Generate UI: Default Text (base), Name/Scheduler (yellow), Title (pink), Width/Height (green), Prompt/Text (cyan), Image/File (red); changes apply immediately on color pick; Reset Defaults restores the original scheme; saved to `localStorage` under `wfm_settings.jsonColors` and applied on startup
- **Wildcard Integration** — link the WFS wildcard directory to ComfyUI-Impact-Pack's `wildcards/` directory (directory junction on Windows, symlink on other OS); existing WFS wildcard files are automatically migrated; requires [ComfyUI-Impact-Pack](https://github.com/ltdrdata/ComfyUI-Impact-Pack)
- **G'MIC-Qt Integration** — set the path to `gmic_qt.exe` for the Image Edit Filter tool; download G'MIC-Qt Standalone from `gmic.eu/download.html` (Windows: `gmic_qt-win64.zip`), extract anywhere, then enter the full path to `gmic_qt.exe` and click Save
- **Language** — English / Japanese / Chinese
### Gallery Tab (v0.3.44)
@@ -164,6 +171,10 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **Detail panel** — view filename, path, tags, groups, and metadata in a slide-out panel
- **Workflow viewer** — Metadata tab displays workflow JSON from PNG embedded data (`prompt` / `workflow` keys) or from workflow saved by the Generate UI tab; **Copy & Send Canvas** button copies the JSON to the clipboard and sends the workflow directly to the ComfyUI canvas (UI and API formats both supported)
- **Load GenUI button** — loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab; shows a warning toast if no workflow is embedded or the format is unsupported; Metadata button is styled green, Load GenUI button uses the primary accent color
- **Image Edit button** — toolbar button; sends the selected image directly to the Image Edit tab as the base layer
- **Send GenUI Image button** — toolbar button (next to Image Edit); uploads the selected image to ComfyUI and sets it as the input for the first LoadImage node in the GenerateUI tab; automatically switches to GenerateUI → Input → Image; requires a workflow with at least one LoadImage node to be loaded
- **Search clear (✕)** — inline ✕ button appears inside the search box whenever text is entered; click to clear immediately
- **Clear all filters (✕ Clear)** — rightmost toolbar button; resets search text, tag filter, group filter, and favorites filter in one click (sort order is preserved)
- **Workflow auto-save** — images generated from the Generate UI tab have their workflow automatically saved to gallery metadata
- **Output folder configurable** — set the scanned output folder from Settings tab
- **Performance** — server-side 256px JPEG thumbnail generation with disk cache (`data/thumb_cache/`); infinite-scroll paging (50 images per page, IntersectionObserver); folder-level mtime cache (60s TTL); bulk operations use single-request API endpoints
@@ -175,6 +186,9 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **Node detail panel** — view I/O specifications, edit tags, manage groups
- **Node Sets** — save multiple nodes + connections as reusable sets from the ComfyUI canvas
- **Right-click context menu** — "Save as Node Set" option on any node in ComfyUI
- **Multi-select** — Ctrl+click to toggle individual nodes, Shift+click for range selection; bulk action bar appears with: add to group / remove from group / create & add group / bulk favorite / unfavorite
- **Search clear (✕)** — inline ✕ button appears inside the search box whenever text is entered; click to clear immediately
- **Clear all filters (✕ Clear)** — rightmost toolbar button; resets search text, category, package, tag, group, and favorites filter in one click
### Models Tab (v0.2.3)
- **Model Browser** — browse all installed ComfyUI models (Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding) with sub-tab switching
@@ -197,6 +211,8 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **Group row** — select an existing group and **Add** / **Remove**, or type a new name and **Create & Add**
- **Badge row** — select a badge and **+Badge** / **−Badge** to apply or remove from all selected
- **File row** — select a destination subfolder (or type a new folder name and create it) then **Move** to relocate the model file with all sidecar files; **Delete Files** (right end) permanently removes selected models and all associated files
- **Search clear (✕)** — inline ✕ button appears inside the search box whenever text is entered; click to clear immediately
- **Clear all filters (✕ Clear)** — rightmost toolbar button; resets search text, tag filter, folder filter, group filter, favorites filter, and status filter in one click
### Tagger Tab (v0.3.38)
- **3 sub-tabs** — Single / Batch / DB for single-image tagging, folder batch processing, and tag database management
@@ -209,18 +225,19 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **DB tab** — searchable SQLite database of all tagged images; click a row to open the edit panel and modify WD Tags / VLM Tags; Save updates the record, Delete removes it; Export CSV downloads all records
- **Dependencies** — install into ComfyUI's embedded Python: `python_embedded\python.exe -m pip install -r requirements.txt`; for GPU inference use `onnxruntime-gpu`; TensorFlow (DeepDanbooru) is optional and commented out in `requirements.txt`
### Image Edit Tab (v0.3.59)
### Image Edit Tab (v0.3.65)
- **Layer-based image editor** — compose images with multiple layers (Image, Text, Draw, Mask 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), Mask (🎭), Blur (≈), BG Remove (⬚); tool options bar updates per active tool
- **Tools** — Select (V), Draw (B), Text (T), Shape (S), Mask (🎭), Blur (≈), BG Remove (⬚), Filter (★); 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; paints directly onto the active draw layer while all other layers remain visible
- **Draw** — freehand brush; options: color, brush size, blend mode; paints directly onto the active draw layer while all other layers remain visible; brush cursor shown as a size-accurate circle; strokes can start from outside the canvas margin and continue past the edge
- **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)
- **Mask** — paint a white mask onto a dedicated mask layer; click **M** in the Layers header to add a mask layer (Mask tool activates automatically); clicking a mask layer in the list also switches to the Mask tool; **Tool Options bar**: Paint sub-tool button, Invert checkbox, Overlay color picker (default red), Blur slider (0–50 px); **Properties pane** (left of the Layers panel): Size (1–200 px), Hardness (0–100%), Mode — **Add** (draw white = mask present) / **Erase** (erase to transparent = mask absent); **✂ button** on the layer row enables/disables the mask as a clipping mask — when enabled (blue), the layer directly below is clipped to the painted area and the result is applied when exporting
- **Mask** — paint a white mask onto a dedicated mask layer, or use SAM3 text-prompt segmentation (requires Mask Editor One); click **M** in the Layers header to add a mask layer (Mask tool activates automatically); clicking a mask layer in the list also switches to the Mask tool; **Tool Options bar**: Paint / SAM3 sub-tool buttons, Invert checkbox, Overlay color picker (default red), Blur slider (0–50 px); SAM3 button disabled when Mask Editor One is not installed; **Properties pane — Paint mode**: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); **MASK EDITOR ONE section** (visible when Mask Editor One is installed): Select opens the ABR stamp-brush library — choosing a brush replaces the default circle; ✕ clears back to Circle; when an image brush is active, Hardness is disabled and Spacing (5–100%), Angle (0–359°), Sz Jitter (random size per stamp, 0–100%), Rot. Jitter (random rotation per stamp on/off) controls appear; **Properties pane — SAM3 mode**: enter a text prompt (e.g. "cat"), set Max candidates (3/6/9/12), click Segment — candidate mask thumbnails appear; click to select (blue border + ✓, multi-select supported), click Apply Selected (N) to apply with current Mode (Add / Erase); a new mask layer is created automatically if needed; **Mask layer A/S operation**: A/S toggle button on each mask layer row — Add (green) composites normally, Subtract (red) cuts the mask from the layer below; **✂ clipping mask button** on the layer row clips the layer directly below to the painted area; brush cursor shown as size-accurate circle; strokes can start from outside the canvas margin and continue past the edge
- **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
- **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 Mask Editor One's Python backend (requires Mask Editor One installed and `birefnet.safetensors` in `ComfyUI/models/background_removal/`); **New Layer** option (default on) adds the result as a new layer above the original; when off, replaces the active layer in-place
- **Filter (G'MIC)** — apply G'MIC-Qt filter effects to the active image layer; click **Edit with G'MIC** to launch G'MIC-Qt GUI; select a filter and click OK — a "G'MIC-Qt filter output" window appears; close it to save the result back as the active layer; requires G'MIC-Qt Standalone installed and path configured in Settings → G'MIC-Qt Executable Path
- **Layer panel** — layer list with visibility (👁/🚫), lock (🔒/🔓), and clipping-mask (✂) toggles; opacity slider; type icons (🖼 image / T text / ✏ draw / ⬚ mask); 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
@@ -339,6 +356,7 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
- **[Ollama](https://ollama.com/)** — for AI chat assistant, translation, and VLM features
- **[LM Studio](https://lmstudio.ai/)** — alternative backend for translation and VLM (OpenAI-compatible API)
- **[Eagle](https://eagle.cool/)** — for auto-saving generated images with metadata
- **[comfyui-mask-editor-one](https://github.com/ketle-man/comfyui-mask-editor-one) (v0.1.9+)** — enables BiRefNet background removal, SAM3 text-prompt segmentation, and ABR stamp-brush library in the Image Edit Mask tool; `birefnet.safetensors` must be placed in `ComfyUI/models/background_removal/` for BiRefNet
---
@@ -354,6 +372,41 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
## Changelog
### v0.3.65
- **Image Edit — Mask Editor One integration fixes** — `store_image` API field mismatch (`image_b64` → `bg_image_b64`) corrected so BiRefNet and SAM3 no longer report "no image available"; `server.py` updated to accept both field names for backward compatibility
- **Image Edit — top bar icon persistence** — WFS / Snapshot / Node Sets SVG icons in the ComfyUI action bar disappeared when the Properties Panel was opened (Vue re-render reset custom `innerHTML` to `<i>`); fixed with a `MutationObserver` that re-applies SVG icons whenever a reset is detected
- **Image Edit — Mask Tool: ABR brush library** (requires Mask Editor One) — Select button in the Properties pane opens a folder-tree + thumbnail-grid brush picker; stamp brushes are loaded from Mask Editor One's `/mask_editor/brushes/` folder; ✕ clears back to the default circle brush
- **Image Edit — Mask Tool: ABR brush controls** — when an image brush is active, Hardness is disabled and new controls appear in the Properties pane: Spacing (stamp interval 5–100%), Angle (fixed rotation 0–359°), Sz Jitter (random size reduction per stamp 0–100%), Rot. Jitter (random angle per stamp on/off); size jitter clamped to minimum 1 px to prevent zero-dimension canvas errors
- **Image Edit — Mask brush cursor** — brush size circle is now hidden outside the canvas; only shown when the pointer is within the canvas bounds (window-level mousemove no longer shows the cursor overlay outside)
### v0.3.64
- **Image Edit — Mask layer Add/Subtract** — A/S toggle button on each mask layer row; Add (green, default) composites the mask normally; Subtract (red) cuts the mask area from the layer below; multiple mask layers are composited back-to-front matching Mask Editor One's CanvasCompositor logic
- **Image Edit — BiRefNet BG Remove** (requires Mask Editor One + `birefnet.safetensors` in `ComfyUI/models/background_removal/`) — BiRefNet model now fully functional via Mask Editor One's Python backend; grayscale mask returned as RGBA PNG and applied as a new layer or in-place per the New Layer toggle
- **Image Edit — SAM3 segmentation** (requires Mask Editor One) — new SAM3 sub-tool in the Mask tool options bar; enter a text prompt, set Max candidates (3/6/9/12), click Segment; candidate mask thumbnails shown in the Properties pane; click to select (multi-select), Apply Selected (N) applies all chosen masks with Add or Erase mode; new mask layer auto-created if active layer is not a mask
### v0.3.63
- **Nodes tab — multi-select** — Ctrl+click to toggle individual nodes, Shift+click for range selection; bulk action bar appears with add to group / remove from group / create & add group / bulk favorite / unfavorite; works in both Card and Table view modes
- **All tabs — search clear (✕)** — inline ✕ overlay button inside each search box (Workflow / Nodes / Models / Gallery); shown only when text is entered, click to clear and re-filter immediately
- **All tabs — clear all filters button** — new ✕ Clear button at the rightmost end of each tab's toolbar; resets all active filters (search, group, tag, folder, favorites, badge) in one click; Gallery sort order is preserved
### v0.3.62
- **Gallery tab — Send GenUI Image button** — new toolbar button (next to Image Edit); uploads the selected image to ComfyUI and sets it as the input for the first LoadImage node in the GenerateUI tab; automatically switches to GenerateUI → Input → Image; `comfyEditor.applyImageToSlot(file, slotIndex)` added to `comfyui-editor.js` for reusable image-slot injection
- **Bug fix: tagger_settings.json missing from data export** — `tagger_settings.json` was absent from `_DATA_FILES` in `settings_routes.py`; Tagger model directory and threshold settings were silently excluded from Settings → Data Management export/import; fixed by adding the file to the export list
- **Help — Send GenUI Image** — new help card (`helpGallery17`) added in EN/JA/ZH; registered in `helpIdMap`
- **Screenshots — Tagger and Image Edit tabs** — `docs/12_Tagger.png` and `docs/13_ImageEdit.png` added to the README screenshots section
### v0.3.61
- **Image Edit — Draw / Mask brush cursor** — cursor replaced with a size-accurate circle overlay matching the current brush size; the circle scales correctly with canvas zoom so the visible area matches exactly what will be painted
- **Image Edit — Draw / Mask out-of-canvas strokes** — strokes can now start from the canvas margin area (outside the image boundary) and continue past the edge without interruption; `window`-level `mousemove` / `mouseup` tracking keeps the stroke alive when the pointer leaves the canvas element
- **G'MIC — argument order fix** — corrected `gmic_qt.exe` launch arguments to `-o <output> <input>` (the only order G'MIC-Qt Standalone accepts); the previous order caused the GUI to exit immediately without opening
- **G'MIC — settings path placeholder** — replaced the hard-coded user-specific default path with a generic `C:\path\to\gmic_qt.exe` placeholder; settings load without a pre-filled path for new users
- **G'MIC — security: path traversal fix** — `POST /api/wfm/gmic/result` now validates that `result_path` is inside the `gmic_temp` directory before reading the file; requests for paths outside that directory are rejected with 403
- **Help — G'MIC Filter section** — added two new help cards (G'MIC Filter usage and G'MIC-Qt Installation) with full i18n support (English / Japanese / Chinese)
### v0.3.60
- **Image Edit — Filter tool (G'MIC-Qt integration)** — the previously inactive ★ Filter tool now launches G'MIC-Qt GUI with the active layer image; select a filter and click OK, then close the "G'MIC-Qt filter output" window to apply the result back as the active layer; polling-based job system with progress display, Cancel button, and Undo support; requires G'MIC-Qt Standalone (`gmic_qt.exe`) configured in Settings
- **Settings — G'MIC-Qt Executable Path** — new collapsible section in Settings for entering and saving the path to `gmic_qt.exe`
### v0.3.59
- **Image Edit — Mask Tool** — new Mask tool (🎭) in the Image Edit sidebar; click **M** in the Layers header to add a mask layer (Mask tool activates automatically); clicking a mask layer in the layer list also switches to the Mask tool; **Tool Options bar**: Paint button, Invert checkbox (inverts overlay preview), Overlay color picker (default red), Blur slider (0–50 px) for overlay edge softening; **Properties pane** (left of the Layers panel, shown when Mask tool is active): Size (1–200 px), Hardness (0–100%), Mode — **Add** / **Erase** toggle buttons (active mode highlighted in blue)
- **Image Edit — Clipping mask (✂ button)** — each mask layer row shows a ✂ toggle; when enabled (blue), the mask clips the layer directly below it so only the painted area is visible; clipping is applied to PNG save / Save to Gallery / Send to ComfyUI exports
Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

+183
View File
@@ -0,0 +1,183 @@
"""G'MIC-Qt integration API routes."""
import asyncio
import base64
import datetime
import json
import logging
import mimetypes
import os
import subprocess
import threading
import uuid
from pathlib import Path
from aiohttp import web
from ..services.settings_service import SettingsService
from ..config import DATA_DIR
logger = logging.getLogger(__name__)
_settings = SettingsService()
# Global job store
# key: job_id, value: dict {status, message, result_path, error}
_gmic_jobs = {}
_gmic_jobs_lock = threading.Lock()
def _gmic_run_gui(job_id: str, input_path: str, output_path: str, gmic_exe: str):
"""Run gmic_qt.exe in a background process/thread and wait for completion.
G'MIC-Qt Standalone argument order: -o <output> <input>
After OK the "filter output" window appears; closing it saves to output_path.
"""
args = [gmic_exe, "-o", output_path, input_path]
logger.info("[gmic] Launching: %s", " ".join(args))
try:
with _gmic_jobs_lock:
_gmic_jobs[job_id]["status"] = "processing"
_gmic_jobs[job_id]["message"] = "G'MIC GUIで編集中..."
import time
kwargs = {}
if os.name == "nt":
# Required on Windows to show the GUI window from a background process
kwargs["creationflags"] = subprocess.CREATE_NEW_CONSOLE
proc = subprocess.Popen(args, **kwargs)
proc.wait()
time.sleep(0.5)
if os.path.exists(output_path) and os.path.getsize(output_path) > 0:
with _gmic_jobs_lock:
_gmic_jobs[job_id]["status"] = "completed"
_gmic_jobs[job_id]["result_path"] = output_path
_gmic_jobs[job_id]["message"] = "完了"
logger.info("[gmic] Result saved: %s", output_path)
else:
raise ValueError("G'MIC GUIがキャンセルされました")
except Exception as e:
with _gmic_jobs_lock:
_gmic_jobs[job_id]["status"] = "failed"
_gmic_jobs[job_id]["error"] = str(e)
_gmic_jobs[job_id]["message"] = f"エラー: {str(e)}"
logger.error("[gmic] Error: %s", e)
def setup_routes(app: web.Application):
"""Register G'MIC API routes."""
app.router.add_post("/api/wfm/gmic/open", handle_open)
app.router.add_get("/api/wfm/gmic/status/{job_id}", handle_status)
app.router.add_post("/api/wfm/gmic/result", handle_result)
async def handle_open(request: web.Request) -> web.Response:
"""POST /api/wfm/gmic/open - Open image in G'MIC GUI."""
try:
body = await request.json()
image_b64 = body.get("image_b64", "")
if not image_b64:
return web.json_response({"error": "image_b64 field is required"}, status=400)
# Retrieve setting for gmic path
data = _settings.load()
gmic_exe = data.get("gmic_qt_path", "")
if not os.path.exists(gmic_exe):
return web.json_response({
"error": f"G'MIC executable not found at: {gmic_exe}. Please configure the path in settings."
}, status=400)
ext = ".png"
if image_b64.startswith("data:"):
header, image_b64 = image_b64.split(",", 1)
mime = header.split(";")[0].split(":")[1]
guessed = mimetypes.guess_extension(mime)
if guessed:
ext = ".jpg" if guessed == ".jpe" else guessed
img_bytes = base64.b64decode(image_b64)
temp_dir = Path(DATA_DIR) / "gmic_temp"
temp_dir.mkdir(parents=True, exist_ok=True)
now_str = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
input_path = str(temp_dir / f"gmic_input_{now_str}{ext}")
output_path = str(temp_dir / f"gmic_output_{now_str}_{str(uuid.uuid4())[:8]}{ext}")
with open(input_path, "wb") as f:
f.write(img_bytes)
job_id = str(uuid.uuid4())
with _gmic_jobs_lock:
_gmic_jobs[job_id] = {
"status": "pending",
"message": "G'MIC GUIを起動中...",
"result_path": None,
"error": None,
}
# Start G'MIC thread
t = threading.Thread(
target=_gmic_run_gui,
args=(job_id, input_path, output_path, gmic_exe),
daemon=True,
)
t.start()
return web.json_response({"job_id": job_id, "status": "pending", "message": "起動中"})
except Exception as e:
logger.error("[gmic] open error: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def handle_status(request: web.Request) -> web.Response:
"""GET /api/wfm/gmic/status/{job_id} - Check job status."""
try:
job_id = request.match_info.get("job_id", "")
with _gmic_jobs_lock:
job = _gmic_jobs.get(job_id)
if job is None:
return web.json_response({"error": "Job not found"}, status=404)
return web.json_response({
"job_id": job_id,
"status": job["status"],
"message": job.get("message", ""),
"result_path": job.get("result_path"),
"error": job.get("error"),
})
except Exception as e:
logger.error("[gmic] status error: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def handle_result(request: web.Request) -> web.Response:
"""POST /api/wfm/gmic/result - Get result image base64."""
try:
body = await request.json()
result_path = body.get("result_path", "")
if not result_path or not os.path.exists(result_path):
return web.json_response({"error": f"Result file not found: {result_path}"}, status=404)
# Path traversal guard: only allow files inside gmic_temp
allowed_dir = (Path(DATA_DIR) / "gmic_temp").resolve()
try:
Path(result_path).resolve().relative_to(allowed_dir)
except ValueError:
return web.json_response({"error": "Access denied: path outside gmic_temp"}, status=403)
with open(result_path, "rb") as f:
img_bytes = f.read()
ext = os.path.splitext(result_path)[1].lower()
mime_map = {
".png": "image/png",
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".webp": "image/webp",
".bmp": "image/bmp",
".tiff": "image/tiff"
}
mime = mime_map.get(ext, "image/png")
b64 = base64.b64encode(img_bytes).decode("ascii")
return web.json_response({"image_b64": f"data:{mime};base64,{b64}"})
except Exception as e:
logger.error("[gmic] result error: %s", e)
return web.json_response({"error": str(e)}, status=500)
+1
View File
@@ -23,6 +23,7 @@ _DATA_FILES = [
"prompts.json",
"model_metadata.json",
"gallery_metadata.json",
"tagger_settings.json",
]
+2 -1
View File
@@ -61,7 +61,7 @@ class WorkflowStudio:
app.router.add_get("/wfm", serve_index_page)
# API routes
from .routes import workflow_routes, settings_routes, ollama_routes, eagle_routes, nodes_routes, prompts_routes, models_routes, gallery_routes, wildcard_routes, tagger_routes
from .routes import workflow_routes, settings_routes, ollama_routes, eagle_routes, nodes_routes, prompts_routes, models_routes, gallery_routes, wildcard_routes, tagger_routes, gmic_routes
workflow_routes.setup_routes(app)
settings_routes.setup_routes(app)
@@ -73,5 +73,6 @@ class WorkflowStudio:
gallery_routes.setup_routes(app)
wildcard_routes.setup_routes(app)
tagger_routes.setup_routes(app)
gmic_routes.setup_routes(app)
logger.info("Workflow Studio: Routes registered successfully")
+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.59"
version = "0.3.63"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+44
View File
@@ -217,6 +217,39 @@ body {
Search
============================================ */
.wfm-search-wrap {
position: relative;
display: inline-flex;
align-items: center;
}
.wfm-search-clear-btn {
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
font-size: 11px;
color: var(--wfm-text-secondary);
padding: 2px 3px;
line-height: 1;
border-radius: 50%;
display: none;
opacity: 0.7;
}
.wfm-search-clear-btn:hover {
color: var(--wfm-text-primary);
background: rgba(255,255,255,0.1);
opacity: 1;
}
.wfm-search-wrap .wfm-search-input {
padding-right: 22px;
}
.wfm-search-input {
padding: 6px 12px;
border: 1px solid var(--wfm-border);
@@ -1579,6 +1612,17 @@ body {
background: color-mix(in srgb, var(--wfm-primary) 10%, var(--wfm-surface));
}
.wfm-card.multi-selected {
border-color: #f59e0b !important;
box-shadow: 0 0 0 2px #f59e0b !important;
background: color-mix(in srgb, #f59e0b 10%, var(--wfm-surface));
}
.wfm-nodes-table-row.multi-selected {
background: rgba(245, 158, 11, 0.15);
outline: 1px solid #f59e0b;
}
/* ============================================
Side Panel
============================================ */
+11 -1
View File
@@ -385,6 +385,7 @@ function applyI18nToHtml() {
"wfm-help-nodes-1": "helpNodes1", "wfm-help-nodes-2": "helpNodes2",
"wfm-help-nodes-3": "helpNodes3", "wfm-help-nodes-4": "helpNodes4",
"wfm-help-nodes-5": "helpNodes5", "wfm-help-nodes-6": "helpNodes6",
"wfm-help-nodes-7": "helpNodes7",
"wfm-help-models-1": "helpModels1", "wfm-help-models-2": "helpModels2",
"wfm-help-models-3": "helpModels3", "wfm-help-models-4": "helpModels4",
"wfm-help-models-5": "helpModels5", "wfm-help-models-6": "helpModels6",
@@ -400,6 +401,7 @@ function applyI18nToHtml() {
"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-gallery-17": "helpGallery17",
"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",
@@ -455,7 +457,15 @@ function applyI18nToHtml() {
"wfm-help-imageedit-mask-title": "helpImageEditMaskTitle",
"wfm-help-imageedit-mask-1": "helpImageEditMask1", "wfm-help-imageedit-mask-2": "helpImageEditMask2",
"wfm-help-imageedit-mask-3": "helpImageEditMask3", "wfm-help-imageedit-mask-4": "helpImageEditMask4",
"wfm-help-imageedit-mask-5": "helpImageEditMask5",
"wfm-help-imageedit-mask-5": "helpImageEditMask5", "wfm-help-imageedit-mask-6": "helpImageEditMask6",
"wfm-help-imageedit-mask-7": "helpImageEditMask7", "wfm-help-imageedit-mask-8": "helpImageEditMask8",
"wfm-help-imageedit-gmic-title": "helpImageEditGmicTitle",
"wfm-help-imageedit-gmic-1": "helpImageEditGmic1", "wfm-help-imageedit-gmic-2": "helpImageEditGmic2",
"wfm-help-imageedit-gmic-3": "helpImageEditGmic3", "wfm-help-imageedit-gmic-4": "helpImageEditGmic4",
"wfm-help-imageedit-gmic-install-title": "helpImageEditGmicInstallTitle",
"wfm-help-imageedit-gmic-install-1": "helpImageEditGmicInstall1",
"wfm-help-imageedit-gmic-install-2": "helpImageEditGmicInstall2",
"wfm-help-imageedit-gmic-install-3": "helpImageEditGmicInstall3",
"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",
+30
View File
@@ -1131,6 +1131,36 @@ export const comfyEditor = {
});
},
async applyImageToSlot(file, slotIndex = 0) {
const loadNodes = comfyUI.currentAnalysis?.load_image_nodes || [];
const node = loadNodes[slotIndex];
if (!node) throw new Error("No LoadImage node at slot " + slotIndex);
const result = await comfyUI.uploadImage(file, file.name);
if (!result.name) throw new Error("Upload returned no filename");
if (comfyUI.currentWorkflow?.[node.id]) {
comfyUI.currentWorkflow[node.id].inputs.image = result.name;
}
const previewWrap = document.getElementById(`wfm-i2i-preview-wrap-${slotIndex}`);
const previewImg = document.getElementById(`wfm-i2i-preview-${slotIndex}`);
const filenameEl = document.getElementById(`wfm-i2i-filename-${slotIndex}`);
const statusEl = document.getElementById(`wfm-i2i-status-${slotIndex}`);
const applyBtn = document.querySelector(`.wfm-i2i-apply[data-slot="${slotIndex}"]`);
if (previewImg) {
previewImg.src = `/view?filename=${encodeURIComponent(result.name)}&type=input`;
if (previewWrap) previewWrap.style.display = "";
}
if (filenameEl) filenameEl.textContent = result.name;
if (statusEl) { statusEl.textContent = `✓ ${result.name}`; statusEl.style.color = "var(--wfm-success)"; }
if (applyBtn) applyBtn.disabled = true;
_syncRawJson();
return result.name;
},
syncToWorkflow() {
// Sync prompt texts before generation
const posSelect = document.getElementById("wfm-prompt-pos-target");
+17
View File
@@ -713,6 +713,22 @@ export const comfyWorkflow = {
}
}
// WFS_PromptText — 2出力ノード。output[0]=positive / output[1]=negative
if (ct === "WFS_PromptText") {
if (typeof inputs.positive === "string") {
result.prompt_nodes.push({
id, type: ct, title: `${title} [positive]`, role: "positive",
text: inputs.positive, textKey: "positive",
});
}
if (typeof inputs.negative === "string") {
result.prompt_nodes.push({
id, type: ct, title: `${title} [negative]`, role: "negative",
text: inputs.negative, textKey: "negative",
});
}
}
// PrimitiveStringMultiline / PrimitiveString — when feeding a prompt node
if ((ct === "PrimitiveStringMultiline" || ct === "PrimitiveString") && (isPos || isNeg)) {
result.prompt_nodes.push({
@@ -899,6 +915,7 @@ function _getWidgetMapping(nodeType) {
// vary between versions and include frontend-only extras, so we leave them unmapped.
ImpactWildcardProcessor: ["wildcard_text"],
ImpactWildcardEncode: ["wildcard_text"],
WFS_PromptText: ["positive", "negative"],
};
return mappings[nodeType] || null;
}
+61 -1
View File
@@ -7,8 +7,10 @@ import { showToast } from "./app.js";
import { t } from "./i18n.js";
import { loadFileIntoMetadataTab } from "./metadata-tab.js";
import { loadWorkflowIntoEditor } from "./generate-tab.js";
import { escapeHtml } from "./util.js";
import { escapeHtml, setupSearchClearBtn } from "./util.js";
import { comfyWorkflow } from "./comfyui-workflow.js";
import { comfyUI } from "./comfyui-client.js";
import { comfyEditor } from "./comfyui-editor.js";
// ── 定数 ─────────────────────────────────────────────────────
@@ -1471,11 +1473,48 @@ function bindEvents() {
}
});
// 選択画像を GenerateUI Image タブへ送信
document.getElementById("wfm-gallery-send-genui-image-btn")?.addEventListener("click", async () => {
if (!state.selectedImage) {
showToast(t("gallerySelectImageFirst"), "info");
return;
}
if (!comfyUI.currentAnalysis) {
showToast(t("noWorkflowLoaded"), "info");
return;
}
const loadNodes = comfyUI.currentAnalysis.load_image_nodes || [];
if (loadNodes.length === 0) {
showToast(t("galleryNoLoadImageNode"), "info");
return;
}
try {
const res = await fetch(API.serveImage(state.selectedImage.path));
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const blob = await res.blob();
const file = new File([blob], state.selectedImage.filename, { type: blob.type || "image/png" });
// GenerateUI → Input subtab → Image inner tab へ切り替え
document.querySelector('[data-tab="generate"]')?.click();
document.querySelector('.wfm-gen-subtab-btn[data-subtab="input"]')?.click();
document.querySelector('.wfm-input-inner-tab[data-input-tab="image"]')?.click();
await comfyEditor.applyImageToSlot(file, 0);
showToast(t("gallerySentGenUI"), "success");
} catch (e) {
showToast(t("errorWithMsg", e.message), "error");
}
});
// 検索
document.getElementById("wfm-gallery-search")?.addEventListener("input", (e) => {
state.search = e.target.value;
loadImages();
});
setupSearchClearBtn("wfm-gallery-search", "wfm-gallery-search-clear-btn", () => {
state.search = "";
loadImages();
});
// ソート
document.getElementById("wfm-gallery-sort")?.addEventListener("change", (e) => {
@@ -1704,4 +1743,25 @@ function bindEvents() {
document.querySelectorAll(".wfm-gallery-lightbox").forEach(el => el.remove());
}
});
// Clear filters button
const galleryClearBtn = document.getElementById("wfm-gallery-clear-filters-btn");
if (galleryClearBtn) {
galleryClearBtn.textContent = t("clearFilters");
galleryClearBtn.addEventListener("click", () => {
state.search = "";
state.favoriteOnly = false;
state.tagFilter = "";
state.groupFilter = "";
const searchInput = document.getElementById("wfm-gallery-search");
if (searchInput) searchInput.value = "";
const tagFilter = document.getElementById("wfm-gallery-tag-filter");
if (tagFilter) tagFilter.value = "";
const groupFilter = document.getElementById("wfm-gallery-group-filter");
if (groupFilter) groupFilter.value = "";
const favBtn = document.getElementById("wfm-gallery-fav-btn");
if (favBtn) favBtn.classList.remove("active");
loadImages();
});
}
}
+93 -15
View File
@@ -17,6 +17,7 @@ const LANGUAGES = {
test: "Test",
copy: "Copy",
close: "Close",
clearFilters: "✕ Clear",
error: "Error",
// -- Tabs --
@@ -468,6 +469,8 @@ const LANGUAGES = {
galleryOutputDirLabel: "Output Folder Path",
galleryOutputDirHint: "Set the ComfyUI output folder to browse in the Gallery tab. Leave blank to use ComfyUI's default output directory.",
gallerySelectImageFirst: "Please select an image first",
galleryNoLoadImageNode: "No LoadImage node in current workflow",
gallerySentGenUI: "Sent to GenerateUI Image tab",
galleryNoEmbeddedWorkflow: "No ComfyUI workflow embedded in this image.",
galleryBulkSelected: "selected",
galleryBulkDeselectAll: "Deselect All",
@@ -481,6 +484,15 @@ const LANGUAGES = {
galleryBulkMoveTo: "Move To...",
galleryBulkExport: "Export",
galleryBulkDelete: "Delete File",
nodesBulkSelected: "selected",
nodesBulkDeselect: "Deselect All",
nodesBulkAddToGroup: "Select Group",
nodesBulkGroupAdd: "Add to Group",
nodesBulkGroupRemove: "Remove from Group",
nodesBulkNewGroup: "New Group Name",
nodesBulkCreateAdd: "Create & Add",
nodesBulkFavAll: "★ Favorite All",
nodesBulkUnfavAll: "☆ Unfavorite All",
downloadStarted: "Download started",
exportCompleted: "Export completed. ZIP file is downloading.",
@@ -667,6 +679,7 @@ const LANGUAGES = {
helpNodes4: "Create, rename, delete node groups and assign/remove nodes",
helpNodes5: "Side panel: Details (class name, package, category, description, flags), I/O Spec (inputs/outputs with types and defaults), Groups management",
helpNodes6: "Node Sets: create reusable node collections with descriptions, tags, and link definitions between nodes",
helpNodes7: "Multi-select: Ctrl+click to toggle individual nodes, Shift+click for range selection; bulk action bar appears with add to group / remove from group / create & add group / bulk favorite / unfavorite",
helpModels1: "Browse installed models: Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding with sub-tab switching",
helpModels2: "Thumbnail and Table view modes with pagination; Table view shows Type and Base Model columns sourced from CivitAI data alongside filename, subdirectory, and extension; column headers are clickable to sort — click once for ascending (▲), again for descending (▼), a third time to clear the sort; the E/D column sorts by enable/disable status",
helpModels3: "Search, tag filter, group filter, favorites filter, and status filter (All / Enabled only / Disabled only)",
@@ -696,6 +709,7 @@ const LANGUAGES = {
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",
helpGallery17: "Send GenUI Image button (toolbar, next to Image Edit): uploads the selected image to ComfyUI and sets it as the input for the first LoadImage node in the GenerateUI tab; automatically switches to GenerateUI → Input → Image; requires a workflow with at least one LoadImage node to be loaded first",
// -- Tagger Tab --
helpTaggerTitle: "Tagger Tab",
@@ -771,16 +785,19 @@ const LANGUAGES = {
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",
helpImageEdit7d: "Mask (🎭): paint a white mask on the canvas; click \"M\" in the Layers header to add a mask layer — the Mask tool activates automatically; the mask is shown as a colored semi-transparent overlay; the Properties pane (left of the Layers panel) shows Paint controls; see the Mask Tool card below for details",
helpImageEdit7c: "BG Remove (⬚): remove the background from the active layer using Lightweight (@imgly, runs in browser) or BiRefNet (requires Mask Editor One + birefnet.safetensors in ComfyUI/models/background_removal/); see the BG Remove Tool card below for details",
helpImageEdit7d: "Mask (🎭): paint a white mask on the canvas with Paint mode or use SAM3 text-prompt segmentation (requires Mask Editor One); click \"M\" in the Layers header to add a mask layer — the Mask tool activates automatically; the mask is shown as a colored semi-transparent overlay; see the Mask Tool card below for details",
helpImageEdit8b: "\"M\" button in the Layers header: adds a new mask layer above the current layer and automatically switches to the Mask tool",
helpImageEdit12: "Type icons: 🖼 = image layer, T = text layer, ✏ = draw layer, ⬚ = mask layer",
helpImageEditMaskTitle: "Mask Tool (🎭)",
helpImageEditMask1: "Add a mask layer: click the \"M\" button in the Layers panel header; the new mask layer is inserted above the active layer and the Mask tool activates automatically",
helpImageEditMask2: "Clicking a mask layer in the layer list automatically switches to the Mask tool",
helpImageEditMask3: "Tool Options bar (Paint / Invert / Overlay / Blur): Paint button toggles the Paint sub-tool; Invert checkbox inverts the overlay preview (shows color where mask is absent); Overlay color picker changes the preview color (default red); Blur slider (0–50 px) softens the overlay edge",
helpImageEditMask4: "Properties pane (left of the Layers panel, visible when Mask tool is active): Size (1–200 px), Hardness (0–100%), Mode — Add button draws white (mask present) / Erase button removes to transparent (mask absent); the active mode is highlighted in blue",
helpImageEditMask3: "Tool Options bar (Paint / SAM3 / Invert / Overlay / Blur): Paint/SAM3 buttons switch sub-tools; Invert checkbox inverts the overlay preview (shows color where mask is absent); Overlay color picker changes the preview color (default red); Blur slider (0–50 px) softens the overlay edge; SAM3 button is disabled when Mask Editor One is not installed",
helpImageEditMask4: "Properties pane — Paint mode: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); MASK EDITOR ONE section (visible when Mask Editor One is installed): Select button opens the ABR brush library — choosing a brush replaces the default circle brush; ✕ clears the brush back to Circle; when an image brush is active, Hardness is disabled and additional controls appear: Spacing (stamp interval 5–100%), Angle (rotation 0–359°), Sz Jitter (random size reduction per stamp 0–100%), Rot. Jitter (random rotation per stamp on/off)",
helpImageEditMask5: "✂ button on a mask layer row: toggles the layer as a clipping mask — when enabled (blue), the mask clips the layer directly below it so only the painted area is visible; clipping is applied when saving PNG / Gallery / ComfyUI",
helpImageEditMask6: "SAM3 (Mask Editor One required): text-prompt segmentation powered by the SAM3 model; enter a description of the object to segment (e.g. \"cat\", \"person\"), set Max (maximum mask candidates: 3/6/9/12), then click Segment",
helpImageEditMask7: "SAM3 workflow: after Segment, candidate masks appear as thumbnails in the Properties pane — click to select (blue border + ✓); multiple masks can be selected; click Apply Selected (N) to apply them all; Mode (Add / Erase) controls how masks are merged into the current mask layer; a new mask layer is created automatically if the active layer is not a mask",
helpImageEditMask8: "ABR Brush Library (Mask Editor One required, Paint mode only): click Select in the MASK EDITOR ONE section to open the brush picker — browse folders on the left, click a thumbnail to apply; \"Round Brush (default)\" restores the circle brush; brushes are shared with Mask Editor One and stored in its brushes/ folder",
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",
@@ -790,10 +807,19 @@ const LANGUAGES = {
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)",
helpImageEditBgRemove2: "Model — BiRefNet: high-quality background removal using the BiRefNet model; requires Mask Editor One to be installed and birefnet.safetensors placed in ComfyUI/models/background_removal/",
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)",
helpImageEditGmicTitle: "G'MIC Filter (Edit with G'MIC)",
helpImageEditGmic1: "Applies G'MIC-Qt filter effects to the active image layer; the result is loaded back as a new layer",
helpImageEditGmic2: "Click \"Edit with G'MIC\" in the toolbar to launch G'MIC-Qt GUI with the current layer image",
helpImageEditGmic3: "In G'MIC-Qt: choose a filter, adjust parameters, then click OK — a \"G'MIC-Qt filter output\" window appears; close it to save and return the result to the Image Edit tab",
helpImageEditGmic4: "Requires G'MIC-Qt Standalone to be installed and its path configured in Settings → G'MIC-Qt Executable Path; only image-type layers are supported",
helpImageEditGmicInstallTitle: "G'MIC-Qt Installation",
helpImageEditGmicInstall1: "Download G'MIC-Qt Standalone from gmic.eu/download.html — choose the \"G'MIC-Qt\" package for your OS (Windows: gmic_qt-win64.zip)",
helpImageEditGmicInstall2: "Extract the zip to any folder (e.g. C:\\tools\\gmic); no installer required",
helpImageEditGmicInstall3: "Open Settings → G'MIC-Qt Executable Path, enter the full path to gmic_qt.exe (e.g. C:\\tools\\gmic\\gmic_qt.exe), then click Save",
helpImageEditTabKbdTitle: "Image Edit Tab Shortcuts",
helpShortcutsTitle: "Keyboard Shortcuts",
helpShortcuts1: "Escape: Close modal/panel",
@@ -962,6 +988,7 @@ const LANGUAGES = {
test: "テスト",
copy: "コピー",
close: "閉じる",
clearFilters: "✕ クリア",
error: "エラー",
// -- Tabs --
@@ -1413,6 +1440,8 @@ const LANGUAGES = {
galleryOutputDirLabel: "Outputフォルダのパス",
galleryOutputDirHint: "ギャラリータブで参照するComfyUIのoutputフォルダを設定します。空欄の場合はComfyUIのデフォルトoutputディレクトリを使用します。",
gallerySelectImageFirst: "先に画像を選択してください",
galleryNoLoadImageNode: "現在のワークフローにLoadImageノードがありません",
gallerySentGenUI: "GenerateUI Imageタブへ送信しました",
galleryNoEmbeddedWorkflow: "この画像にはComfyUIワークフローが埋め込まれていません。",
galleryBulkSelected: "件選択中",
galleryBulkDeselectAll: "選択解除",
@@ -1426,6 +1455,15 @@ const LANGUAGES = {
galleryBulkMoveTo: "移動先...",
galleryBulkExport: "エクスポート",
galleryBulkDelete: "ファイル削除",
nodesBulkSelected: "件選択中",
nodesBulkDeselect: "選択解除",
nodesBulkAddToGroup: "グループ選択",
nodesBulkGroupAdd: "グループに追加",
nodesBulkGroupRemove: "グループから削除",
nodesBulkNewGroup: "新しいグループ名",
nodesBulkCreateAdd: "作成して追加",
nodesBulkFavAll: "★ お気に入り追加(全件)",
nodesBulkUnfavAll: "☆ お気に入り解除(全件)",
downloadStarted: "ダウンロード開始",
exportCompleted: "エクスポート完了。ZIPファイルをダウンロード中です。",
@@ -1612,6 +1650,7 @@ const LANGUAGES = {
helpNodes4: "ノードグループの作成・名前変更・削除、ノードの割り当て・解除",
helpNodes5: "サイドパネル:詳細(クラス名、パッケージ、カテゴリ、説明、フラグ)、I/O仕様(入出力の型・デフォルト値)、グループ管理",
helpNodes6: "ノードセット:再利用可能なノードコレクションの作成(説明、タグ、ノード間リンク定義付き)",
helpNodes7: "複数選択:Ctrl+クリックで個別トグル、Shift+クリックで範囲選択;一括操作バーでグループへの追加・削除・新規作成して追加・お気に入り一括登録/解除が可能",
helpModels1: "インストール済みモデルの閲覧:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embeddingをサブタブで切り替え",
helpModels2: "サムネイル / テーブル表示モード切り替え(ページネーション付き)。テーブル表示ではファイル名・サブフォルダ・拡張子に加えCivitAI由来のType / Base Model列を表示。列ヘッダーをクリックでソート — 1回で昇順(▲)、2回で降順(▼)、3回でソート解除。E/D列は有効/無効状態でソート",
helpModels3: "検索、タグフィルタ、グループフィルタ、お気に入りフィルタ、ステータスフィルタ(すべて / 有効のみ / 無効のみ)",
@@ -1641,6 +1680,7 @@ const LANGUAGES = {
helpGallery14: "Taggerボタン(紫、詳細パネルのアクション行):選択画像をTaggerタブのSingleモードで直接開き、即座にタグ付けを開始できる",
helpGallery15: "Fボタン(シアン色オーバーレイ、各サムネイル左上):クリック一つで画像を __Feeder__ グループに追加/削除;グループ内の場合は常にシアン色で表示、非グループ時はホバー時のみ表示;FeederタブのGalleryモードへ素早く画像を追加できる",
helpGallery16: "Image Editボタン(ツールバー、Refreshボタン横):選択中の画像をImage Editタブに送信;既にレイヤーが存在する場合はキャンバスに合わせてスケールして新規レイヤーとして追加、存在しない場合はLayer 1になる",
helpGallery17: "Send GenUI Imageボタン(ツールバー、Image Editボタン横):選択画像をComfyUIにアップロードし、GenerateUIタブの最初のLoadImageノードへ入力として設定;GenerateUI → Input → Imageへ自動切り替え;事前にLoadImageノードを含むワークフローの読み込みが必要",
// -- Tagger Tab --
helpTaggerTitle: "Taggerタブ",
@@ -1716,15 +1756,18 @@ const LANGUAGES = {
helpImageEdit29: "マウスホイール:ズームイン / アウト",
helpImageEdit30: "ダブルクリック(Selectツールでテキストレイヤー):テキストを再編集",
helpImageEdit7b: "Blur (≈):アクティブレイヤーにガウスぼかしまたはモザイクを適用 — 全体またはドラッグで矩形範囲指定;詳細は下の「Blur Tool」カードを参照",
helpImageEdit7c: "BG Remove (⬚):Lightweight(@imgly、ブラウザ内処理)またはBiRefNet(Pythonバックエンド、近日追加)でアクティブレイヤーの背景を除去;詳細は下の「BG Remove Tool」カードを参照",
helpImageEdit7d: "Mask (🎭):キャンバス上に白いマスクを描画;レイヤーヘッダーの「M」ボタンでマスクレイヤーを追加すると自動的にMaskツールに切り替わる;マスクはカラーの半透明オーバーレイとして表示;プロパティペイン(レイヤーパネル左隣)にPaintサブツールのコントロール;詳細は下の「Mask Tool」カードを参照",
helpImageEdit7c: "BG Remove (⬚):Lightweight(@imgly、ブラウザ内処理)またはBiRefNet(Mask Editor One + ComfyUI/models/background_removal/にbirefnet.safetensors必須)でアクティブレイヤーの背景を除去;詳細は下の「BG Remove Tool」カードを参照",
helpImageEdit7d: "Mask (🎭):Paintモードでキャンバス上に白いマスクを描画、またはSAM3テキストプロンプトセグメンテーション(Mask Editor One必須)でマスク生成;レイヤーヘッダーの「M」ボタンでマスクレイヤーを追加すると自動的にMaskツールに切り替わる;マスクはカラーの半透明オーバーレイとして表示;詳細は下の「Mask Tool」カードを参照",
helpImageEdit8b: "レイヤーヘッダーの「M」ボタン:アクティブレイヤーの上に新しいマスクレイヤーを追加し、自動的にMaskツールに切り替える",
helpImageEditMaskTitle: "Mask ツール (🎭)",
helpImageEditMask1: "マスクレイヤーの追加:レイヤーパネルヘッダーの「M」ボタンをクリック;新しいマスクレイヤーはアクティブレイヤーの上に挿入され、Maskツールが自動的に有効化される",
helpImageEditMask2: "レイヤーリストでマスクレイヤーをクリックすると自動的にMaskツールに切り替わる",
helpImageEditMask3: "ツールオプションバー(Paint / Invert / Overlay / Blur):PaintボタンでPaintサブツールを切り替え;Invertチェックボックスでオーバーレイプレビューを反転(マスクがない部分にオーバーレイを表示);Overlayカラーピッカーでプレビューカラーを変更(デフォルト赤);Blurスライダー(0〜50 px)でオーバーレイプレビューの輪郭をぼかす",
helpImageEditMask4: "プロパティペイン(レイヤーパネル左隣、Maskツール選択時に表示):Sizeスライダー(1〜200 px)、Hardnessスライダー(0〜100%)、Modeボタン — Addボタン(白で描画/マスクあり)/ Eraseボタン(透明化/マスクなし);アクティブなModeが青くハイライト",
helpImageEditMask3: "ツールオプションバー(Paint / SAM3 / Invert / Overlay / Blur):Paint/SAM3ボタンでサブツールを切り替え;Invertチェックボックスでオーバーレイプレビューを反転(マスクがない部分にオーバーレイを表示);Overlayカラーピッカーでプレビューカラーを変更(デフォルト赤);Blurスライダー(0〜50 px)でオーバーレイプレビューの輪郭をぼかす;SAM3ボタンはMask Editor One未インストール時は無効",
helpImageEditMask4: "プロパティペイン — Paintモード:Mode(Add / Erase)・Size(1〜200 px)・Hardness(0〜100%);MASK EDITOR ONEセクション(Mask Editor Oneインストール時のみ表示):Selectボタンでクリックするとスタンプブラシを選択(選択したブラシがデフォルト円形に代わる);✕でCircle(デフォルト)に戻す;画像ブラシ選択中はHardnessが無効になり追加コントロールが表示:Spacing(スタンプ間隔 5〜100%)・Angle(回転角 0〜359°)・Sz Jitter(スタンプごとのサイズランダム変動 0〜100%)・Rot. Jitter(スタンプごとの角度ランダム変動 on/off)",
helpImageEditMask5: "マスクレイヤー行の ✂ ボタン:クリッピングマスクとして機能させるon/off切り替え — 有効(青)のとき、直下のレイヤーをマスクの描画範囲でクリッピングして表示;クリッピングはPNG保存 / Gallery / ComfyUI送信にも反映される",
helpImageEditMask6: "SAM3(Mask Editor One必須):SAM3モデルによるテキストプロンプトセグメンテーション;対象オブジェクトの説明(例:\"cat\"・\"person\")を入力し、Max(マスク候補の最大数:3/6/9/12)を設定してSegmentをクリック",
helpImageEditMask7: "SAM3の操作フロー:Segment後、候補マスクのサムネイルがプロパティペインに表示される — クリックして選択(青ボーダー + ✓);複数選択可;Apply Selected(N)で選択したマスクを一括適用;Mode(Add / Erase)で現在のマスクレイヤーへの合成方法を制御;アクティブレイヤーがマスクでない場合は新規マスクレイヤーを自動作成",
helpImageEditMask8: "ABRブラシライブラリ(Mask Editor One必須・Paintモードのみ):MASK EDITOR ONEセクションのSelectボタンでブラシピッカーを開く — 左のフォルダツリーで絞り込み、サムネイルをクリックして適用;「Round Brush (default)」で円形ブラシに戻す;ブラシはMask Editor Oneと共有しその brushes/ フォルダに保存される",
helpImageEditBlurTitle: "Blur ツール (≈)",
helpImageEditBlur1: "Whole Blur:アクティブレイヤー全体にガウスぼかしを適用 — 強度スライダー(1〜50 px)で調整してApplyをクリック",
helpImageEditBlur2: "Whole Mosaic:アクティブレイヤー全体にピクセル化モザイクを適用 — ブロックサイズスライダー(5〜100 px)で調整してApplyをクリック",
@@ -1734,10 +1777,19 @@ const LANGUAGES = {
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 が必要(近日対応)",
helpImageEditBgRemove2: "モデル — BiRefNet:BiRefNetモデルによる高品質な背景除去;Mask Editor Oneのインストールと ComfyUI/models/background_removal/ への birefnet.safetensors 配置が必要",
helpImageEditBgRemove3: "New Layer(デフォルトON):結果をアクティブレイヤーの上に同じ位置・表示サイズの新規レイヤーとして追加 — 元レイヤーは保持",
helpImageEditBgRemove4: "New LayerをOFFにすると、アクティブレイヤーのキャンバスが背景除去済みの結果で直接置き換えられる",
helpImageEditBgRemove5: "Remove BGをクリックして処理開始;ステータステキストに「Loading model → Processing → Done」と表示;Undo(Ctrl+Z)に対応",
helpImageEditGmicTitle: "G'MIC フィルター(G'MICで編集)",
helpImageEditGmic1: "アクティブな画像レイヤーにG'MIC-Qtのフィルター効果を適用する;処理結果は新規レイヤーとして読み込まれる",
helpImageEditGmic2: "ツールバーの「G'MICで編集」ボタンをクリックすると、現在のレイヤー画像でG'MIC-Qt GUIを起動する",
helpImageEditGmic3: "G'MIC-Qt上でフィルターを選択してパラメーターを調整後にOKをクリック —「G'MIC-Qt filter output」ウィンドウが表示されるので閉じると結果がImage Editタブに反映される",
helpImageEditGmic4: "G'MIC-Qt Standaloneがインストールされ、設定タブの「G'MIC-Qt Executable Path」にパスが設定されている必要がある;画像タイプのレイヤーのみ対応",
helpImageEditGmicInstallTitle: "G'MIC-Qt のインストール",
helpImageEditGmicInstall1: "gmic.eu/download.html から G'MIC-Qt Standalone をダウンロード — OS に合ったパッケージを選択(Windows: gmic_qt-win64.zip)",
helpImageEditGmicInstall2: "zipを任意のフォルダに解凍する(例: C:\\tools\\gmic);インストーラー不要",
helpImageEditGmicInstall3: "設定タブ → G'MIC-Qt Executable Path に gmic_qt.exe のフルパスを入力(例: C:\\tools\\gmic\\gmic_qt.exe)して Save をクリック",
helpImageEditTabKbdTitle: "Image Edit タブのショートカット",
helpShortcutsTitle: "キーボード操作",
helpShortcuts1: "Escape:モーダル・パネルを閉じる",
@@ -1906,6 +1958,7 @@ const LANGUAGES = {
test: "测试",
copy: "复制",
close: "关闭",
clearFilters: "✕ 清除",
error: "错误",
// -- Tabs --
@@ -2357,6 +2410,8 @@ const LANGUAGES = {
galleryOutputDirLabel: "输出文件夹路径",
galleryOutputDirHint: "设置图库标签页浏览的ComfyUI输出文件夹。留空则使用ComfyUI默认输出目录。",
gallerySelectImageFirst: "请先选择图像",
galleryNoLoadImageNode: "当前工作流中没有LoadImage节点",
gallerySentGenUI: "已发送至GenerateUI图像标签",
galleryNoEmbeddedWorkflow: "此图像中未嵌入ComfyUI工作流。",
galleryBulkSelected: "项已选择",
galleryBulkDeselectAll: "取消全选",
@@ -2370,6 +2425,15 @@ const LANGUAGES = {
galleryBulkMoveTo: "移动到...",
galleryBulkExport: "导出",
galleryBulkDelete: "删除文件",
nodesBulkSelected: "项已选择",
nodesBulkDeselect: "取消全选",
nodesBulkAddToGroup: "选择分组",
nodesBulkGroupAdd: "添加到分组",
nodesBulkGroupRemove: "从分组中删除",
nodesBulkNewGroup: "新建分组名称",
nodesBulkCreateAdd: "创建并添加",
nodesBulkFavAll: "★ 全部收藏",
nodesBulkUnfavAll: "☆ 全部取消收藏",
downloadStarted: "下载开始",
exportCompleted: "导出完成。正在下载 ZIP 文件。",
@@ -2556,6 +2620,7 @@ const LANGUAGES = {
helpNodes4: "创建、重命名、删除节点组,分配/移除节点",
helpNodes5: "侧面板:详情(类名、包、分类、描述、标志)、I/O规格(输入输出类型和默认值)、组管理",
helpNodes6: "节点集:创建可复用的节点集合(含描述、标签、节点间链接定义)",
helpNodes7: "多选:Ctrl+点击切换单个节点,Shift+点击范围选择;出现批量操作栏,可添加到组/从组移除/新建组并添加/批量收藏/取消收藏",
helpModels1: "浏览已安装模型:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embedding,通过子标签切换",
helpModels2: "缩略图和表格视图模式切换(带分页)。表格视图除文件名、子文件夹和扩展名外,还显示来自CivitAI数据的Type / Base Model列。点击列标题可排序 — 第一次升序(▲),第二次降序(▼),第三次取消排序。E/D列按启用/禁用状态排序",
helpModels3: "搜索、标签筛选、分组筛选、收藏筛选、状态筛选(全部 / 仅启用 / 仅禁用)",
@@ -2585,6 +2650,7 @@ const LANGUAGES = {
helpGallery14: "Tagger按钮(紫色,位于详情面板操作行):将所选图像直接在Tagger标签的Single模式中打开,即可立即进行标注",
helpGallery15: "F按钮(青色悬浮按钮,每个缩略图左上角):单击即可将图像添加到/从__Feeder__组中移除;图像在组中时始终显示青色,不在组中时仅悬停时可见;可快速为Feeder标签Gallery模式添加队列图像",
helpGallery16: "Image Edit按钮(工具栏,Refresh按钮旁):将当前选中的图像发送到Image Edit标签;如果已有图层则按比例缩放添加为新图层,否则将成为Layer 1",
helpGallery17: "Send GenUI Image按钮(工具栏,Image Edit按钮旁):将选中图像上传至ComfyUI并设置为GenerateUI标签中第一个LoadImage节点的输入;自动切换至GenerateUI → Input → Image;需要预先加载包含至少一个LoadImage节点的工作流",
// -- Tagger Tab --
helpTaggerTitle: "Tagger标签",
@@ -2660,15 +2726,18 @@ const LANGUAGES = {
helpImageEdit29: "鼠标滚轮:放大/缩小",
helpImageEdit30: "双击(Select工具点击文字图层):重新编辑文字",
helpImageEdit7b: "Blur (≈):对活动图层应用高斯模糊或马赛克 — 整层或拖动矩形区域;详细内容参见下方「Blur Tool」卡片",
helpImageEdit7c: "BG Remove (⬚):使用Lightweight(@imgly,在浏览器中运行)或BiRefNet(Python后端,即将推出)去除活动图层背景;详细内容参见下方「BG Remove Tool」卡片",
helpImageEdit7d: "Mask (🎭):在画布上绘制白色遮罩;点击图层标题栏的「M」按钮添加遮罩图层,自动切换至Mask工具;遮罩以彩色半透明叠加方式显示;属性面板(图层面板左侧)显示Paint子工具控件;详细内容参见下方「Mask Tool」卡片",
helpImageEdit7c: "BG Remove (⬚):使用Lightweight(@imgly,在浏览器中运行)或BiRefNet(需要Mask Editor One + ComfyUI/models/background_removal/中的birefnet.safetensors)去除活动图层背景;详细内容参见下方「BG Remove Tool」卡片",
helpImageEdit7d: "Mask (🎭):使用Paint模式在画布上绘制白色遮罩,或使用SAM3文本提示分割(需要Mask Editor One);点击图层标题栏的「M」按钮添加遮罩图层,自动切换至Mask工具;遮罩以彩色半透明叠加方式显示;详细内容参见下方「Mask Tool」卡片",
helpImageEdit8b: "图层标题栏的「M」按钮:在当前活动图层上方添加新的遮罩图层,并自动切换至Mask工具",
helpImageEditMaskTitle: "Mask 工具 (🎭)",
helpImageEditMask1: "添加遮罩图层:点击图层面板标题栏的「M」按钮;新遮罩图层插入到活动图层上方,Mask工具自动激活",
helpImageEditMask2: "在图层列表中点击遮罩图层会自动切换至Mask工具",
helpImageEditMask3: "顶部工具栏(Paint / Invert / Overlay / Blur):Paint按钮切换Paint子工具(默认激活);Invert复选框反转叠加预览(在遮罩缺失处显示颜色);Overlay拾色器更改预览颜色(默认红色);Blur滑块(0–50 px)柔化叠加边缘",
helpImageEditMask4: "属性面板(图层面板左侧,Mask工具激活时显示):Size滑块(1–200 px)、Hardness滑块(0–100%)、Mode按钮 — Add按钮(绘制白色/遮罩存在)/ Erase按钮(擦除至透明/遮罩缺失);当前激活模式以蓝色高亮显示",
helpImageEditMask3: "顶部工具栏(Paint / SAM3 / Invert / Overlay / Blur):Paint/SAM3按钮切换子工具;Invert复选框反转叠加预览(在遮罩缺失处显示颜色);Overlay拾色器更改预览颜色(默认红色);Blur滑块(0–50 px)柔化叠加边缘;未安装Mask Editor One时SAM3按钮不可用",
helpImageEditMask4: "属性面板 — Paint模式:Mode(Add / Erase)、Size(1–200 px)、Hardness(0–100%);MASK EDITOR ONE区域(安装Mask Editor One后显示):Select按钮打开ABR笔刷库 — 选择笔刷将替换默认圆形笔刷;✕恢复Circle(默认);选择图像笔刷后Hardness禁用,并显示额外控件:Spacing(印章间距 5–100%)、Angle(旋转角度 0–359°)、Sz Jitter(每个印章的随机大小变化 0–100%)、Rot. Jitter(每个印章的随机旋转 on/off)",
helpImageEditMask5: "遮罩图层行的 ✂ 按钮:切换是否作为剪贴蒙版使用 — 启用(蓝色)时,遮罩将裁剪其正下方图层,仅显示已绘制区域;剪贴效果在保存PNG / Gallery / 发送至ComfyUI时均会生效",
helpImageEditMask6: "SAM3(需要Mask Editor One):由SAM3模型驱动的文本提示分割;输入目标对象描述(如\"cat\"、\"person\"),设置Max(最大蒙版候选数:3/6/9/12),然后点击Segment",
helpImageEditMask7: "SAM3操作流程:Segment后,候选蒙版缩略图显示在属性面板 — 点击选择(蓝色边框 + ✓);可多选;点击Apply Selected(N)批量应用;Mode(Add / Erase)控制蒙版与当前遮罩图层的合并方式;若活动图层非遮罩图层则自动创建新遮罩图层",
helpImageEditMask8: "ABR笔刷库(需要Mask Editor One,仅Paint模式):点击MASK EDITOR ONE区域的Select按钮打开笔刷选择器 — 左侧浏览文件夹,点击缩略图应用;「Round Brush (default)」恢复圆形笔刷;笔刷与Mask Editor One共享,存储在其brushes/文件夹",
helpImageEditBlurTitle: "Blur 工具 (≈)",
helpImageEditBlur1: "Whole Blur:对整个活动图层应用高斯模糊 — 调整强度滑块(1–50 px),点击Apply",
helpImageEditBlur2: "Whole Mosaic:对整个活动图层应用像素化马赛克 — 调整块大小滑块(5–100 px),点击Apply",
@@ -2678,10 +2747,19 @@ const LANGUAGES = {
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/(即将支持)",
helpImageEditBgRemove2: "模型 — BiRefNet:使用BiRefNet模型进行高质量背景去除;需要安装Mask Editor One并将birefnet.safetensors放置在ComfyUI/models/background_removal/",
helpImageEditBgRemove3: "New Layer(默认勾选):结果作为新图层添加到活动图层上方,位置和显示尺寸相同 — 原始图层保留",
helpImageEditBgRemove4: "取消勾选New Layer时,活动图层的画布将被去除背景的结果直接替换",
helpImageEditBgRemove5: "点击Remove BG开始处理;状态文字显示「Loading model → Processing → Done」;支持撤销(Ctrl+Z)",
helpImageEditGmicTitle: "G'MIC 滤镜(用G'MIC编辑)",
helpImageEditGmic1: "对活动图像图层应用G'MIC-Qt滤镜效果;处理结果将作为新图层加载",
helpImageEditGmic2: "点击工具栏中的「用G'MIC编辑」按钮,以当前图层图像启动G'MIC-Qt GUI",
helpImageEditGmic3: "在G'MIC-Qt中选择滤镜并调整参数后点击OK — 将显示「G'MIC-Qt filter output」窗口;关闭该窗口后结果将反映到Image Edit选项卡",
helpImageEditGmic4: "需要安装G'MIC-Qt Standalone并在设置的「G'MIC-Qt Executable Path」中配置路径;仅支持图像类型图层",
helpImageEditGmicInstallTitle: "G'MIC-Qt 安装方法",
helpImageEditGmicInstall1: "从 gmic.eu/download.html 下载G'MIC-Qt Standalone — 选择适合您操作系统的包(Windows: gmic_qt-win64.zip)",
helpImageEditGmicInstall2: "将zip解压到任意文件夹(如 C:\\tools\\gmic);无需安装程序",
helpImageEditGmicInstall3: "打开设置 → G'MIC-Qt Executable Path,输入 gmic_qt.exe 的完整路径(如 C:\\tools\\gmic\\gmic_qt.exe),点击 Save",
helpImageEditTabKbdTitle: "图像编辑选项卡快捷键",
helpShortcutsTitle: "键盘操作",
helpShortcuts1: "Escape:关闭弹窗/面板",
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -36,7 +36,7 @@ export class DrawTool {
onChange(fn) { this._onChange = fn; }
activate() {
if (this.canvas) this.canvas.style.cursor = "crosshair";
if (this.canvas) this.canvas.style.cursor = "none";
}
deactivate() {
+11
View File
@@ -28,6 +28,7 @@ export class Layer {
this.textProps = null; // テキストレイヤー用プロパティ(再編集・再描画に使用)
this.locked = false; // ロック中は SelectTool の変形を禁止
this.maskApply = false; // マスクレイヤー: true=クリッピングマスクとして機能
this.operation = "add"; // マスクレイヤー合成モード: "add" | "subtract"
}
clear() {
@@ -59,6 +60,7 @@ export class Layer {
textProps: this.textProps ?? null,
locked: this.locked ?? false,
maskApply: this.maskApply ?? false,
operation: this.operation ?? "add",
};
}
@@ -80,6 +82,7 @@ export class Layer {
layer.textProps = json.textProps ?? null;
layer.locked = json.locked ?? false;
layer.maskApply = json.maskApply ?? false;
layer.operation = json.operation ?? "add";
if (json.imageData) {
return new Promise(resolve => {
@@ -182,6 +185,14 @@ export class LayerManager {
if (layer && layer.type === "mask") { layer.maskApply = !layer.maskApply; this._emit("change"); }
}
toggleOperation(id) {
const layer = this.layers.find(l => l.id === id);
if (layer && layer.type === "mask") {
layer.operation = layer.operation === "add" ? "subtract" : "add";
this._emit("change");
}
}
setOpacity(id, opacity) {
const layer = this.layers.find(l => l.id === id);
if (layer) { layer.opacity = Math.max(0, Math.min(1, opacity)); this._emit("change"); }
+204 -4
View File
@@ -3,6 +3,9 @@
* White-paint / erase brush for mask layers.
* paint mode: draws white (opaque) = mask present
* erase mode: destination-out (transparent) = mask absent
*
* Supports circular soft brush (built-in) and image brushes loaded
* from Mask Editor One's ABR brush library (optional).
*/
export class MaskTool {
@@ -11,34 +14,69 @@ export class MaskTool {
this.ctx = canvas?.getContext("2d");
this.brushSize = 30;
this.hardness = 0.85;
this.spacing = 0.25; // stamp interval as fraction of brushSize (image brush only)
this.mode = "paint"; // "paint" | "erase"
// Image brush from ABR library (null = default circle brush)
this.brushImage = null;
this.brushName = "Circle";
this.angle = 0; // degrees [0, 359]
this.sizeJitter = false;
this.sizeJitterAmount = 0.5; // 0–1: fraction of brushSize that can be removed
this.rotationJitter = false;
this._drawing = false;
this._lastX = 0;
this._lastY = 0;
// Cached circle stamp
this._stamp = null;
this._stampSize = 0;
this._stampHard = 0;
this._stampMode = null;
// Cached image stamp
this._imgStamp = null;
this._imgStampSize = 0;
this._imgStampImg = null;
// Stroke buffer: prevents intra-stroke opacity accumulation (image brush only)
this._baseCanvas = null;
this._strokeCanvas = null;
this._strokeCtx = null;
this._onChange = null;
}
setCanvas(canvas) {
this.canvas = canvas;
this.ctx = canvas.getContext("2d");
this._stamp = null;
this._stamp = null;
this._imgStamp = null;
}
onChange(fn) { this._onChange = fn; }
setImageBrush(img, name) {
this.brushImage = img;
this.brushName = name;
this._imgStamp = null;
}
clearImageBrush() {
this.brushImage = null;
this.brushName = "Circle";
this._stamp = null;
this._imgStamp = null;
}
activate() {
if (this.canvas) this.canvas.style.cursor = "crosshair";
if (this.canvas) this.canvas.style.cursor = "none";
}
deactivate() {
this._drawing = false;
this._clearStrokeBuffer();
if (this.canvas) this.canvas.style.cursor = "";
}
@@ -46,12 +84,23 @@ export class MaskTool {
this._drawing = true;
this._lastX = x;
this._lastY = y;
this._paint(x, y);
if (this.brushImage) {
this._initStrokeBuffer();
this._paintToStroke(x, y);
this._mergeStroke();
} else {
this._paint(x, y);
}
}
onMouseMove(x, y) {
if (!this._drawing) return;
this._paintLine(this._lastX, this._lastY, x, y);
if (this.brushImage) {
this._paintLineToStroke(this._lastX, this._lastY, x, y);
this._mergeStroke();
} else {
this._paintLine(this._lastX, this._lastY, x, y);
}
this._lastX = x;
this._lastY = y;
}
@@ -59,6 +108,7 @@ export class MaskTool {
onMouseUp() {
if (this._drawing) {
this._drawing = false;
this._clearStrokeBuffer();
if (this._onChange) this._onChange();
}
}
@@ -67,6 +117,77 @@ export class MaskTool {
if (this._drawing) this.onMouseUp();
}
// ── Stroke buffer (image brush only) ─────────────────────────────
_initStrokeBuffer() {
const w = this.canvas.width;
const h = this.canvas.height;
this._baseCanvas = document.createElement("canvas");
this._baseCanvas.width = w;
this._baseCanvas.height = h;
this._baseCanvas.getContext("2d").drawImage(this.canvas, 0, 0);
this._strokeCanvas = document.createElement("canvas");
this._strokeCanvas.width = w;
this._strokeCanvas.height = h;
this._strokeCtx = this._strokeCanvas.getContext("2d");
}
_clearStrokeBuffer() {
this._baseCanvas = null;
this._strokeCanvas = null;
this._strokeCtx = null;
}
_mergeStroke() {
const ctx = this.ctx;
const w = this.canvas.width;
const h = this.canvas.height;
ctx.clearRect(0, 0, w, h);
ctx.drawImage(this._baseCanvas, 0, 0);
ctx.globalCompositeOperation = this.mode === "erase" ? "destination-out" : "lighten";
ctx.drawImage(this._strokeCanvas, 0, 0);
ctx.globalCompositeOperation = "source-over";
}
_paintToStroke(x, y) {
const saved = this.ctx;
this.ctx = this._strokeCtx;
if (this.sizeJitter || this.rotationJitter) {
const savedSize = this.brushSize;
const savedAngle = this.angle;
const savedStamp = this._imgStamp;
const savedStampSize = this._imgStampSize;
if (this.sizeJitter) {
this.brushSize = Math.max(1, savedSize * (1 - Math.random() * this.sizeJitterAmount));
}
if (this.rotationJitter) {
this.angle = Math.random() * 360;
}
this._paintImageBrush(x, y);
this.brushSize = savedSize;
this.angle = savedAngle;
this._imgStamp = savedStamp;
this._imgStampSize = savedStampSize;
} else {
this._paintImageBrush(x, y);
}
this.ctx = saved;
}
_paintLineToStroke(x0, y0, x1, y1) {
const dist = Math.hypot(x1 - x0, y1 - y0);
const step = Math.max(1, this.brushSize * this.spacing);
const steps = Math.ceil(dist / step);
for (let i = 1; i <= steps; i++) {
const t = i / steps;
this._paintToStroke(x0 + (x1 - x0) * t, y0 + (y1 - y0) * t);
}
}
// ── Circle brush ─────────────────────────────────────────────────
_getStamp() {
if (
this._stamp &&
@@ -121,4 +242,83 @@ export class MaskTool {
this._paint(x0 + (x1 - x0) * t, y0 + (y1 - y0) * t);
}
}
// ── Image brush ──────────────────────────────────────────────────
_getImageStamp(size) {
size = Math.max(1, size);
if (
this._imgStamp &&
this._imgStampSize === size &&
this._imgStampImg === this.brushImage
) return this._imgStamp;
const img = this.brushImage;
const srcW = img.naturalWidth || img.width;
const srcH = img.naturalHeight || img.height;
const aspect = (srcW > 0 && srcH > 0) ? srcW / srcH : 1;
const stampH = size;
const stampW = Math.max(1, Math.round(size * aspect));
const sc = document.createElement("canvas");
sc.width = stampW;
sc.height = stampH;
const stx = sc.getContext("2d");
stx.drawImage(img, 0, 0, stampW, stampH);
const imgData = stx.getImageData(0, 0, stampW, stampH);
const d = imgData.data;
// Detect alpha channel (ABR-exported PNGs carry alpha = brush density)
let hasAlpha = false;
for (let i = 3; i < d.length; i += 4) {
if (d[i] < 250) { hasAlpha = true; break; }
}
let invertLum = false;
if (!hasAlpha) {
const corners = [0, stampW - 1, stampW * (stampH - 1), stampW * stampH - 1];
let bgLum = 0;
for (const ci of corners) {
const ii = ci * 4;
bgLum += (d[ii] * 0.299 + d[ii + 1] * 0.587 + d[ii + 2] * 0.114) / 255;
}
invertLum = (bgLum / corners.length) > 0.5;
}
// Convert to white pixels; alpha = brush density
for (let i = 0; i < d.length; i += 4) {
let alpha;
if (hasAlpha) {
alpha = d[i + 3] / 255;
} else {
const lum = (d[i] * 0.299 + d[i + 1] * 0.587 + d[i + 2] * 0.114) / 255;
alpha = invertLum ? 1 - lum : lum;
}
d[i] = d[i + 1] = d[i + 2] = 255;
d[i + 3] = Math.round(alpha * 255);
}
stx.putImageData(imgData, 0, 0);
this._imgStamp = sc;
this._imgStampSize = size;
this._imgStampImg = this.brushImage;
return sc;
}
_paintImageBrush(x, y) {
const stamp = this._getImageStamp(Math.round(this.brushSize));
this.ctx.globalCompositeOperation = "source-over";
if (this.angle) {
this.ctx.save();
this.ctx.translate(Math.round(x), Math.round(y));
this.ctx.rotate((this.angle * Math.PI) / 180);
this.ctx.drawImage(stamp, -stamp.width / 2, -stamp.height / 2);
this.ctx.restore();
} else {
this.ctx.drawImage(stamp, Math.round(x - stamp.width / 2), Math.round(y - stamp.height / 2));
}
this.ctx.globalCompositeOperation = "source-over";
}
}
+37 -1
View File
@@ -7,7 +7,7 @@ import { showToast, openModal, closeModal } from "./app.js";
import { t } from "./i18n.js";
import { comfyUI } from "./comfyui-client.js";
import { comfyEditor } from "./comfyui-editor.js";
import { escapeHtml, readJsonStorage } from "./util.js";
import { escapeHtml, readJsonStorage, setupSearchClearBtn } from "./util.js";
// ── Constants ─────────────────────────────────────────────
const RESERVED_GROUPS = ["Batch", "Stack"];
@@ -2319,6 +2319,11 @@ export function initModelsTab() {
renderModelGrid();
});
}
setupSearchClearBtn("wfm-models-search", "wfm-models-search-clear-btn", () => {
state.searchText = "";
state.currentPage = 0;
renderModelGrid();
});
// Tag filter
document.getElementById("wfm-models-tag-filter")?.addEventListener("change", (e) => {
@@ -2404,6 +2409,37 @@ export function initModelsTab() {
clearStackGroup();
});
// Clear filters button
const modelsClearBtn = document.getElementById("wfm-models-clear-filters-btn");
if (modelsClearBtn) {
modelsClearBtn.textContent = t("clearFilters");
modelsClearBtn.addEventListener("click", () => {
state.searchText = "";
state.tagFilter = "";
state.dirFilter = "";
state.groupFilter = "";
state.statusFilter = "all";
state.showFavoritesOnly = false;
state.showBatchOnly = false;
state.currentPage = 0;
const searchInput = document.getElementById("wfm-models-search");
if (searchInput) searchInput.value = "";
const tagFilter = document.getElementById("wfm-models-tag-filter");
if (tagFilter) tagFilter.value = "";
const dirFilter = document.getElementById("wfm-models-dir-filter");
if (dirFilter) dirFilter.value = "";
const groupFilter = document.getElementById("wfm-models-group-filter");
if (groupFilter) groupFilter.value = "";
const statusFilter = document.getElementById("wfm-models-status-filter");
if (statusFilter) statusFilter.value = "all";
const favBtn = document.getElementById("wfm-models-fav-btn");
if (favBtn) favBtn.classList.remove("active");
const batchFilterBtn = document.getElementById("wfm-models-batch-filter-btn");
if (batchFilterBtn) batchFilterBtn.classList.remove("active");
renderModelGrid();
});
}
// View mode (thumb / card / table)
document.querySelectorAll("[data-models-view]").forEach((btn) => {
if (btn.dataset.modelsView === state.viewMode) {
+238 -3
View File
@@ -5,7 +5,7 @@
import { showToast } from "./app.js";
import { comfyUI } from "./comfyui-client.js";
import { t } from "./i18n.js";
import { escapeHtml } from "./util.js";
import { escapeHtml, setupSearchClearBtn } from "./util.js";
// ── State ─────────────────────────────────────────────────
@@ -26,6 +26,8 @@ const state = {
activeSubView: "browser",
loaded: false,
currentPage: 0,
selectedNodes: new Set(),
lastSelectionIndex: -1,
};
// ── Helpers ───────────────────────────────────────────────
@@ -273,6 +275,9 @@ function createNodeCard(node) {
if (state.selectedNode && state.selectedNode.name === node.name) {
card.classList.add("wfm-card-selected");
}
if (state.selectedNodes.has(node.name)) {
card.classList.add("multi-selected");
}
card.dataset.nodeName = node.name;
card.style.borderLeft = `3px solid ${packageColor(node.package)}`;
@@ -294,7 +299,32 @@ function createNodeCard(node) {
e.stopPropagation();
toggleFavorite(node.name, e.currentTarget);
});
card.addEventListener("click", () => showNodeSidePanel(node));
card.addEventListener("click", (e) => {
const filtered = filterNodes();
const idx = filtered.findIndex(n => n.name === node.name);
if (e.shiftKey && state.lastSelectionIndex !== -1) {
const from = Math.min(state.lastSelectionIndex, idx);
const to = Math.max(state.lastSelectionIndex, idx);
for (let i = from; i <= to; i++) {
state.selectedNodes.add(filtered[i].name);
}
_applyNodeSelectionToDOM();
updateNodeBulkBar();
} else if (e.ctrlKey || e.metaKey) {
if (state.selectedNodes.has(node.name)) {
state.selectedNodes.delete(node.name);
card.classList.remove("multi-selected");
} else {
state.selectedNodes.add(node.name);
card.classList.add("multi-selected");
}
state.lastSelectionIndex = idx;
updateNodeBulkBar();
} else {
state.lastSelectionIndex = idx;
showNodeSidePanel(node);
}
});
return card;
}
@@ -319,6 +349,9 @@ function renderNodeTableView(grid, filtered) {
if (state.selectedNode && state.selectedNode.name === node.name) {
tr.classList.add("wfm-card-selected");
}
if (state.selectedNodes.has(node.name)) {
tr.classList.add("multi-selected");
}
const inputCount = Object.keys(node.input.required || {}).length +
Object.keys(node.input.optional || {}).length;
const outputCount = (node.output || []).length;
@@ -332,7 +365,31 @@ function renderNodeTableView(grid, filtered) {
e.stopPropagation();
toggleFavorite(node.name, e.currentTarget);
});
tr.addEventListener("click", () => showNodeSidePanel(node));
tr.addEventListener("click", (e) => {
const idx = filtered.findIndex(n => n.name === node.name);
if (e.shiftKey && state.lastSelectionIndex !== -1) {
const from = Math.min(state.lastSelectionIndex, idx);
const to = Math.max(state.lastSelectionIndex, idx);
for (let i = from; i <= to; i++) {
state.selectedNodes.add(filtered[i].name);
}
_applyNodeSelectionToDOM();
updateNodeBulkBar();
} else if (e.ctrlKey || e.metaKey) {
if (state.selectedNodes.has(node.name)) {
state.selectedNodes.delete(node.name);
tr.classList.remove("multi-selected");
} else {
state.selectedNodes.add(node.name);
tr.classList.add("multi-selected");
}
state.lastSelectionIndex = idx;
updateNodeBulkBar();
} else {
state.lastSelectionIndex = idx;
showNodeSidePanel(node);
}
});
tbody.appendChild(tr);
});
table.appendChild(tbody);
@@ -351,6 +408,100 @@ async function toggleFavorite(nodeName, btnEl) {
btnEl.classList.toggle("active", newFav);
}
// ── 複数選択ユーティリティ ─────────────────────────────────
function _applyNodeSelectionToDOM() {
const grid = document.getElementById("wfm-nodes-grid");
if (!grid) return;
grid.querySelectorAll("[data-node-name]").forEach(el => {
el.classList.toggle("multi-selected", state.selectedNodes.has(el.dataset.nodeName));
});
}
function updateNodeBulkBar() {
const bar = document.getElementById("wfm-nodes-bulk-bar");
const countEl = document.getElementById("wfm-nodes-bulk-count");
if (!bar) return;
const count = state.selectedNodes.size;
if (count > 0) {
bar.style.display = "";
if (countEl) countEl.textContent = `${count} ${t("nodesBulkSelected")}`;
} else {
bar.style.display = "none";
}
const groupSel = document.getElementById("wfm-nodes-bulk-group-select");
if (groupSel) {
const current = groupSel.value;
const grpNames = Object.keys(state.nodeGroups).sort();
groupSel.innerHTML = `<option value="">${t("nodesBulkAddToGroup")}</option>` +
grpNames.map(g => `<option value="${escapeHtml(g)}">${escapeHtml(g)}</option>`).join("");
if (grpNames.includes(current)) groupSel.value = current;
}
}
// ── 一括操作 ──────────────────────────────────────────────
async function bulkNodeAddToGroup(groupName) {
if (!groupName || state.selectedNodes.size === 0) return;
const nodeNames = [...state.selectedNodes];
if (!state.nodeGroups[groupName]) state.nodeGroups[groupName] = [];
let added = 0;
nodeNames.forEach(name => {
if (!state.nodeGroups[groupName].includes(name)) {
state.nodeGroups[groupName].push(name);
added++;
}
});
await saveNodeGroups(state.nodeGroups);
renderFilters();
if (state.selectedNode) renderSideGroups(state.selectedNode);
showToast(t("addedNImagesToGroup", added, groupName), "success");
}
async function bulkNodeRemoveFromGroup(groupName) {
if (!groupName || state.selectedNodes.size === 0) return;
if (!state.nodeGroups[groupName]) return;
const nodeNames = new Set(state.selectedNodes);
const before = state.nodeGroups[groupName].length;
state.nodeGroups[groupName] = state.nodeGroups[groupName].filter(n => !nodeNames.has(n));
const removed = before - state.nodeGroups[groupName].length;
if (state.nodeGroups[groupName].length === 0) delete state.nodeGroups[groupName];
await saveNodeGroups(state.nodeGroups);
renderFilters();
if (state.selectedNode) renderSideGroups(state.selectedNode);
showToast(t("removedNImagesFromGroup", removed, groupName), "success");
}
async function bulkNodeCreateAndAddToGroup(name) {
if (!name || state.selectedNodes.size === 0) return;
if (state.nodeGroups[name] !== undefined) {
showToast(t("groupExists"), "warning");
return;
}
state.nodeGroups[name] = [...state.selectedNodes];
await saveNodeGroups(state.nodeGroups);
renderFilters();
if (state.selectedNode) renderSideGroups(state.selectedNode);
updateNodeBulkBar();
showToast(t("groupCreated", name), "success");
}
async function bulkNodeSetFavorite(value) {
if (state.selectedNodes.size === 0) return;
const nodeNames = [...state.selectedNodes].filter(name => {
const meta = state.nodeMetadata[name];
return (meta?.favorite ?? false) !== value;
});
if (nodeNames.length === 0) return;
await Promise.all(nodeNames.map(name => saveNodeMetadata(name, { favorite: value })));
nodeNames.forEach(name => {
if (!state.nodeMetadata[name]) state.nodeMetadata[name] = {};
state.nodeMetadata[name].favorite = value;
});
renderNodeGrid();
showToast(value ? t("favoritedNImages", nodeNames.length) : t("unfavoritedNImages", nodeNames.length), "success");
}
// ── Side Panel ────────────────────────────────────────────
function showNodeSidePanel(node) {
@@ -1044,6 +1195,11 @@ export function initNodesTab() {
renderNodeGrid();
});
}
setupSearchClearBtn("wfm-nodes-search", "wfm-nodes-search-clear-btn", () => {
state.searchText = "";
state.currentPage = 0;
renderNodeGrid();
});
// Filters
document.getElementById("wfm-nodes-category-filter")?.addEventListener("change", e => {
@@ -1109,9 +1265,88 @@ export function initNodesTab() {
});
});
// 一括操作バー: テキストをi18nで設定
const bulkDeselBtn = document.getElementById("wfm-nodes-bulk-deselect");
if (bulkDeselBtn) bulkDeselBtn.textContent = t("nodesBulkDeselect");
const bulkGroupAddBtn = document.getElementById("wfm-nodes-bulk-group-add");
if (bulkGroupAddBtn) bulkGroupAddBtn.textContent = t("nodesBulkGroupAdd");
const bulkGroupRemBtn = document.getElementById("wfm-nodes-bulk-group-remove");
if (bulkGroupRemBtn) bulkGroupRemBtn.textContent = t("nodesBulkGroupRemove");
const bulkCreateAddBtn = document.getElementById("wfm-nodes-bulk-create-add");
if (bulkCreateAddBtn) bulkCreateAddBtn.textContent = t("nodesBulkCreateAdd");
const bulkFavBtn = document.getElementById("wfm-nodes-bulk-fav");
if (bulkFavBtn) bulkFavBtn.textContent = t("nodesBulkFavAll");
const bulkUnfavBtn = document.getElementById("wfm-nodes-bulk-unfav");
if (bulkUnfavBtn) bulkUnfavBtn.textContent = t("nodesBulkUnfavAll");
const bulkNewGroupInput = document.getElementById("wfm-nodes-bulk-new-group");
if (bulkNewGroupInput) bulkNewGroupInput.placeholder = t("nodesBulkNewGroup");
document.getElementById("wfm-nodes-bulk-deselect")?.addEventListener("click", () => {
state.selectedNodes.clear();
state.lastSelectionIndex = -1;
updateNodeBulkBar();
document.querySelectorAll("#wfm-nodes-grid .multi-selected").forEach(el => el.classList.remove("multi-selected"));
});
document.getElementById("wfm-nodes-bulk-group-add")?.addEventListener("click", () => {
const sel = document.getElementById("wfm-nodes-bulk-group-select");
if (sel?.value) {
bulkNodeAddToGroup(sel.value);
} else {
showToast(t("selectGroupFirst"), "error");
}
});
document.getElementById("wfm-nodes-bulk-group-remove")?.addEventListener("click", () => {
const sel = document.getElementById("wfm-nodes-bulk-group-select");
if (sel?.value) {
bulkNodeRemoveFromGroup(sel.value);
} else {
showToast(t("selectGroupFirst"), "error");
}
});
document.getElementById("wfm-nodes-bulk-create-add")?.addEventListener("click", () => {
const input = document.getElementById("wfm-nodes-bulk-new-group");
const name = input?.value?.trim();
if (!name) return;
bulkNodeCreateAndAddToGroup(name).then(() => { if (input) input.value = ""; });
});
document.getElementById("wfm-nodes-bulk-fav")?.addEventListener("click", () => bulkNodeSetFavorite(true));
document.getElementById("wfm-nodes-bulk-unfav")?.addEventListener("click", () => bulkNodeSetFavorite(false));
// Create node set button
document.getElementById("wfm-node-set-create-btn")?.addEventListener("click", showCreateSetModal);
// Clear filters button
const nodesClearBtn = document.getElementById("wfm-nodes-clear-filters-btn");
if (nodesClearBtn) {
nodesClearBtn.textContent = t("clearFilters");
nodesClearBtn.addEventListener("click", () => {
state.searchText = "";
state.categoryFilter = "";
state.packageFilter = "";
state.tagFilter = "";
state.groupFilter = "";
state.showFavoritesOnly = false;
state.currentPage = 0;
const searchInput = document.getElementById("wfm-nodes-search");
if (searchInput) searchInput.value = "";
const catFilter = document.getElementById("wfm-nodes-category-filter");
if (catFilter) catFilter.value = "";
const pkgFilter = document.getElementById("wfm-nodes-package-filter");
if (pkgFilter) pkgFilter.value = "";
const tagFilter = document.getElementById("wfm-nodes-tag-filter");
if (tagFilter) tagFilter.value = "";
const grpFilter = document.getElementById("wfm-nodes-group-filter");
if (grpFilter) grpFilter.value = "";
const favBtn = document.getElementById("wfm-nodes-fav-btn");
if (favBtn) favBtn.classList.remove("active");
renderNodeGrid();
});
}
// Lazy load on first tab click
document.querySelector('[data-tab="nodes"]')?.addEventListener("click", () => {
if (!state.loaded) loadNodesData();
+42
View File
@@ -738,6 +738,24 @@ export async function initSettingsTab() {
</div>
</details>
<!-- G'MIC Integration -->
<details class="wfm-settings-section">
<summary class="wfm-settings-summary">G'MIC-Qt Integration</summary>
<div class="wfm-form-group">
<label>G'MIC-Qt Executable Path</label>
<div style="display:flex;gap:8px;">
<input type="text" class="wfm-input" id="wfm-settings-gmic-path"
value="${serverSettings.gmic_qt_path || ""}"
placeholder="C:\\path\\to\\gmic_qt.exe"
style="flex:1;">
<button class="wfm-btn wfm-btn-primary wfm-btn-sm" id="wfm-settings-gmic-path-save">
Save
</button>
</div>
<div id="wfm-settings-gmic-path-status" style="font-size:12px;margin-top:4px;"></div>
</div>
</details>
<!-- Data Management -->
<details class="wfm-settings-section">
<summary class="wfm-settings-summary">${t("dataManagement")}</summary>
@@ -1415,4 +1433,28 @@ export async function initSettingsTab() {
// Reset file input so same file can be re-selected
e.target.value = "";
});
// Save G'MIC path setting
document.getElementById("wfm-settings-gmic-path-save")?.addEventListener("click", async () => {
const path = document.getElementById("wfm-settings-gmic-path")?.value.trim() || "";
const statusEl = document.getElementById("wfm-settings-gmic-path-status");
if (statusEl) {
statusEl.textContent = "Saving...";
statusEl.style.color = "var(--wfm-text-secondary)";
}
try {
await saveServerSettings({ gmic_qt_path: path });
serverSettings.gmic_qt_path = path;
showToast("G'MIC path saved successfully", "success");
if (statusEl) {
statusEl.textContent = "Saved successfully!";
statusEl.style.color = "var(--wfm-success)";
}
} catch (err) {
if (statusEl) {
statusEl.textContent = "Error: " + err.message;
statusEl.style.color = "var(--wfm-danger)";
}
}
});
}
+27
View File
@@ -26,3 +26,30 @@ export function readJsonStorage(key, fallback = {}) {
export function getSettings() {
return readJsonStorage("wfm_settings");
}
/**
* 検索inputにオーバーレイXボタンを設定する。
* @param {string} inputId - 検索inputのID
* @param {string} clearBtnId - クリアボタンのID
* @param {Function} onClear - クリア時に呼び出すコールバック(inputは既に空になった後で呼ばれる)
*/
export function setupSearchClearBtn(inputId, clearBtnId, onClear) {
const input = document.getElementById(inputId);
const btn = document.getElementById(clearBtnId);
if (!input || !btn) return;
const sync = () => {
btn.style.display = input.value ? "flex" : "none";
};
input.addEventListener("input", sync);
btn.addEventListener("click", () => {
input.value = "";
btn.style.display = "none";
input.focus();
onClear();
});
// 初期値が入っている場合に備えて同期
sync();
}
+25 -1
View File
@@ -10,7 +10,7 @@ import { loadWorkflowIntoEditor } from "./generate-tab.js";
import { t, getSummaryPrompt } from "./i18n.js";
import { highlightJSON } from "./json-highlight.js";
import { openBadgeEditModal } from "./models-tab.js";
import { escapeHtml, getSettings, readJsonStorage } from "./util.js";
import { escapeHtml, getSettings, readJsonStorage, setupSearchClearBtn } from "./util.js";
// ============================================
// Constants
@@ -1227,6 +1227,11 @@ export function initWorkflowTab() {
renderGrid();
});
}
setupSearchClearBtn("wfm-search", "wfm-search-clear-btn", () => {
state.searchText = "";
state.currentPage = 0;
renderGrid();
});
// Drag & drop on workflow grid
const grid = document.getElementById("wfm-workflow-grid");
@@ -1354,6 +1359,25 @@ export function initWorkflowTab() {
clearBatch();
});
// Toolbar: Clear filters button
const wfClearBtn = document.getElementById("wfm-wf-clear-filters-btn");
if (wfClearBtn) {
wfClearBtn.textContent = t("clearFilters");
wfClearBtn.addEventListener("click", () => {
state.activeBadge = "ALL";
state.showBatchOnly = false;
state.searchText = "";
state.groupFilter = "";
state.currentPage = 0;
const searchInput = document.getElementById("wfm-search");
if (searchInput) searchInput.value = "";
const groupFilter = document.getElementById("wfm-group-filter");
if (groupFilter) groupFilter.value = "";
renderModelFilters();
renderGrid();
});
}
// Initial load
loadWorkflows();
}
+65 -10
View File
@@ -46,7 +46,10 @@
</div>
<!-- Row 2: Search, group filter, actions -->
<div class="wfm-toolbar-row">
<input type="text" id="wfm-search" class="wfm-search-input" placeholder="Search...">
<div class="wfm-search-wrap">
<input type="text" id="wfm-search" class="wfm-search-input" placeholder="Search...">
<button class="wfm-search-clear-btn" id="wfm-search-clear-btn" title="Clear search">✕</button>
</div>
<select id="wfm-group-filter" class="wfm-select wfm-toolbar-select">
<option value="">All Groups</option>
</select>
@@ -67,6 +70,7 @@
<div id="wfm-badge-settings-panel" class="wfm-badge-settings-panel" style="display:none;"></div>
</div>
<button id="wfm-wf-batch-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all batch workflows">BC</button>
<button id="wfm-wf-clear-filters-btn" class="wfm-btn wfm-btn-sm" title="Clear all filters"></button>
</div>
</div>
<div class="wfm-workflow-area">
@@ -124,7 +128,10 @@
<!-- Browser toolbar -->
<div id="wfm-nodes-browser-toolbar" class="wfm-toolbar-row" style="gap:6px;flex-wrap:wrap;">
<button class="wfm-filter-btn" id="wfm-nodes-fav-btn" title="Favorites">&#9733;</button>
<input type="text" id="wfm-nodes-search" class="wfm-search-input" placeholder="Search nodes...">
<div class="wfm-search-wrap">
<input type="text" id="wfm-nodes-search" class="wfm-search-input" placeholder="Search nodes...">
<button class="wfm-search-clear-btn" id="wfm-nodes-search-clear-btn" title="Clear search">✕</button>
</div>
<select id="wfm-nodes-category-filter" class="wfm-select wfm-toolbar-select"><option value="">All Categories</option></select>
<select id="wfm-nodes-package-filter" class="wfm-select wfm-toolbar-select"><option value="">All Packages</option></select>
<select id="wfm-nodes-tag-filter" class="wfm-select wfm-toolbar-select"><option value="">All Tags</option></select>
@@ -135,9 +142,26 @@
</div>
<span id="wfm-nodes-count" class="wfm-nodes-count"></span>
<button id="wfm-nodes-refresh-btn" class="wfm-btn wfm-btn-sm">Refresh</button>
<button id="wfm-nodes-clear-filters-btn" class="wfm-btn wfm-btn-sm" title="Clear all filters"></button>
</div>
</div>
<!-- 複数選択時の一括操作バー(ブラウザエリア外に配置) -->
<div id="wfm-nodes-bulk-bar" class="wfm-gallery-bulk-bar" style="display:none;">
<span id="wfm-nodes-bulk-count" class="wfm-gallery-bulk-count"></span>
<button id="wfm-nodes-bulk-deselect" class="wfm-btn wfm-btn-sm"></button>
<span style="border-left:1px solid var(--wfm-border);height:18px;margin:0 2px;"></span>
<select id="wfm-nodes-bulk-group-select" class="wfm-select" style="font-size:12px;padding:2px 4px;max-width:140px;"></select>
<button id="wfm-nodes-bulk-group-add" class="wfm-btn wfm-btn-sm"></button>
<button id="wfm-nodes-bulk-group-remove" class="wfm-btn wfm-btn-sm"></button>
<span style="border-left:1px solid var(--wfm-border);height:18px;margin:0 2px;"></span>
<input type="text" id="wfm-nodes-bulk-new-group" class="wfm-input" style="font-size:12px;padding:2px 6px;width:130px;">
<button id="wfm-nodes-bulk-create-add" class="wfm-btn wfm-btn-sm"></button>
<span style="border-left:1px solid var(--wfm-border);height:18px;margin:0 2px;"></span>
<button id="wfm-nodes-bulk-fav" class="wfm-btn wfm-btn-sm"></button>
<button id="wfm-nodes-bulk-unfav" class="wfm-btn wfm-btn-sm"></button>
</div>
<!-- Browser sub-view -->
<div id="wfm-nodes-browser" class="wfm-workflow-area">
<div id="wfm-nodes-grid" class="wfm-grid wfm-view-card">
@@ -195,7 +219,10 @@
<div id="wfm-models-toolbar" class="wfm-toolbar-row" style="gap:6px;flex-wrap:wrap;">
<button class="wfm-filter-btn" id="wfm-models-fav-btn" title="Favorites">&#9733;</button>
<button class="wfm-filter-btn" id="wfm-models-batch-filter-btn" title="Batch">B</button>
<input type="text" id="wfm-models-search" class="wfm-search-input" placeholder="Search models...">
<div class="wfm-search-wrap">
<input type="text" id="wfm-models-search" class="wfm-search-input" placeholder="Search models...">
<button class="wfm-search-clear-btn" id="wfm-models-search-clear-btn" title="Clear search">✕</button>
</div>
<select id="wfm-models-tag-filter" class="wfm-select wfm-toolbar-select"><option value="">All Tags</option></select>
<select id="wfm-models-dir-filter" class="wfm-select wfm-toolbar-select"><option value="">All Folders</option></select>
<select id="wfm-models-group-filter" class="wfm-select wfm-toolbar-select"><option value="">All Groups</option></select>
@@ -216,6 +243,7 @@
<button id="wfm-models-select-btn" class="wfm-btn wfm-btn-sm wfm-btn-success" title="Multi-select models">Select</button>
<button id="wfm-models-batch-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all batch entries">BC</button>
<button id="wfm-models-stack-clear-btn" class="wfm-btn wfm-btn-sm" title="Clear all stack entries (Lora)">SC</button>
<button id="wfm-models-clear-filters-btn" class="wfm-btn wfm-btn-sm" title="Clear all filters"></button>
</div>
<!-- Bulk action bar (shown in select mode) -->
<div id="wfm-models-bulk-bar" class="wfm-bulk-bar" style="display:none;"></div>
@@ -1172,6 +1200,7 @@
<li id="wfm-help-nodes-4">Create, rename, delete node groups and assign/remove nodes</li>
<li id="wfm-help-nodes-5">Side panel: Details (class name, package, category, description, flags), I/O Spec (inputs/outputs with types and defaults), Groups management</li>
<li id="wfm-help-nodes-6">Node Sets: create reusable node collections with descriptions, tags, and link definitions between nodes</li>
<li id="wfm-help-nodes-7">Multi-select: Ctrl+click to toggle individual nodes, Shift+click for range selection; bulk action bar appears with add to group / remove from group / create &amp; add group / bulk favorite / unfavorite</li>
</ul>
</div>
</div>
@@ -1196,6 +1225,7 @@
<li id="wfm-help-gallery-13"><b>Load GenUI</b> 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</li>
<li id="wfm-help-gallery-14"><b>Tagger</b> button (purple, in the detail panel action row): opens the selected image directly in the Tagger tab's Single mode for instant tagging</li>
<li id="wfm-help-gallery-16"><b>Image Edit</b> 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</li>
<li id="wfm-help-gallery-17"><b>Send GenUI Image</b> button (toolbar, next to Image Edit): uploads the selected image to ComfyUI and sets it as the input for the first LoadImage node in the GenerateUI tab; automatically switches to GenerateUI → Input → Image; requires a workflow with at least one LoadImage node to be loaded first</li>
</ul>
</div>
</div>
@@ -1293,8 +1323,8 @@
<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>
<li id="wfm-help-imageedit-7d">Mask (🎭): paint a white mask on the canvas; click "M" in the Layers header to add a mask layer — the Mask tool activates automatically; the mask is shown as a colored semi-transparent overlay; the Properties pane (left of the Layers panel) shows Paint controls; see the Mask 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 (requires Mask Editor One + birefnet.safetensors in ComfyUI/models/background_removal/); see the BG Remove Tool card below for details</li>
<li id="wfm-help-imageedit-7d">Mask (🎭): paint a white mask on the canvas with Paint mode or use SAM3 text-prompt segmentation (requires Mask Editor One); click "M" in the Layers header to add a mask layer — the Mask tool activates automatically; the mask is shown as a colored semi-transparent overlay; see the Mask Tool card below for details</li>
</ul>
</div>
<div class="wfm-help-card">
@@ -1324,7 +1354,7 @@
<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-2">Model — BiRefNet: high-quality background removal using the BiRefNet model; requires Mask Editor One to be installed and birefnet.safetensors placed in ComfyUI/models/background_removal/</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>
@@ -1335,9 +1365,29 @@
<ul>
<li id="wfm-help-imageedit-mask-1">Add a mask layer: click the "M" button in the Layers panel header; the new mask layer is inserted above the active layer and the Mask tool activates automatically</li>
<li id="wfm-help-imageedit-mask-2">Clicking a mask layer in the layer list automatically switches to the Mask tool</li>
<li id="wfm-help-imageedit-mask-3">Tool Options bar (Paint / Invert / Overlay / Blur): Paint button toggles the Paint sub-tool; Invert checkbox inverts the overlay preview (shows color where mask is absent); Overlay color picker changes the preview color (default red); Blur slider (0–50 px) softens the overlay edge</li>
<li id="wfm-help-imageedit-mask-4">Properties pane (left of the Layers panel, visible when Mask tool is active): Size (1–200 px), Hardness (0–100%), Mode — Add button draws white (mask present) / Erase button removes to transparent (mask absent); the active mode is highlighted in blue</li>
<li id="wfm-help-imageedit-mask-3">Tool Options bar (Paint / SAM3 / Invert / Overlay / Blur): Paint/SAM3 buttons switch sub-tools; Invert checkbox inverts the overlay preview (shows color where mask is absent); Overlay color picker changes the preview color (default red); Blur slider (0–50 px) softens the overlay edge; SAM3 button is disabled when Mask Editor One is not installed</li>
<li id="wfm-help-imageedit-mask-4">Properties pane — Paint mode: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); MASK EDITOR ONE section (visible when Mask Editor One is installed): Select button opens the ABR brush library — choosing a brush replaces the default circle brush; ✕ clears the brush back to Circle; when an image brush is active, Hardness is disabled and additional controls appear: Spacing (stamp interval 5–100%), Angle (rotation 0–359°), Sz Jitter (random size reduction per stamp 0–100%), Rot. Jitter (random rotation per stamp on/off)</li>
<li id="wfm-help-imageedit-mask-5">✂ button on a mask layer row: toggles the layer as a clipping mask — when enabled (blue), the mask clips the layer directly below it so only the painted area is visible; clipping is applied when saving PNG / Gallery / ComfyUI</li>
<li id="wfm-help-imageedit-mask-6">SAM3 (Mask Editor One required): text-prompt segmentation powered by the SAM3 model; enter a description of the object to segment (e.g. "cat", "person"), set Max (maximum mask candidates: 3/6/9/12), then click Segment</li>
<li id="wfm-help-imageedit-mask-7">SAM3 workflow: after Segment, candidate masks appear as thumbnails in the Properties pane — click to select (blue border + ✓); multiple masks can be selected; click Apply Selected (N) to apply them all; Mode (Add / Erase) controls how masks are merged into the current mask layer; a new mask layer is created automatically if the active layer is not a mask</li>
<li id="wfm-help-imageedit-mask-8">ABR Brush Library (Mask Editor One required, Paint mode only): click Select in the MASK EDITOR ONE section to open the brush picker — browse folders on the left, click a thumbnail to apply; "Round Brush (default)" restores the circle brush; brushes are shared with Mask Editor One and stored in its brushes/ folder</li>
</ul>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-imageedit-gmic-title">G'MIC Filter (Edit with G'MIC)</h3>
<ul>
<li id="wfm-help-imageedit-gmic-1">Applies G'MIC-Qt filter effects to the active image layer; the result is loaded back as a new layer</li>
<li id="wfm-help-imageedit-gmic-2">Click "Edit with G'MIC" in the toolbar to launch G'MIC-Qt GUI with the current layer image</li>
<li id="wfm-help-imageedit-gmic-3">In G'MIC-Qt: choose a filter, adjust parameters, then click OK — a "G'MIC-Qt filter output" window appears; close it to save and return the result to the Image Edit tab</li>
<li id="wfm-help-imageedit-gmic-4">Requires G'MIC-Qt Standalone to be installed and its path configured in Settings → G'MIC-Qt Executable Path; only image-type layers are supported</li>
</ul>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-imageedit-gmic-install-title">G'MIC-Qt Installation</h3>
<ul>
<li id="wfm-help-imageedit-gmic-install-1">Download G'MIC-Qt Standalone from <strong>gmic.eu/download.html</strong> — choose the "G'MIC-Qt" package for your OS (Windows: gmic_qt-win64.zip)</li>
<li id="wfm-help-imageedit-gmic-install-2">Extract the zip to any folder (e.g. C:\tools\gmic); no installer required</li>
<li id="wfm-help-imageedit-gmic-install-3">Open Settings → G'MIC-Qt Executable Path, enter the full path to gmic_qt.exe (e.g. C:\tools\gmic\gmic_qt.exe), then click Save</li>
</ul>
</div>
<div class="wfm-help-card">
@@ -1448,7 +1498,10 @@
<div class="wfm-toolbar">
<div class="wfm-toolbar-row" style="gap:6px;flex-wrap:wrap;align-items:center;">
<button id="wfm-gallery-fav-btn" class="wfm-filter-btn" title="Favorites">&#9733;</button>
<input type="text" id="wfm-gallery-search" class="wfm-search-input" placeholder="Search images...">
<div class="wfm-search-wrap">
<input type="text" id="wfm-gallery-search" class="wfm-search-input" placeholder="Search images...">
<button class="wfm-search-clear-btn" id="wfm-gallery-search-clear-btn" title="Clear search">✕</button>
</div>
<select id="wfm-gallery-tag-filter" class="wfm-select wfm-toolbar-select">
<option value="">All Tags</option>
</select>
@@ -1469,6 +1522,8 @@
<span id="wfm-gallery-count" class="wfm-nodes-count"></span>
<button id="wfm-gallery-refresh-btn" class="wfm-btn wfm-btn-sm">Refresh</button>
<button id="wfm-gallery-send-image-edit-btn" class="wfm-btn wfm-btn-sm" title="Send selected image to Image Edit tab">Image Edit</button>
<button id="wfm-gallery-send-genui-image-btn" class="wfm-btn wfm-btn-sm" title="Send selected image to GenerateUI Image input">Send GenUI Image</button>
<button id="wfm-gallery-clear-filters-btn" class="wfm-btn wfm-btn-sm" title="Clear all filters"></button>
</div>
<!-- 複数選択時の一括操作バー -->
<div id="wfm-gallery-bulk-bar" class="wfm-gallery-bulk-bar" style="display:none;">
@@ -1591,7 +1646,7 @@
<button class="ie-tool-btn" data-tool="shape" title="Shape (S)">□</button>
<button class="ie-tool-btn" data-tool="mask" title="Mask">🎭</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" data-tool="filter" title="Filter">★</button>
<button class="ie-tool-btn" data-tool="bgremove" title="BG Remove">⬚</button>
</div>
+1 -1
View File
@@ -408,7 +408,7 @@ const placePromptNode = (posText, negText, promptName, pos) => {
}
node.pos = pos || [100, 100];
if (promptName) node.title = promptName;
node.title = "Wfs Prompt";
graph.add(node);
+41 -13
View File
@@ -611,27 +611,55 @@ app.registerExtension({
{ tooltip: NODE_SETS_TOOLTIP, className: "wfm-node-sets-btn", getIcon: getNodeSetsIcon, styles: null },
];
const replaceButtonIcons = () => {
const applyIconToButton = (btn, cfg) => {
// Skip if the SVG icon is already in place
if (btn.querySelector("svg")) return;
btn.classList.add(cfg.className);
btn.innerHTML = cfg.getIcon();
btn.style.borderRadius = "4px";
btn.style.padding = "6px";
if (cfg.styles) Object.assign(btn.style, cfg.styles);
const svg = btn.querySelector("svg");
if (svg) {
svg.style.width = "20px";
svg.style.height = "20px";
}
};
// Initial application — retry until buttons are rendered by Vue
const pollUntilFound = () => {
let foundAny = false;
for (const cfg of buttonConfigs) {
document.querySelectorAll(`button[aria-label="${cfg.tooltip}"]`).forEach((btn) => {
foundAny = true;
btn.classList.add(cfg.className);
btn.innerHTML = cfg.getIcon();
btn.style.borderRadius = "4px";
btn.style.padding = "6px";
if (cfg.styles) Object.assign(btn.style, cfg.styles);
const svg = btn.querySelector("svg");
if (svg) {
svg.style.width = "20px";
svg.style.height = "20px";
}
applyIconToButton(btn, cfg);
});
}
if (!foundAny) {
requestAnimationFrame(replaceButtonIcons);
requestAnimationFrame(pollUntilFound);
}
};
requestAnimationFrame(replaceButtonIcons);
requestAnimationFrame(pollUntilFound);
// MutationObserver: re-apply icons after Vue re-renders the action bar
// (e.g. when the Properties Panel is toggled inside a subgraph)
if (typeof MutationObserver !== "undefined") {
const observer = new MutationObserver(() => {
for (const cfg of buttonConfigs) {
document.querySelectorAll(`button[aria-label="${cfg.tooltip}"]`).forEach((btn) => {
// Only re-apply when Vue has reset innerHTML back to <i>
if (btn.querySelector("i")) {
applyIconToButton(btn, cfg);
}
});
}
});
const watchNode =
document.querySelector("[data-testid='action-bar-buttons']") ||
document.querySelector(".actionbar-container") ||
document.body;
observer.observe(watchNode, { childList: true, subtree: true });
window.__wfmIconObserver = observer;
}
},
});