Compare commits

...
4 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 5 8f43412e96 release: v0.3.71 — Inpaint機能追加(GenerateUI マスクスロット・Image Edit Inpaintタブ・Mask Editor One対応・専用ワークフロー)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-23 20:40:13 +09:00
ketle-manandClaude Sonnet 5 b1e665b46b release: v0.3.70 — Ollama summary fix, Image Edit Layer 1 + mask overlay, GenerateUI prompt revert & weight editing
- Workflow AI summary: use the Ollama URL/model saved in Settings instead of a
  hardcoded default model tag that caused a 404 against locally installed models
- Image Edit: New button now auto-adds an empty Layer 1 (matching image-load behavior)
- Image Edit: mask overlay is now shown only for the active mask layer
- GenerateUI Input: Revert button (↺) next to Apply reverts the textarea to the
  node's currently applied value
- GenerateUI Input: Ctrl+Up/Down adjusts prompt emphasis weight in (text:weight)
  syntax by ±0.05, A1111/native ComfyUI style
- Comic Creator I2I integration (window._wfmReceiveImageForI2I) carried over from
  v0.3.69 that had been implemented but not yet committed

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 00:59:41 +09:00
ketle-manandClaude Sonnet 5 335ee517cc release: v0.3.69 — Lora batch fixes, prompt auto-sync, Comic Creator Send CC
Lora batch generation:
- Fix `Prompt outputs failed validation` errors for LoRAs that actually
  exist. Root cause: ComfyUI on Windows returns `\`-separated LoRA enum
  values while WFS tracked LoRAs internally with `/`. Added a shared
  `comfyEditor.resolveLoraName()` helper and applied it consistently to
  Lora Single apply, Stack apply, the Models tab GenUI Model button, and
  Lora batch generation.
- Add a pre-flight check before batch runs on standard LoraLoader
  workflows: warns if a selected LoRA isn't yet recognized by ComfyUI's
  model list (suggests Refresh/restart) instead of silently failing
  each queued prompt.
- Batch-applied LoRAs now auto-append their `<lora:...>` syntax and
  CivitAI trained words to the Positive prompt, rebuilt from the
  original prompt each time (not accumulated), and restore the prompt
  to its pre-batch state on completion, stop, or error.

Models tab:
- Add a Close button to the model detail modal's button row (next to
  Save / GenUI PP·NP / Delete) to cut down on mouse travel during
  repeated batch edits.

Gallery tab:
- Add Send CC button (shown only when embedded as an iframe inside
  ComfyUI Comic Creator, renamed from "Comic Creater") that sends the
  selected image into Comic Creator's selected panel/overlay via its
  existing insertImageFromUrl(url) helper.

Help / docs:
- New help entry helpGen19 (EN/JA/ZH) describing the Lora batch prompt
  sync, restore, and pre-flight check behavior.
- README and DEVLOG updated for v0.3.69.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-12 22:21:49 +09:00
ketle-manandClaude Sonnet 5 8509eee527 release: v0.3.68 — MASK EDITOR ONE section always visible
Show the MASK EDITOR ONE / MASK EDITOR ONE (COLOR) properties section
at all times in Draw and Mask Paint mode, instead of hiding it when no
ABR brushes are imported yet. Header text is green when brushes are
available and gray otherwise, with the Select button disabled until a
brush exists. Prompted by a report that ABR brushes "don't show up" —
SAM3/BiRefNet were confirmed working; the real cause was an empty
brushes/ folder hiding the whole section.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 19:18:10 +09:00
19 changed files with 2608 additions and 68 deletions
+183
View File
@@ -2,6 +2,189 @@
---
## v0.3.71
### Inpaint機能の追加(GenerateUI Imageタブ + Image Edit「Inpaint」タブ)
ユーザー要望「インペイント機能を追加したい」。参考ワークフロー(SDXL + VAEEncodeForInpaint構成)の解析から着手し、複数セッションにわたり段階的に実装。
**対象ファイル:** `static/js/comfyui-workflow.js`, `static/js/comfyui-editor.js`, `static/js/image-edit-tab.js`, `static/js/generate-tab.js`, `static/js/i18n.js`, `static/css/main.css`, `templates/index.html`, `static/js/app.js`
**ワークフロー解析(`analyzeWorkflow`):**
- `load_image_nodes` に `mask_used` フラグを追加。`LoadImage` ノードのMASK出力(output slot 1)が他ノードの入力(`["<id>", 1]` 参照)として使われているかを走査して判定。`MaskEditorNode` 等の中継ノードを経由していても、参照元のLoadImageまで正しく特定できる
- `inpaint_encode_nodes`(`VAEEncodeForInpaint` の `grow_mask_by`)、`mask_editor_one_nodes`(`MaskEditorOne` ノード)を新規検出
**生成UI Input/Imageタブ — マスクスロット:**
- `mask_used` なLoadImageスロットにのみ「Mask」ドロップゾーンを追加表示
- Apply時、マスク指定があれば画像+マスクをRGBA合成(マスク白領域→アルファ0)して1枚のPNGとしてアップロード。ComfyUIネイティブの `mask = 1 - alpha` 抽出にそのまま準拠するため追加ノード不要
- Mask Editor One ノード用の専用スロットも追加(画像・マスクの両方が揃って初めてApply可能)
**Image Editタブ — Inpaintツール(🩹):**
- プロパティパネルにポジ/ネガプロンプト、Grow Mask By、Denoise、Runボタン、結果画像プレビューを追加
- Run押下で: 非マスクレイヤー合成画像 + アクティブなマスクレイヤーを書き出し → 生成UIのインペイント対応スロットへRGBA合成アップロード → プロンプト/grow_mask_by/denoiseを反映 → GenerateUIの生成を呼び出し(画面はImage Editタブに留まる)→ 完了後の結果画像をプロパティパネルに表示
- **バグ修正:** ツールバーの `<button data-tool="inpaint">` を `templates/index.html` に追加し忘れており、`TOOL_DEFS` にエントリを追加しただけではボタンが表示されない不具合があった(ツールバーは静的HTML、`TOOL_DEFS` は `ready` 判定とラベル参照専用)
**Mask Editor One(`comfyui-mask-editor-one`)対応:**
- 実装(`nodes.py`/`server.py`)を調査した結果、この custom node は `LoadImage` を介さず、画像はサーバー側インメモリキャッシュ(`node_id` キー、`bg_image_b64`、`/mask_editor/store_image` でPOST)から、マスクは `layer_data`(JSON文字列ウィジェット)の各レイヤーの**アルファチャンネル**から合成されると判明(`LoadImage` の `1 - alpha` とは逆で、alpha値がそのままmask値になる規約)
- `comfyEditor.applyImageAndMaskToMaskEditorOneNode()` を新規実装し、この2つの経路(画像キャッシュPOST + layer_data書き込み)を実装
- Inpaint Runは `mask_used` なLoadImageスロットを優先し、無ければMask Editor Oneノードへ自動フォールバック
**インペイント専用ワークフロー:**
- Inpaintプロパティ上部に「Use dedicated workflow」チェックボックス + 保存済みワークフロー選択ドロップダウンを追加。OFF時は従来通りGenerateUIの読み込み中ワークフローを使用、ON時は選択したワークフローをその場でロード・解析し、**GenerateUIタブの表示状態には一切触れずに**画像/マスク/プロンプト/パラメータを適用して生成
- `generate-tab.js`: `_coreGenerate`/`handleGenerate` に `workflowOverride` 引数を追加(省略時は従来通り `comfyUI.currentWorkflow` を使用)。オーバーライド時はバッチモードの影響を受けない単発生成に固定し、GenerateUI側のプロンプト同期(`syncToWorkflow`)もスキップ
- `comfyui-editor.js`: `applyImageAndMaskToSlot` / `applyImageAndMaskToMaskEditorOneNode` / `setPromptText` / `setInpaintParams` に `{workflow, analysis}` オプションを追加し、指定時はそちらへ直接書き込む方式に統一
**サンプルワークフロー追加:** `workflows/ws_inpaint_basic.json`(LoadImage直結)、`workflows/ws_inpaint_mask_editor_one.json`(Mask Editor One使用)とプレビュー画像
**ヘルプ更新(3点セット):** `templates/index.html`、`static/js/i18n.js`(EN/JA/ZH `helpImageEdit7e` 新規)、`static/js/app.js`(`helpIdMap` に `wfm-help-imageedit-7e` 追加)
**既知の簡略化点:** Grow Mask By / Denoiseのプロパティパネル初期表示値は、専用ワークフロー使用時も常にGenerateUI側の読み込み中ワークフローから算出される(Run実行時に書き込まれる値自体は専用ワークフロー側に正しく反映される)
## v0.3.70
### Workflow AI要約: Ollama 404エラー修正
ユーザー報告「ワークフロー詳細モーダルの要約機能でエラー `[ERROR] Ollama chat error: HTTP Error 404: Not Found`」の調査から発生。
**原因:** `static/js/workflow-tab.js` の要約ボタンはモデル名を指定せずサーバー側 `/api/wfm/ollama/chat` を呼んでおり、サーバー側デフォルト(`py/routes/ollama_routes.py` の `OLLAMA_DEFAULTS.model = "llava"`、タグ無し)が使われていた。実環境には `llava:7b` のようにタグ付きの名前でしか入っておらず、Ollamaは完全一致でしかモデルを解決しないため404になっていた。加えて、設定タブの「AI Assistant Settings (Prompt Tab)」(`localStorage` の `wfm_prompt_ai_settings`)にOllamaのURL・モデル選択UIがすでに存在していたが、Workflowタブの要約機能はこれを一切参照していなかった。
**対象ファイル:** `static/js/workflow-tab.js`, `py/routes/ollama_routes.py`, `static/js/i18n.js`
**変更内容:**
- `workflow-tab.js`: 要約ボタンが `readJsonStorage("wfm_prompt_ai_settings", {})` で設定タブ保存済みのbackend/backendUrl/modelを読み込み、`/api/wfm/ollama/chat` へ `url` / `model` を渡すように変更。backendが `ollama` 以外(LM Studio)の場合は明示的にエラートースト
- `ollama_routes.py`: `handle_chat` がリクエストbodyの `url` も受け付けるように対応(従来は `model` のみ)
- i18n: `summarizeOllamaOnly` をEN/JA/ZHに追加
### Image Edit: New button で Layer 1 自動追加
ユーザー要望「New button 画像作成時に自動でレイヤー1を追加してほしい」。既存の画像ロード時(`hasLayers` が偽の新規キャンバス経路)は既に「Layer 1」を自動生成していたが、`_newCanvas()`(Newボタン)だけは空の `LayerManager` のままだった。
**対象ファイル:** `static/js/image-edit-tab.js`
**変更内容:** `_newCanvas()` で `this._layerMgr.addLayer("draw", "Layer 1")` を追加し、アクティブレイヤー・SelectToolに設定。
### Image Edit: マスクレイヤーのオーバーレイをアクティブなマスクのみに表示
ユーザー要望「マスクレイヤーのオーバーレイ表示をマスクレイヤー以外は非表示にしたい」。従来は `layer.visible` のみを条件にオーバーレイ(半透明の色付き表示)を描画しており、非アクティブなマスクレイヤーも常に表示され続けていた。
**対象ファイル:** `static/js/image-edit-tab.js`
**変更内容:**
- `_renderMaskLayerOverlay(ctx, maskLayer)` の先頭に `if (this._layerMgr?.activeLayer !== maskLayer) return;` を追加。全ての呼び出し経路(単独マスク/マスクグループ)を1箇所でカバー
- **副次修正:** レイヤーパネルでSelectツール使用中に通常レイヤーへ切り替えた際に `_updateCompositeView()` が呼ばれていない分岐があり、上記の変更後は「マスク選択→通常レイヤー選択」でオーバーレイが画面に残ったままになる不具合が顕在化するため、当該分岐にも再描画呼び出しを追加
### GenerateUI Input: プロンプトの「戻す」ボタン + 強調weight編集(Ctrl+↑/↓)
ユーザー要望2件を同じセッションでまとめて実装。
**対象ファイル:** `static/js/comfyui-editor.js`, `static/js/i18n.js`
**変更内容:**
- **戻すボタン(↺)** — Positive/Negative各Applyボタンの左隣に追加。クリックで、選択中ノードIDに対応する**ワークフロー上の現在値**(=直前にApply/ロードされた値)をテキストエリアへ再読み込みする、Applyの逆操作。ノード選択セレクトに `min-width:0` を追加し、ボタン増加によるレイアウト圧迫に対応
- **強調weight編集(Ctrl+↑/↓)** — A1111 / ComfyUIネイティブのCLIP Text Encodeと同様の操作感。選択テキスト(無ければカーソル位置の括弧ブロック、次点で単語)を `(text:weight)` 構文に変換し、0.05刻みで増減。weightがちょうど1.0に戻ったら括弧を自動除去。汎用ヘルパー `_attachPromptWeightControl` / `_selectSurroundingParenBlock` / `_selectSurroundingWord` を新規追加し、Positive/Negative両テキストエリアにアタッチ
- **バグ修正(同セッション内)** — weightがマイナスに達した状態(例: `(watermark:-0.05)`)でさらにCtrl+↓を押すと `((watermark:-0.05):0.95)` のような二重括弧になる不具合を確認。原因は数値抽出の正規表現 `([\d.]+)` が負符号にマッチせず、マッチ全体が失敗して選択テキスト全体を新しい単語として扱っていたため。`(-?[\d.]+)` に修正。下限は設けない仕様(ComfyUIネイティブのCLIP Text Encodeも同様に無制限のため)
- i18n: `revertPromptTitle` をEN/JA/ZHに追加
**ヘルプ更新(3点セット):**
- `templates/index.html`: `wfm-help-imageedit-3`(New button説明にLayer 1自動追加を追記)、`wfm-help-imageedit-mask-3`(アクティブなマスクのみオーバーレイ表示である旨を追記)、`wfm-help-gen-4`(戻すボタン・Ctrl+↑/↓ weight編集の説明を追記)
- `static/js/i18n.js`: `helpImageEdit3` / `helpImageEditMask3` / `helpGen4` をEN/JA/ZHで更新(新規キー追加ではなく既存キーへの追記のため `app.js` の `helpIdMap` は変更不要)
**教訓(デプロイ同期、再掲):** 開発リポジトリと `custom_nodes/comfyui-workflow-studio`(StabilityMatrix配下の実行時ディレクトリ)は別実体のコピーであり自動同期しない。今回変更した全ファイル(`workflow-tab.js`, `ollama_routes.py`, `image-edit-tab.js`, `comfyui-editor.js`, `i18n.js`, `templates/index.html`)を都度両方へ適用して対応した。
## v0.3.69
### Gallery → ComfyUI Comic Creator 連携(Send CC ボタン)
ComfyUI Comic Creator(別カスタムノード、連携先名称は「Comic Creater」から改称。`/wfm` を同一オリジンのiframeで埋め込み使用)から、Workflow Studio の Gallery タブで選択した画像を直接送り込めるようにする連携機能。
**対象ファイル:** `templates/index.html`, `static/js/gallery-tab.js`, `static/js/i18n.js`
**変更内容:**
- Gallery ツールバーの「Send GenUI Image」ボタン右隣に「Send CC」ボタンを追加(`wfm-gallery-send-cc-btn`)。初期状態は非表示
- `gallery-tab.js` の `bindEvents()` で、`window.parent !== window`(iframe埋め込み判定)の場合のみボタンを表示
- クリック時: `state.selectedImage` 未選択なら案内トースト。埋め込み側であれば `window.parent.insertImageFromUrl(url)`(ComfyUI Comic Creator 側の既存グローバル関数、`main.js` が非モジュールスクリプトのため `window` 直下に生えている)を呼び出し、選択中のコマ/オーバーレイへ画像を挿入する。関数が存在しない(ComfyUI Comic Creator以外からの埋め込み等)場合は案内トーストを表示
- `window.parent` へのアクセスはtry/catchで保護(クロスオリジン埋め込み時の例外対策)
- i18n: `galleryCCNotAvailable` / `gallerySentCC` を EN/JA/ZH に追加
**ComfyUI Comic Creator 側は無改修。** 既存の `insertImageFromUrl(url)`(コマ・オーバーレイ判定込みの画像挿入共通ヘルパー)をそのまま呼び出す設計。
**ハマりどころ(デプロイ同期忘れ):** 本リポジトリは開発用ディレクトリと実行時の `custom_nodes/comfyui-workflow-studio`(StabilityMatrix配下)が別実体のコピーであり、symlinkではない。上記3ファイルを開発リポジトリのみ編集した状態でComfyUIを起動していたため、「Send CCボタンが表示されない」という報告を受けた。実行時ディレクトリへ3ファイルを手動コピーして解決(差分は今回の追加分のみで他の乖離なし)。今後この種の変更をした際は、都度 `custom_nodes/` 側への同期を忘れないこと(本体のコミット前チェックリスト「全ファイルを custom_nodes/ に同期」を参照)。
### I2I連携(Comic Creater送信画像の受信・デフォルトワークフロー自動読込)
ComfyUI Comic Creater の「I2Iへ送る」ボタンから、iframe越しに画像をGenerate UIのImage入力スロットへ直接セットする受信用グローバル関数`window._wfmReceiveImageForI2I(blob, name, workflowData?, workflowFilename?)`を新規追加。上記のSend CCと対になる、逆方向(Comic Creater→Workflow Studio)の連携。既存の「Send GenUI Image」(Galleryの選択画像を送る版)とロジックを共有。
**対象ファイル:** `static/js/gallery-tab.js`
**変更内容:**
- `window._wfmReceiveImageForI2I`をモジュールトップレベルに追加。`comfyEditor.applyImageToSlot(file, 0)`を呼び、Generate UI → Input → Imageタブへ自動切替した上で画像をLoadImageスロットにセットする
- `workflowData`(ワークフローJSON)が渡された場合、画像をセットする前に`loadWorkflowIntoEditor(workflowData, workflowFilename)`(generate-tab.js既存export)でワークフローを差し替える。Comic Creater側の設定タブで「デフォルトI2Iワークフロー」が有効な場合のみ渡される(`user/default/workflows/`配下のファイルをComic Creater側が`GET /api/wfm/workflows/raw?filename=X`で取得して渡す設計、本リポジトリのAPI自体は無改修)
- 既存の「Send CC」ボタンのクリックハンドラを拡張し、`window.parent._ccI2ITargetMode`(Comic Creater側が送信元をレイアウトタブ/Imageタブのどちらか記録するフラグ)を参照して、`window.parent.insertImageFromUrl(url)`(レイアウトタブ挿入、従来通り)と`window.parent._ccImageTab.loadFromUrl(url, name)`(Imageタブ読込、新規)を分岐
**ハマりどころ1(プレビューのURLキャッシュ):** Comic Creater側が同一ファイル名で連続送信すると、`applyImageToSlot`が`previewImg.src`に設定するURL文字列(`/view?filename=...`)が変わらないため、サーバー側は正しく上書きされているのにブラウザがキャッシュ画像を表示し続けた(「編集内容が反映されていないように見えるが、実際に生成すると反映されている」という診断が難しい症状として報告された)。対策はComic Creater側でファイル名をタイムスタンプ付きでユニーク化する方式とし、本リポジトリ側は無改修で解決。
**ハマりどころ2(モデルリスト未取得):** iframe埋め込み直後など`comfyEditor.models`(Checkpoint等一覧、`init()`時に1回だけ非同期取得)が空のタイミングで`loadWorkflowIntoEditor`を呼ぶと、Model/生成UIタブのCheckpoint等ドロップダウンが空のままレンダリングされ、選択もできなくなる不具合が発生した(Comic Creater再起動でも再現するとの報告)。`_wfmReceiveImageForI2I`内でワークフローロード前に`comfyUI.checkConnection()`→(`comfyEditor.models.checkpoints`が空なら)`comfyEditor.loadModelLists()`を保証するよう修正して解決。
**ComfyUI Comic Creator 側の実装:** レイアウトタブ・Imageタブの「I2Iへ送る」ボタン、送信共通関数`sendImageToWorkflowStudioI2I`、設定タブの「I2I設定」ブロック(デフォルトワークフローのON/OFF・ファイル名指定)はすべてComic Creater側に実装(本リポジトリからは見えない)。
**教訓(デプロイ同期忘れ、再掲):** 前回のSend CC実装時と同じ理由で、開発リポジトリと`custom_nodes/comfyui-workflow-studio`(StabilityMatrix配下の実行時ディレクトリ)は別実体のコピーであり自動同期しない。今回は`gallery-tab.js`の変更を都度両方へ適用して対応した。
### Loraバッチ生成のバリデーションエラー修正 + プロンプト自動反映
ユーザー報告「生成UIタブのBatchタブでLoraのバッチ機能を使用してIllustriousグループ(128モデル)でバッチ生成を開始したがエラー(`Prompt outputs failed validation`)となった」の調査から一連の修正を実施。
**原因: パス区切り文字の不一致**
ComfyUI(Windows)はLoraのサブフォルダ区切りに`\`を使ってenumリストを返すが、Workflow Studio内部では`/`区切りで管理していたため、実ファイルが存在するにもかかわらずLoraLoaderの`lora_name`バリデーションに失敗していた(当初「サーバー起動後のキャッシュ未反映」と誤診断したが、実際は表記の不一致が原因だった)。
**対象ファイル:** `static/js/comfyui-editor.js`, `static/js/models-tab.js`, `static/js/generate-tab.js`
**変更内容:**
- `comfyui-editor.js`の`comfyEditor`に共通ヘルパー`resolveLoraName(name)`を追加 — 内部の`/`区切り表記を、`comfyEditor.models.loras`(ComfyUIから取得済みの実表記)と突き合わせて実際の表記に変換
- Lora Single適用(`_applyLoraToNode`)、Stack Apply、`models-tab.js`のGenUI Modelボタンの3箇所を`resolveLoraName`経由に統一
- Loraバッチ実行(`generate-tab.js`)は`comfyUI.fetchLoras()`を都度呼び出して同様の変換マップを構築(バッチ実行前チェックと共用)
**Loraバッチ実行前チェック:**
- 通常のLoraLoaderノードを使うワークフローの場合、バッチ開始前に選択済みLoraをComfyUI側の最新一覧と突き合わせ、認識されていないものがあれば`batchLoraMissing`警告トーストを表示(ComfyUIのRefresh/再起動を促す)
- Lora Managerノード使用時はenum制約がないため対象外
**Loraバッチ実行時のプロンプト自動反映:**
- 各Loraアイテム適用時、Positiveプロンプト(テキストエリア+ワークフロー内の各positiveノード)にLora構文`<lora:name:strength_model:strength_clip>`とCivitAIトリガーワードを自動追加。常にバッチ開始前の元プロンプトを起点に再構築するため、Lora構文が蓄積されることはない
- バッチ完了・停止(Stopボタン)・エラーいずれの場合も`finally`でプロンプトを開始前の状態に自動復元
**モデル詳細モーダルに「閉じる」ボタン追加:**
- `models-tab.js`のモデル詳細モーダル(Checkpoint/Lora/Embedding/Hypernetworkなど全サブタブ共通)で、「保存」「GenUI PP/NP」「削除」ボタンの並び右端に「閉じる」ボタンを追加。連続作業時にモーダル右上のXボタンまでマウス移動する手間を削減。既存の`close` i18nキーを再利用
**ヘルプ更新(3点セット):**
- `templates/index.html`: `wfm-help-gen-19`を新規追加
- `static/js/i18n.js`: `helpGen19`をEN/JA/ZHで新規追加(Loraバッチのプロンプト自動反映・復元・事前チェックの説明)
- `static/js/app.js`の`helpIdMap`に`"wfm-help-gen-19": "helpGen19"`を登録
**その他:** 連携先カスタムノードの名称変更(Comic Creater → ComfyUI Comic Creator)をUI文言・コメント(`i18n.js`, `templates/index.html`, `gallery-tab.js`)に反映。
## v0.3.68
### MASK EDITOR ONE セクション常時表示化
ユーザー報告: 「Image EditタブでABRブラシが表示できない」の原因調査から発生。実際にはSAM3・BiRefNetは正常動作しており(`/mask_editor/sam3/status`・`/mask_editor/birefnet/status`とも`loaded: true`)、原因は Mask Editor One の `brushes/` フォルダが空(`.abr`未インポート)で、`_abrAvailable = tree.length > 0` の判定によりセクション自体が非表示になっていたこと。
調査の結果を受け、「MASK EDITOR ONEセクションは常時表示し、色で利用可否を示す」という方針に変更。
**対象ファイル:** `static/js/image-edit-tab.js`
**変更内容:**
- Mask Paint モード(`_renderMaskProps`)・Draw ツール(`_renderDrawProps`)双方で、`MASK EDITOR ONE` / `MASK EDITOR ONE (COLOR)` セクションを囲んでいた `${this._abrAvailable ? ... : ""}` の外側条件分岐を削除し、常時レンダリングするように変更
- セクション見出しの文字色を `this._abrAvailable` に応じて動的に切り替え: 利用可能時 `var(--wfm-success)`(緑)、未インポート時 `var(--wfm-text-secondary)`(既存のデフォルト色)
- 見出しに `title` 属性でツールチップ("Mask Editor One: brushes available" / "no brushes imported yet")を追加
- Select ボタンは `this._abrAvailable` が false の間 `disabled` 属性を付与(ブラシが1つもない状態でクリックしても意味がないため)
- ブラシ画像が選択済み(`t.brushImage`)の場合の Spacing / Angle / Sz Jitter / Rot. Jitter 詳細行の表示条件は変更なし(`t.brushImage` の有無のみで判定、`_abrAvailable` とは独立)
**ヘルプ更新(3点セット):**
- `templates/index.html`: `wfm-help-imageedit-5`(Draw)・`wfm-help-imageedit-mask-4`(Mask Paint)の文言を更新
- `static/js/i18n.js`: `helpImageEdit5` / `helpImageEditMask4` を EN/JA/ZH 3言語で更新
- `static/js/app.js` の `helpIdMap` は既存キーのままで対応不要(新規キー追加なし)
**Why:** `_abrAvailable` はブラシ登録数のみで決まり、Mask Editor One のインストール有無とは無関係だった。旧仕様(ブラシ0件でセクション非表示)だと、ユーザーは機能の存在自体に気づけず「ABRブラシが使えない」と誤認する。常時表示+色分けにすることで、機能の存在と現在の利用可否を両方伝える。
## v0.3.67
### Alt+Click Apply & Generate
+40 -4
View File
@@ -21,7 +21,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.67-green)
![Version](https://img.shields.io/badge/version-0.3.71-green)
## Screenshots
@@ -83,6 +83,9 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **5-tab layout** — Input / Model / Settings / Feeder / Batch tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
- **Save button** — located at the right end of the subtab row; opens a filename dialog (default: current workflow name) and saves the current workflow as a `.json` file to the Workflow tab via the import API
- **Input tab** — Prompt and Image inner tabs (drag-and-drop upload); Prompt tab shows Positive Prompt and Negative Prompt textareas, plus an **Embeddings selector** at the bottom (Filter + Select + Weight input + Paste button); Paste inserts `(embedding:Name:weight)` at the cursor position of the last focused textarea (defaults to Positive when neither is focused); Raw JSON (540px) in the right column
- **Revert button** (v0.3.70) — a ↺ button next to each Apply button reverts the textarea to the node's currently applied value (the reverse of Apply)
- **Emphasis weight editing** (v0.3.70) — select text (or just place the cursor on a word/parenthesis block) and press Ctrl+↑/↓ to adjust `(text:weight)` by ±0.05, A1111/native-ComfyUI style; parentheses are removed automatically when the weight returns to 1.0
- **Mask slot for inpainting** (v0.3.71) — LoadImage slots whose MASK output feeds an inpaint node (e.g. `VAEEncodeForInpaint`) show an additional Mask drop zone; when a mask is set, image + mask are composited into a single RGBA upload (mask baked into the alpha channel) matching ComfyUI's native alpha→MASK extraction — no extra nodes required
- **Model tab** — Checkpoint, VAE, LoRA, ControlNet, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — single clip: type + device; dual clip: two clip selectors + type + device), **Hypernetwork** (with Strength field) selectors with filter; Raw JSON on the right
- **Settings tab** — KSampler and Latent Image side by side at 50% width each; Raw JSON on the right
- **Always-visible Raw JSON** — edit the API-format JSON directly from any tab with syntax highlighting; Apply button reloads the workflow; built-in **search bar** (always shown) finds all matches as you type with count display (`3/12`); navigate with ↑/↓ buttons or Enter / Shift+Enter; Escape or ✕ clears; current match highlighted in orange, other matches in yellow
@@ -94,6 +97,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **Left pane** — 4 tabs: **Checkpoints** (file-tree; Filter / All / None), **Sampler** (KSampler sampler list), **Scheduler** (KSampler scheduler list), **Style** (flat list of all styles from `Workflow-Studio/style/`; All / None buttons)
- **Center pane** — group-based selection with inner tabs (Checkpoint | Lora | Prompt | Workflow); Checkpoint/Lora groups come from the Models tab, Prompt groups from the Prompt tab, Workflow groups from the Workflow tab — check a group to add all its members, expand ▶ to select individually
- **Right pane (Batch Queue)** — 7 columns: Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler / **Style**; each column header has an enable checkbox (radio behavior: only one at a time); count shown per column; Style batch applies each selected style sequentially to a workflow copy
- **Lora batch prompt sync** (v0.3.69) — for each selected LoRA, its syntax (`<lora:name:strength_model:strength_clip>`) and CivitAI trained words are automatically appended to the Positive prompt (rebuilt from the original prompt each time, not accumulated), then restored to the pre-batch state when the batch completes or is stopped; if a selected LoRA is not yet recognized by ComfyUI's model list, a warning toast suggests a Refresh or restart
- **UI-to-API conversion** — automatic conversion supporting subgraphs (nested workflows), COMBO types, and display-only node exclusion; improved analysis covers SDXL multi-hop CONDITIONING chains, CLIPTextEncodeSDXL, SDXLPromptStyler, KSamplerAdvanced, and more
- **Eagle integration** — auto-save generated images to [Eagle](https://eagle.cool/) with metadata
@@ -186,6 +190,7 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **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
- **Send CC button** (v0.3.69) — toolbar button, shown only when this Gallery tab is embedded as an iframe inside ComfyUI Comic Creator (a separate custom node); sends the selected image directly into Comic Creator's currently selected panel/overlay
- **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
@@ -245,16 +250,17 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
- **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 (⬚), Filter (★); tool options bar updates per active tool
- **New button** — create a blank canvas with custom dimensions (WxH prompt); clears all existing layers and automatically adds an empty Layer 1 (v0.3.70)
- **Tools** — Select (V), Draw (B), Text (T), Shape (S), Mask (🎭), Blur (≈), BG Remove (⬚), Filter (★), Inpaint (🩹); 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; 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** — 7 sub-tools for painting masks 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**: sub-tool buttons (Paint / Color / Alpha / Text / Vector / Shape / SAM3), Invert checkbox, Overlay color picker (default red), Blur slider (0–50 px); SAM3 requires Mask Editor One (disabled when not installed); Color / Alpha / Text / Vector / Shape work without Mask Editor One; **Properties pane — Paint**: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); **MASK EDITOR ONE section** (Paint sub-tool, visible when installed): Select opens the ABR stamp-brush library; ✕ clears back to Circle; when an image brush is active, Hardness is disabled and Spacing (5–100%), Angle (0–359°), Sz Jitter (0–100%), Rot. Jitter (on/off) appear; **Properties pane — Color**: click canvas to flood-select pixels by color similarity; Mode (Add / Subtract), Tolerance (0–255), Feather % (0–100); **Properties pane — Alpha**: extract the active layer's transparency as a mask; Threshold, Invert checkbox, Extract Alpha button; **Properties pane — Text**: click canvas to open a stamp overlay — enter text, set Font / Size / Bold / Italic / Align / Mode (Add / Erase), Stamp or Ctrl+Enter to apply; multi-line supported; **Properties pane — Vector**: click to add Catmull-Rom spline points; Enter (or click first point) closes and fills the polygon; Backspace removes the last point; Esc resets; Mode (Add / Erase); **Properties pane — Shape**: drag to draw Rect or Ellipse; hold Shift for square/circle; blue dashed outline preview while dragging; Mode (Add / Erase); **Properties pane — SAM3**: enter a text prompt, set Max candidates (3/6/9/12), click Segment; select candidate thumbnails (multi-select), Apply Selected (N) applies with current Mode; **Mask layer A/S operation**: A/S toggle — Add (green) composites normally, Subtract (red) cuts the mask from below; **✂ clipping mask button** clips the layer 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
- **Mask** — 7 sub-tools for painting masks 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**: sub-tool buttons (Paint / Color / Alpha / Text / Vector / Shape / SAM3), Invert checkbox, Overlay color picker (default red), Blur slider (0–50 px); the overlay is only shown for the currently active mask layer, other mask layers stay hidden until selected (v0.3.70); SAM3 requires Mask Editor One (disabled when not installed); Color / Alpha / Text / Vector / Shape work without Mask Editor One; **Properties pane — Paint**: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); **MASK EDITOR ONE section** (Paint sub-tool, visible when installed): Select opens the ABR stamp-brush library; ✕ clears back to Circle; when an image brush is active, Hardness is disabled and Spacing (5–100%), Angle (0–359°), Sz Jitter (0–100%), Rot. Jitter (on/off) appear; **Properties pane — Color**: click canvas to flood-select pixels by color similarity; Mode (Add / Subtract), Tolerance (0–255), Feather % (0–100); **Properties pane — Alpha**: extract the active layer's transparency as a mask; Threshold, Invert checkbox, Extract Alpha button; **Properties pane — Text**: click canvas to open a stamp overlay — enter text, set Font / Size / Bold / Italic / Align / Mode (Add / Erase), Stamp or Ctrl+Enter to apply; multi-line supported; **Properties pane — Vector**: click to add Catmull-Rom spline points; Enter (or click first point) closes and fills the polygon; Backspace removes the last point; Esc resets; Mode (Add / Erase); **Properties pane — Shape**: drag to draw Rect or Ellipse; hold Shift for square/circle; blue dashed outline preview while dragging; Mode (Add / Erase); **Properties pane — SAM3**: enter a text prompt, set Max candidates (3/6/9/12), click Segment; select candidate thumbnails (multi-select), Apply Selected (N) applies with current Mode; **Mask layer A/S operation**: A/S toggle — Add (green) composites normally, Subtract (red) cuts the mask from below; **✂ clipping mask button** clips the layer 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 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
- **Inpaint** (v0.3.71) — composites the visible layers plus a Mask layer into one RGBA image (mask baked into the alpha channel) and applies it to the first inpaint-capable LoadImage node in the workflow currently loaded in GenerateUI (a node whose MASK output feeds something like `VAEEncodeForInpaint`); also supports workflows built around the **Mask Editor One** custom node (`comfyui-mask-editor-one`) instead of LoadImage — image/mask are pushed via its node_id-keyed server cache and `layer_data` widget; **Properties pane**: Positive/Negative prompts, Grow Mask By (applied to the VAE Encode (for Inpainting) node), Denoise (applied to KSampler), Run button; **Use dedicated workflow** checkbox — when off, generates against the workflow currently loaded in GenerateUI; when on, pick a saved workflow from the dropdown to load, edit, and generate entirely in the background without disturbing what's shown in GenerateUI; the result image is shown back in the Properties pane when generation completes; requires a Mask layer painted first (Mask tool)
- **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
@@ -392,6 +398,36 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
## Changelog
### v0.3.71
- **Image Edit — Inpaint tool (🩹)** — new tool composites the canvas (all non-mask layers) plus the active mask layer, uploads to an inpaint-capable LoadImage node (or a Mask Editor One node) in the GenerateUI workflow, applies Positive/Negative prompts, Grow Mask By, and Denoise, then triggers generation — all without leaving the Image Edit tab; the result is shown in the Properties pane
- **Image Edit — Inpaint: dedicated workflow** — "Use dedicated workflow" checkbox lets you pick a saved workflow to run the inpaint against instead of the one currently loaded in GenerateUI, without disturbing what's shown there
- **Image Edit — Inpaint: Mask Editor One support** — workflows built around the `comfyui-mask-editor-one` custom node (no LoadImage) are also supported; image/mask are pushed via its node_id-keyed server cache and `layer_data` widget
- **GenerateUI — Input/Image tab mask slots** — LoadImage nodes whose MASK output feeds an inpaint node (e.g. `VAEEncodeForInpaint`) now show an additional Mask drop zone; image + mask are composited into a single RGBA upload matching ComfyUI's native alpha→MASK extraction
- New example workflows: `ws_inpaint_basic.json`, `ws_inpaint_mask_editor_one.json`
### v0.3.70
- **Workflow AI summary — Ollama 404 fix** — the summarize button in the workflow detail modal now uses the Ollama URL/model saved in Settings → AI Assistant Settings (previously it silently fell back to a hardcoded default model tag that didn't match locally installed models, causing a 404)
- **Image Edit — New button auto-adds Layer 1** — creating a blank canvas via the New button now automatically adds an empty "Layer 1", matching the existing image-load behavior
- **Image Edit — mask overlay shown only for the active mask layer** — previously every visible mask layer's overlay was rendered regardless of selection; now only the currently active mask layer shows its overlay, other mask layers stay hidden until selected
- **GenerateUI — Revert button for Positive/Negative Prompt** — a ↺ button next to each Apply button reverts the textarea to the node's currently applied value
- **GenerateUI — Ctrl+↑/↓ prompt emphasis weight editing** — A1111 / native ComfyUI CLIP Text Encode style: select text (or just place the cursor on a word/parenthesis block) and press Ctrl+↑/↓ to adjust `(text:weight)` by ±0.05; parentheses are removed automatically when the weight returns to 1.0
### v0.3.69
- **Gallery — Send CC button** — new toolbar button, shown only when the Gallery tab is embedded as an iframe inside ComfyUI Comic Creator (a separate custom node); sends the selected image directly into Comic Creator's currently selected panel/overlay via its existing `insertImageFromUrl(url)` helper (no changes required on the Comic Creator side)
- **Lora batch — validation fix** — fixed a `Prompt outputs failed validation` error where LoRA files that actually existed were rejected by the standard `LoraLoader` node; the root cause was a path-separator mismatch (ComfyUI on Windows returns `\`-separated enum values while WFS tracked LoRAs internally with `/`); a shared `resolveLoraName()` helper now converts to ComfyUI's actual notation before applying, used consistently by Lora Single apply, Stack apply, the Models tab GenUI Model button, and Lora batch generation
- **Lora batch — pre-flight check** — before running a batch on a standard `LoraLoader` workflow, selected LoRAs are checked against ComfyUI's current model list; if any are not yet recognized, a warning toast suggests a Refresh or ComfyUI restart (skipped for Lora Manager–based workflows, which have no enum constraint)
- **Lora batch — automatic prompt sync** — for each LoRA applied during a batch, its syntax (`<lora:name:strength_model:strength_clip>`) and CivitAI trained words are automatically appended to the Positive prompt, rebuilt from the original prompt each time (not accumulated); the prompt is automatically restored to its pre-batch state when the batch completes, is stopped, or errors
- **Models tab — Close button in detail modal** — added a Close button at the right end of the Save / GenUI PP·NP / Delete button row in the model detail modal (all sub-tabs), reducing mouse travel to the top-right ✕ during repeated batch edits
- **Help** — new help entry (`helpGen19`) added in EN / JA / ZH describing the Lora batch prompt sync, restore, and pre-flight check behavior
### v0.3.68
- **Image Edit — MASK EDITOR ONE section always visible** — the ABR brush section in the Draw tool's (`MASK EDITOR ONE (COLOR)`) and Mask Paint mode's (`MASK EDITOR ONE`) Properties pane is now always shown instead of being hidden when no brushes are imported; the header text turns green when at least one ABR brush is available and gray when none are imported yet; the Select button is disabled until a brush exists
- **Help — MASK EDITOR ONE status** — updated `helpImageEdit5` (Draw tool) and `helpImageEditMask4` (Mask Paint mode) in EN / JA / ZH to describe the always-visible section and its color-coded availability state
### v0.3.67
- **GenerateUI — Alt+Click Apply & Generate** — Alt+Click any Apply button to apply the parameter and immediately queue a generation in one step; applies to Positive Prompt Apply (Input tab), all model Apply buttons (Model tab: Checkpoint / VAE / Diffusion Model / ControlNet / Hypernetwork), and KSampler Apply (Settings tab); only triggers generation when the target node exists in the loaded workflow (no action on missing nodes); each Apply button shows a tooltip `Apply (Alt+Click: Apply & Generate)` on hover
+3 -2
View File
@@ -82,7 +82,8 @@ async def handle_chat(request: web.Request) -> web.Response:
try:
body = await request.json()
cfg = _get_ollama_config()
model = body.get("model", cfg["model"])
model = body.get("model") or cfg["model"]
base_url = (body.get("url") or cfg["url"]).rstrip("/")
messages = body.get("messages", [])
def _chat():
@@ -92,7 +93,7 @@ async def handle_chat(request: web.Request) -> web.Response:
"stream": False,
}).encode("utf-8")
url = f"{cfg['url']}/api/chat"
url = f"{base_url}/api/chat"
req = urllib.request.Request(
url,
data=payload,
+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.67"
version = "0.3.71"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+35
View File
@@ -2938,6 +2938,41 @@ body {
line-height: 24px;
}
.wfm-i2i-mask-section {
margin-top: 8px;
padding-top: 8px;
border-top: 1px dashed var(--wfm-border);
}
.wfm-i2i-mask-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
font-size: 11px;
font-weight: 600;
color: var(--wfm-text-secondary);
margin-bottom: 6px;
}
.wfm-i2i-mask-filename {
font-size: 10px;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 120px;
}
.wfm-i2i-mask-preview-wrap .wfm-i2i-preview-img {
max-height: 70px;
background: #000;
}
.wfm-i2i-mask-drop-zone {
padding: 8px;
}
/* ============================================
Side Panel - Thumbnail Tab
============================================ */
+2 -1
View File
@@ -356,6 +356,7 @@ function applyI18nToHtml() {
"wfm-help-gen-13": "helpGen13", "wfm-help-gen-14": "helpGen14",
"wfm-help-gen-15": "helpGen15", "wfm-help-gen-16": "helpGen16",
"wfm-help-gen-17": "helpGen17", "wfm-help-gen-18": "helpGen18",
"wfm-help-gen-19": "helpGen19",
"wfm-help-feeder-title": "helpFeederTitle",
"wfm-help-feeder-desc": "helpFeederDesc",
"wfm-help-feeder-imgloop-title": "helpFeederImgloopTitle",
@@ -444,7 +445,7 @@ function applyI18nToHtml() {
"wfm-help-imageedit-28": "helpImageEdit28", "wfm-help-imageedit-29": "helpImageEdit29",
"wfm-help-imageedit-30": "helpImageEdit30",
"wfm-help-imageedit-7b": "helpImageEdit7b", "wfm-help-imageedit-7c": "helpImageEdit7c",
"wfm-help-imageedit-7d": "helpImageEdit7d",
"wfm-help-imageedit-7d": "helpImageEdit7d", "wfm-help-imageedit-7e": "helpImageEdit7e",
"wfm-help-imageedit-8b": "helpImageEdit8b",
"wfm-help-imageedit-blur-title": "helpImageEditBlurTitle",
"wfm-help-imageedit-blur-1": "helpImageEditBlur1", "wfm-help-imageedit-blur-2": "helpImageEditBlur2",
+456 -8
View File
@@ -4,6 +4,7 @@
import { comfyUI } from "./comfyui-client.js";
import { syncJsonHighlight } from "./json-highlight.js";
import { t } from "./i18n.js";
// ── Latent Image preset state ─────────────────────────────
const _LATENT_PRESET_KEY = "wfm_latent_presets";
@@ -85,7 +86,7 @@ function _applyLoraToNode(nodeId, loraPath, strModel, strClip, isLoraManager) {
};
comfyUI.currentWorkflow[nodeId].inputs.text = `<lora:${stem}:${strModel}:${strClip}>`;
} else {
comfyUI.currentWorkflow[nodeId].inputs.lora_name = loraPath;
comfyUI.currentWorkflow[nodeId].inputs.lora_name = comfyEditor.resolveLoraName(loraPath);
comfyUI.currentWorkflow[nodeId].inputs.strength_model = strModel;
comfyUI.currentWorkflow[nodeId].inputs.strength_clip = strClip;
}
@@ -153,6 +154,139 @@ function _syncRawJson() {
}
}
// ── Inpaint: 画像+マスクのRGBA合成 ──────────────────────
// mask は白=インペイント対象領域/黒=維持領域のグレースケール画像を想定(Image Editの
// マスクレイヤーも、手動でドロップする白黒マスクファイルも同じ規約)。
// ComfyUIネイティブのLoadImageはアルファチャンネルから mask = 1 - alpha を抽出するため、
// 合成後の alpha は 255 - maskGray とする。
async function _loadImageElement(src) {
const isBlobLike = src instanceof Blob;
const url = isBlobLike ? URL.createObjectURL(src) : src;
try {
const img = new Image();
img.src = url;
await new Promise((resolve, reject) => {
img.onload = resolve;
img.onerror = () => reject(new Error("Failed to load image"));
});
return img;
} finally {
if (isBlobLike) URL.revokeObjectURL(url);
}
}
async function _compositeImageWithMask(imageInput, maskInput) {
const img = await _loadImageElement(imageInput);
const mask = await _loadImageElement(maskInput);
const w = img.naturalWidth, h = img.naturalHeight;
const canvas = document.createElement("canvas");
canvas.width = w; canvas.height = h;
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, w, h);
const imgData = ctx.getImageData(0, 0, w, h);
const maskCanvas = document.createElement("canvas");
maskCanvas.width = w; maskCanvas.height = h;
const mctx = maskCanvas.getContext("2d");
mctx.drawImage(mask, 0, 0, w, h);
const maskData = mctx.getImageData(0, 0, w, h).data;
const data = imgData.data;
for (let i = 0; i < data.length; i += 4) {
data[i + 3] = 255 - maskData[i];
}
ctx.putImageData(imgData, 0, 0);
return new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
}
// ── Inpaint: Mask Editor One (comfyui-mask-editor-one) ノード向けヘルパー ──────
// この custom node は LoadImage を介さず、画像は /mask_editor/store_image でサーバー側
// キャッシュ(bg_image_b64, node_idキー)へ、マスクは layer_data(JSON文字列)ウィジェットの
// 各レイヤーの「アルファチャンネル」から合成される(LoadImageの 1-alpha とは逆で、
// alpha値がそのままmask値になる規約)。
async function _imageInputToDataURL(imageInput) {
const img = await _loadImageElement(imageInput);
const canvas = document.createElement("canvas");
canvas.width = img.naturalWidth;
canvas.height = img.naturalHeight;
canvas.getContext("2d").drawImage(img, 0, 0);
return canvas.toDataURL("image/png");
}
async function _maskInputToAlphaDataURL(maskInput) {
const img = await _loadImageElement(maskInput);
const w = img.naturalWidth, h = img.naturalHeight;
const canvas = document.createElement("canvas");
canvas.width = w; canvas.height = h;
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, w, h);
const imgData = ctx.getImageData(0, 0, w, h);
const data = imgData.data;
for (let i = 0; i < data.length; i += 4) {
const gray = data[i];
data[i] = data[i + 1] = data[i + 2] = 255;
data[i + 3] = gray;
}
ctx.putImageData(imgData, 0, 0);
return canvas.toDataURL("image/png");
}
// ── プロンプト強調weight編集 (Ctrl+↑/↓) ──────────────────────
// A1111 / ComfyUIネイティブのCLIP Text Encodeと同様の操作感:
// 選択(無ければカーソル位置の括弧ブロックまたは単語)を (text:weight) 形式に変換し、
// weightを0.05刻みで増減する。weightが1.0に戻ったら括弧を除去する。
const _PROMPT_WEIGHT_DELIMITERS = new Set([",", "\n", "\r", "\t", " ", "(", ")", ":"]);
function _selectSurroundingParenBlock(text, pos) {
const openIdx = text.lastIndexOf("(", pos - 1);
if (openIdx === -1) return null;
const closeBefore = text.lastIndexOf(")", pos - 1);
if (closeBefore > openIdx) return null; // カーソルは既に閉じたブロックの外
const closeIdx = text.indexOf(")", pos);
if (closeIdx === -1) return null;
return { start: openIdx, end: closeIdx + 1 };
}
function _selectSurroundingWord(text, pos) {
let start = pos, end = pos;
while (start > 0 && !_PROMPT_WEIGHT_DELIMITERS.has(text[start - 1])) start--;
while (end < text.length && !_PROMPT_WEIGHT_DELIMITERS.has(text[end])) end++;
return { start, end };
}
function _attachPromptWeightControl(textarea) {
textarea.addEventListener("keydown", (e) => {
if (!e.ctrlKey || (e.key !== "ArrowUp" && e.key !== "ArrowDown")) return;
e.preventDefault();
const delta = e.key === "ArrowUp" ? 0.05 : -0.05;
const text = textarea.value;
let start = textarea.selectionStart;
let end = textarea.selectionEnd;
if (start === end) {
const range = _selectSurroundingParenBlock(text, start) || _selectSurroundingWord(text, start);
start = range.start;
end = range.end;
}
if (start === end) return;
const selected = text.substring(start, end);
const m = selected.match(/^\((.*):(-?[\d.]+)\)$/s);
const inner = m ? m[1] : selected;
let weight = (m ? parseFloat(m[2]) : 1.0) + delta;
weight = Math.round(weight * 100) / 100;
const replacement = weight === 1.0 ? inner : `(${inner}:${weight.toFixed(2)})`;
textarea.value = text.substring(0, start) + replacement + text.substring(end);
textarea.setSelectionRange(start, start + replacement.length);
});
}
export const comfyEditor = {
models: {
checkpoints: [],
@@ -199,6 +333,13 @@ export const comfyEditor = {
}
},
// ComfyUI(Windows)は"\"区切りでLoraのenumを返すため、内部の"/"区切り表記と突き合わせて実際の表記に変換する
resolveLoraName(name) {
const normalized = name.replace(/\\/g, "/");
const found = this.models.loras.find((n) => n.replace(/\\/g, "/") === normalized);
return found || name;
},
renderAll(analysis, workflow) {
this.renderPromptTab(analysis, "wfm-gen-prompt-fields");
this.renderImageTab(analysis, "wfm-gen-image-fields");
@@ -221,10 +362,11 @@ export const comfyEditor = {
<div class="wfm-form-group">
<label>Positive Prompt</label>
<div style="display:flex;gap:8px;margin-bottom:6px;">
<select id="wfm-prompt-pos-target" class="wfm-select" style="width:auto;flex:1">
<select id="wfm-prompt-pos-target" class="wfm-select" style="width:auto;flex:1;min-width:0;">
${positiveNodes.map((n) => `<option value="${n.id}" data-text-key="${n.textKey || "text"}" selected>ID:${n.id} (${n.title})</option>`).join("")}
${nodeOpts}
</select>
<button class="wfm-btn wfm-btn-sm" id="wfm-prompt-pos-revert" title="${t("revertPromptTitle")}">↺</button>
<button class="wfm-btn wfm-btn-sm" id="wfm-prompt-pos-apply" title="Apply (Alt+Click: Apply &amp; Generate)">Apply</button>
</div>
<textarea class="wfm-textarea" id="wfm-prompt-pos-text" rows="6">${positiveNodes[0]?.text || ""}</textarea>
@@ -232,10 +374,11 @@ export const comfyEditor = {
<div class="wfm-form-group">
<label>Negative Prompt</label>
<div style="display:flex;gap:8px;margin-bottom:6px;">
<select id="wfm-prompt-neg-target" class="wfm-select" style="width:auto;flex:1">
<select id="wfm-prompt-neg-target" class="wfm-select" style="width:auto;flex:1;min-width:0;">
${negativeNodes.map((n) => `<option value="${n.id}" data-text-key="${n.textKey || "text"}" selected>ID:${n.id} (${n.title})</option>`).join("")}
${nodeOpts}
</select>
<button class="wfm-btn wfm-btn-sm" id="wfm-prompt-neg-revert" title="${t("revertPromptTitle")}">↺</button>
<button class="wfm-btn wfm-btn-sm" id="wfm-prompt-neg-apply">Apply</button>
</div>
<textarea class="wfm-textarea" id="wfm-prompt-neg-text" rows="6">${negativeNodes[0]?.text || ""}</textarea>
@@ -277,6 +420,27 @@ export const comfyEditor = {
}
});
// Revert: テキストエリアを直前にApplyされたノードの現在値へ戻す
document.getElementById("wfm-prompt-pos-revert")?.addEventListener("click", () => {
const nodeId = document.getElementById("wfm-prompt-pos-target")?.value;
const wfNode = comfyUI.currentWorkflow?.[nodeId];
const ta = document.getElementById("wfm-prompt-pos-text");
if (!nodeId || !wfNode || !ta) return;
const promptNode = (analysis.prompt_nodes || []).find(n => n.id === nodeId);
const textKey = promptNode?.textKey || "text";
ta.value = wfNode.inputs[textKey] ?? "";
});
document.getElementById("wfm-prompt-neg-revert")?.addEventListener("click", () => {
const nodeId = document.getElementById("wfm-prompt-neg-target")?.value;
const wfNode = comfyUI.currentWorkflow?.[nodeId];
const ta = document.getElementById("wfm-prompt-neg-text");
if (!nodeId || !wfNode || !ta) return;
const promptNode = (analysis.prompt_nodes || []).find(n => n.id === nodeId);
const textKey = promptNode?.textKey || "text";
ta.value = wfNode.inputs[textKey] ?? "";
});
// Track last focused prompt textarea for Paste button
["wfm-prompt-pos-text", "wfm-prompt-neg-text"].forEach((taId) => {
const ta = document.getElementById(taId);
@@ -286,6 +450,7 @@ export const comfyEditor = {
_lastPromptFocus = { id: taId, selStart: ta.selectionStart, selEnd: ta.selectionEnd };
});
});
_attachPromptWeightControl(ta);
});
// Embedding filter
@@ -785,7 +950,7 @@ export const comfyEditor = {
} else {
const first = stackModels[0];
if (first) {
comfyUI.currentWorkflow[nodeId].inputs.lora_name = first;
comfyUI.currentWorkflow[nodeId].inputs.lora_name = comfyEditor.resolveLoraName(first);
comfyUI.currentWorkflow[nodeId].inputs.strength_model = _stackStrengths[first]?.m ?? 1.0;
comfyUI.currentWorkflow[nodeId].inputs.strength_clip = _stackStrengths[first]?.c ?? 1.0;
}
@@ -1030,14 +1195,18 @@ export const comfyEditor = {
if (!el) return;
const loadNodes = analysis.load_image_nodes || [];
if (loadNodes.length === 0) {
el.innerHTML = `<p class="wfm-placeholder">No LoadImage nodes found in workflow</p>`;
const meoNodes = analysis.mask_editor_one_nodes || [];
if (loadNodes.length === 0 && meoNodes.length === 0) {
el.innerHTML = `<p class="wfm-placeholder">No LoadImage / Mask Editor One nodes found in workflow</p>`;
return;
}
// Render up to 4 image input slots
const slots = loadNodes.slice(0, 4);
// Mask Editor One ノード(画像+マスクを内包、常に両方必須)— 別枠で最大2件表示
const meoSlots = meoNodes.slice(0, 2);
el.innerHTML = `
${slots.length === 0 ? "" : `
<div class="wfm-i2i-grid">
${slots.map((node, i) => `
<div class="wfm-i2i-slot" data-slot="${i}" data-node-id="${node.id}">
@@ -1054,6 +1223,23 @@ export const comfyEditor = {
<input type="file" accept="image/*" class="wfm-i2i-file" id="wfm-i2i-file-${i}" style="display:none;">
</label>
</div>
${node.mask_used ? `
<div class="wfm-i2i-mask-section">
<div class="wfm-i2i-mask-header">
<span>Mask</span>
<span class="wfm-i2i-mask-filename" id="wfm-i2i-mask-filename-${i}"></span>
</div>
<div class="wfm-i2i-preview-wrap wfm-i2i-mask-preview-wrap" id="wfm-i2i-mask-preview-wrap-${i}" style="display:none;">
<img class="wfm-i2i-preview-img" id="wfm-i2i-mask-preview-${i}">
</div>
<div class="wfm-i2i-drop-zone wfm-i2i-mask-drop-zone" id="wfm-i2i-mask-drop-${i}">
<label class="wfm-i2i-drop-label">
Drop mask (white=inpaint) or click to select
<input type="file" accept="image/*" class="wfm-i2i-file" id="wfm-i2i-mask-file-${i}" style="display:none;">
</label>
</div>
</div>
` : ""}
<div style="display:flex;gap:6px;margin-top:6px;">
<button class="wfm-btn wfm-btn-sm wfm-btn-primary wfm-i2i-apply" data-slot="${i}" disabled>Apply</button>
<span class="wfm-i2i-status" id="wfm-i2i-status-${i}"></span>
@@ -1061,6 +1247,46 @@ export const comfyEditor = {
</div>
`).join("")}
</div>
`}
${meoSlots.length === 0 ? "" : `
<div class="wfm-i2i-grid" style="margin-top:12px;">
${meoSlots.map((node, i) => `
<div class="wfm-i2i-slot" data-meo-slot="${i}" data-node-id="${node.id}">
<div class="wfm-i2i-slot-header">
<span style="font-weight:600;font-size:12px;">ID:${node.id} ${node.title} (Mask Editor One)</span>
</div>
<div class="wfm-i2i-preview-wrap" id="wfm-meo-preview-wrap-${i}" style="display:none;">
<img class="wfm-i2i-preview-img" id="wfm-meo-preview-${i}">
</div>
<div class="wfm-i2i-drop-zone" id="wfm-meo-drop-${i}">
<label class="wfm-i2i-drop-label">
Drop image or click to select
<input type="file" accept="image/*" class="wfm-i2i-file" id="wfm-meo-file-${i}" style="display:none;">
</label>
</div>
<div class="wfm-i2i-mask-section">
<div class="wfm-i2i-mask-header">
<span>Mask</span>
<span class="wfm-i2i-mask-filename" id="wfm-meo-mask-filename-${i}"></span>
</div>
<div class="wfm-i2i-preview-wrap wfm-i2i-mask-preview-wrap" id="wfm-meo-mask-preview-wrap-${i}" style="display:none;">
<img class="wfm-i2i-preview-img" id="wfm-meo-mask-preview-${i}">
</div>
<div class="wfm-i2i-drop-zone wfm-i2i-mask-drop-zone" id="wfm-meo-mask-drop-${i}">
<label class="wfm-i2i-drop-label">
Drop mask (white=inpaint) or click to select
<input type="file" accept="image/*" class="wfm-i2i-file" id="wfm-meo-mask-file-${i}" style="display:none;">
</label>
</div>
</div>
<div style="display:flex;gap:6px;margin-top:6px;">
<button class="wfm-btn wfm-btn-sm wfm-btn-primary wfm-meo-apply" data-slot="${i}" disabled>Apply</button>
<span class="wfm-i2i-status" id="wfm-meo-status-${i}"></span>
</div>
</div>
`).join("")}
</div>
`}
`;
// Initialize each slot
@@ -1072,7 +1298,13 @@ export const comfyEditor = {
const filenameEl = document.getElementById(`wfm-i2i-filename-${i}`);
const statusEl = document.getElementById(`wfm-i2i-status-${i}`);
const dropZone = document.getElementById(`wfm-i2i-drop-${i}`);
const maskFileInput = document.getElementById(`wfm-i2i-mask-file-${i}`);
const maskDropZone = document.getElementById(`wfm-i2i-mask-drop-${i}`);
const maskPreviewWrap = document.getElementById(`wfm-i2i-mask-preview-wrap-${i}`);
const maskPreviewImg = document.getElementById(`wfm-i2i-mask-preview-${i}`);
const maskFilenameEl = document.getElementById(`wfm-i2i-mask-filename-${i}`);
let pendingFile = null;
let pendingMaskFile = null;
const applyFile = (file) => {
if (!file || !file.type.startsWith("image/")) return;
@@ -1085,10 +1317,24 @@ export const comfyEditor = {
statusEl.textContent = "";
};
const applyMaskFile = (file) => {
if (!file || !file.type.startsWith("image/")) return;
pendingMaskFile = file;
const url = URL.createObjectURL(file);
maskPreviewImg.src = url;
maskPreviewWrap.style.display = "";
maskFilenameEl.textContent = file.name;
applyBtn.disabled = false;
statusEl.textContent = "";
};
// File input change
fileInput?.addEventListener("change", () => {
if (fileInput.files.length > 0) applyFile(fileInput.files[0]);
});
maskFileInput?.addEventListener("change", () => {
if (maskFileInput.files.length > 0) applyMaskFile(maskFileInput.files[0]);
});
// Drag & drop
if (dropZone) {
@@ -1105,14 +1351,39 @@ export const comfyEditor = {
if (e.dataTransfer.files.length > 0) applyFile(e.dataTransfer.files[0]);
});
}
if (maskDropZone) {
maskDropZone.addEventListener("dragover", (e) => {
e.preventDefault();
maskDropZone.classList.add("drag-over");
});
maskDropZone.addEventListener("dragleave", () => {
maskDropZone.classList.remove("drag-over");
});
maskDropZone.addEventListener("drop", (e) => {
e.preventDefault();
maskDropZone.classList.remove("drag-over");
if (e.dataTransfer.files.length > 0) applyMaskFile(e.dataTransfer.files[0]);
});
}
// Apply button: upload to ComfyUI and set on node
// (マスクが指定されている場合は画像+マスクをRGBA合成して1枚のPNGとしてアップロードする)
applyBtn?.addEventListener("click", async () => {
if (!pendingFile) return;
if (!pendingFile && !pendingMaskFile) return;
applyBtn.disabled = true;
statusEl.textContent = "Uploading...";
try {
const result = await comfyUI.uploadImage(pendingFile, pendingFile.name);
let result;
if (pendingMaskFile) {
const baseImage = pendingFile || previewImg.src;
if (!baseImage) throw new Error("No base image to apply mask to");
const composedBlob = await _compositeImageWithMask(baseImage, pendingMaskFile);
const fileName = (pendingFile?.name || node.image || "inpaint.png").replace(/\.[^.]+$/, "") + "_masked.png";
const composedFile = new File([composedBlob], fileName, { type: "image/png" });
result = await comfyUI.uploadImage(composedFile, fileName);
} else {
result = await comfyUI.uploadImage(pendingFile, pendingFile.name);
}
if (result.name) {
// Update workflow node
if (comfyUI.currentWorkflow?.[node.id]) {
@@ -1132,6 +1403,76 @@ export const comfyEditor = {
}
});
});
// Initialize each Mask Editor One slot(画像+マスク両方が揃って初めてApply可能)
meoSlots.forEach((node, i) => {
const fileInput = document.getElementById(`wfm-meo-file-${i}`);
const maskFileInput = document.getElementById(`wfm-meo-mask-file-${i}`);
const dropZone = document.getElementById(`wfm-meo-drop-${i}`);
const maskDropZone = document.getElementById(`wfm-meo-mask-drop-${i}`);
const previewWrap = document.getElementById(`wfm-meo-preview-wrap-${i}`);
const previewImg = document.getElementById(`wfm-meo-preview-${i}`);
const maskPreviewWrap = document.getElementById(`wfm-meo-mask-preview-wrap-${i}`);
const maskPreviewImg = document.getElementById(`wfm-meo-mask-preview-${i}`);
const maskFilenameEl = document.getElementById(`wfm-meo-mask-filename-${i}`);
const applyBtn = el.querySelector(`.wfm-meo-apply[data-slot="${i}"]`);
const statusEl = document.getElementById(`wfm-meo-status-${i}`);
let pendingFile = null;
let pendingMaskFile = null;
const updateApplyEnabled = () => { applyBtn.disabled = !(pendingFile && pendingMaskFile); };
const applyFile = (file) => {
if (!file || !file.type.startsWith("image/")) return;
pendingFile = file;
previewImg.src = URL.createObjectURL(file);
previewWrap.style.display = "";
statusEl.textContent = "";
updateApplyEnabled();
};
const applyMaskFile = (file) => {
if (!file || !file.type.startsWith("image/")) return;
pendingMaskFile = file;
maskPreviewImg.src = URL.createObjectURL(file);
maskPreviewWrap.style.display = "";
maskFilenameEl.textContent = file.name;
statusEl.textContent = "";
updateApplyEnabled();
};
fileInput?.addEventListener("change", () => {
if (fileInput.files.length > 0) applyFile(fileInput.files[0]);
});
maskFileInput?.addEventListener("change", () => {
if (maskFileInput.files.length > 0) applyMaskFile(maskFileInput.files[0]);
});
[[dropZone, applyFile], [maskDropZone, applyMaskFile]].forEach(([zone, handler]) => {
if (!zone) return;
zone.addEventListener("dragover", (e) => { e.preventDefault(); zone.classList.add("drag-over"); });
zone.addEventListener("dragleave", () => zone.classList.remove("drag-over"));
zone.addEventListener("drop", (e) => {
e.preventDefault();
zone.classList.remove("drag-over");
if (e.dataTransfer.files.length > 0) handler(e.dataTransfer.files[0]);
});
});
applyBtn?.addEventListener("click", async () => {
if (!pendingFile || !pendingMaskFile) return;
applyBtn.disabled = true;
statusEl.textContent = "Uploading...";
try {
await this.applyImageAndMaskToMaskEditorOneNode(pendingFile, pendingMaskFile, node.id);
statusEl.textContent = "✓ Applied";
statusEl.style.color = "var(--wfm-success)";
} catch (err) {
statusEl.textContent = `✗ ${err.message}`;
statusEl.style.color = "var(--wfm-danger)";
applyBtn.disabled = false;
}
});
});
},
async applyImageToSlot(file, slotIndex = 0) {
@@ -1164,6 +1505,113 @@ export const comfyEditor = {
return result.name;
},
// imageInput/maskInput: File/Blob いずれも可。マスクは白=インペイント対象領域のグレースケール想定。
// 画像とマスクをRGBA合成し、1枚のPNGとして対象LoadImageノードへアップロードする
// (ComfyUIネイティブのアルファ→MASK抽出に準拠。Image Edit「Inpaint」タブのRunボタンから利用)。
// opts.workflow/opts.analysis を渡すと、comfyUI.currentWorkflow/currentAnalysis の代わりに
// そのワークフローへ書き込む(GenerateUIタブの表示・DOM更新は行わない。専用ワークフロー実行用)。
async applyImageAndMaskToSlot(imageInput, maskInput, slotIndex = 0, opts = {}) {
const workflow = opts.workflow || comfyUI.currentWorkflow;
const analysis = opts.analysis || comfyUI.currentAnalysis;
const loadNodes = analysis?.load_image_nodes || [];
const node = loadNodes[slotIndex];
if (!node) throw new Error("No LoadImage node at slot " + slotIndex);
const composedBlob = await _compositeImageWithMask(imageInput, maskInput);
const fileName = `inpaint_${Math.random().toString(36).slice(2, 10)}.png`;
const composedFile = new File([composedBlob], fileName, { type: "image/png" });
const result = await comfyUI.uploadImage(composedFile, fileName);
if (!result.name) throw new Error("Upload returned no filename");
if (workflow?.[node.id]) {
workflow[node.id].inputs.image = result.name;
}
if (opts.workflow) return 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;
},
// imageInput/maskInput: File/Blob いずれも可。マスクは白=インペイント対象領域のグレースケール想定。
// Mask Editor One (comfyui-mask-editor-one) ノード向け。画像はサーバー側キャッシュへ
// /mask_editor/store_image でPOSHし(node_idキー、bg_image_b64)、マスクは layer_data
// ウィジェットへ「アルファチャンネル=mask値」のレイヤーとして書き込む。
// opts.workflow を渡すと comfyUI.currentWorkflow の代わりにそのワークフローへ書き込む。
async applyImageAndMaskToMaskEditorOneNode(imageInput, maskInput, nodeId, opts = {}) {
const workflow = opts.workflow || comfyUI.currentWorkflow;
const bgDataUrl = await _imageInputToDataURL(imageInput);
const maskDataUrl = await _maskInputToAlphaDataURL(maskInput);
const resp = await fetch(`${comfyUI.baseUrl}/mask_editor/store_image`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ node_id: String(nodeId), bg_image_b64: bgDataUrl }),
});
if (!resp.ok) throw new Error(`Failed to store image for Mask Editor One (node ${nodeId})`);
if (workflow?.[nodeId]) {
workflow[nodeId].inputs.layer_data = JSON.stringify({
layers: [{ visible: true, opacity: 1, operation: "add", imageData: maskDataUrl }],
});
}
if (!opts.workflow) _syncRawJson();
},
// Inpaint Run から呼ばれるポジ/ネガプロンプト設定。
// opts.workflow/opts.analysis を渡すと、GenerateUIタブの選択中ターゲット(DOM)に依存せず、
// そのワークフロー内の最初の該当role prompt_nodeへ直接反映する(専用ワークフロー実行用)。
setPromptText(role, text, opts = {}) {
if (opts.workflow && opts.analysis) {
const node = (opts.analysis.prompt_nodes || []).find((n) => n.role === role);
if (node && opts.workflow[node.id]) {
opts.workflow[node.id].inputs[node.textKey || "text"] = text;
}
return;
}
const textareaId = role === "positive" ? "wfm-prompt-pos-text" : "wfm-prompt-neg-text";
const textarea = document.getElementById(textareaId);
if (textarea) textarea.value = text;
this.syncToWorkflow();
_syncRawJson();
},
// Inpaint Run から呼ばれる grow_mask_by / denoise 設定。
// ワークフロー内の最初の VAEEncodeForInpaint ノード / denoise を持つ最初の sampler ノードへ反映する
// (複数のインペイントパイプラインが同一ワークフローに存在するケースは現状非対応)。
// workflow/analysis を渡すと comfyUI.currentWorkflow/currentAnalysis の代わりにそちらへ書き込む。
setInpaintParams({ growMaskBy, denoise, workflow, analysis } = {}) {
const wf = workflow || comfyUI.currentWorkflow;
const an = analysis || comfyUI.currentAnalysis;
const encodeNode = an?.inpaint_encode_nodes?.[0];
if (encodeNode && growMaskBy != null && wf?.[encodeNode.id]) {
wf[encodeNode.id].inputs.grow_mask_by = growMaskBy;
}
const samplerNode = (an?.sampler_nodes || []).find((n) => n.denoise !== undefined);
if (samplerNode && denoise != null && wf?.[samplerNode.id]) {
wf[samplerNode.id].inputs.denoise = denoise;
}
if (!workflow) _syncRawJson();
},
syncToWorkflow() {
// Sync prompt texts before generation
const posSelect = document.getElementById("wfm-prompt-pos-target");
+36
View File
@@ -487,6 +487,8 @@ export const comfyWorkflow = {
vae_nodes: [],
save_nodes: [],
load_image_nodes: [],
inpaint_encode_nodes: [],
mask_editor_one_nodes: [],
text_encoder_nodes: [],
diffusion_model_nodes: [],
controlnet_nodes: [],
@@ -809,6 +811,22 @@ export const comfyWorkflow = {
});
}
// --- VAE Encode (for Inpainting) nodes ---
if (ct === "VAEEncodeForInpaint") {
result.inpaint_encode_nodes.push({
id, type: ct, title,
grow_mask_by: inputs.grow_mask_by,
});
}
// --- Mask Editor One nodes (comfyui-mask-editor-one) ---
// 画像とマスクをノード自身が内包する(LoadImageを介さない)インペイント画像ソース。
// image出力はサーバー側キャッシュ(bg_image_b64、node_idキー)から、mask出力は
// layer_data(JSON文字列)ウィジェットの各レイヤーのアルファチャンネルから合成される。
if (ct === "MaskEditorOne") {
result.mask_editor_one_nodes.push({ id, type: ct, title });
}
// --- Text encoder (CLIP) nodes ---
if (ct === "DualCLIPLoader" || ct === "CLIPLoader" || ct === "ClipLoaderGGUF" || ct === "DualClipLoaderGGUF") {
result.text_encoder_nodes.push({
@@ -850,6 +868,24 @@ export const comfyWorkflow = {
}
}
// --- Post-pass: flag LoadImage nodes whose MASK output (slot 1) is wired to something
// downstream (directly, or via a pass-through node like MaskEditorNode). These are the
// "inpaint-capable" slots — image + mask both come from the same node's two outputs, so
// painting a mask for them only requires re-uploading that one node's image with the mask
// baked into the alpha channel (matches ComfyUI's native LoadImage alpha→MASK extraction). ---
const loadImageIds = new Set(result.load_image_nodes.filter(n => n.type === "LoadImage").map(n => n.id));
if (loadImageIds.size > 0) {
for (const node of Object.values(workflow)) {
if (!node?.inputs) continue;
for (const v of Object.values(node.inputs)) {
if (Array.isArray(v) && v.length === 2 && Number(v[1]) === 1 && loadImageIds.has(String(v[0]))) {
const target = result.load_image_nodes.find(n => n.id === String(v[0]));
if (target) target.mask_used = true;
}
}
}
}
result.all_nodes.sort((a, b) => Number(a.id) - Number(b.id));
return result;
},
+99
View File
@@ -43,6 +43,43 @@ const API = {
export const FEEDER_GROUP = "__Feeder__";
// ComfyUI Comic Creater からiframe越しに画像を受け取り、Generate UIのImage入力スロットへ直接セットする(I2I連携)。
// Comic Creater側の「I2Iへ送る」ボタンから
// iframe.contentWindow._wfmReceiveImageForI2I(blob, name, workflowData?, workflowFilename?) として呼ばれる。
// 画像スロットへのセット自体は wfm-gallery-send-genui-image-btn のクリックハンドラ(Galleryの選択画像を送る版)と同一。
// workflowData が渡された場合(Comic Creater側の設定タブでデフォルトワークフローが有効な時)は、
// 画像をセットする前にそのワークフローを読み込む。
window._wfmReceiveImageForI2I = async (blob, name, workflowData, workflowFilename) => {
try {
if (workflowData) {
try {
// iframeロード直後などモデルリスト未取得のままワークフローを読み込むと、
// Model/生成UIタブのCheckpoint等ドロップダウンが空のままレンダリングされてしまう。
// 接続確認・モデルリスト取得を保証してからワークフローを読み込む
if (!comfyUI.connected) {
await comfyUI.checkConnection();
}
if (comfyUI.connected && (!comfyEditor.models.checkpoints || comfyEditor.models.checkpoints.length === 0)) {
await comfyEditor.loadModelLists();
}
await loadWorkflowIntoEditor(workflowData, workflowFilename || "workflow.json");
} catch (e) {
console.warn("[I2I] failed to load default workflow:", e);
}
}
const file = new File([blob], name || "cc-image.png", { type: blob.type || "image/png" });
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");
return true;
} catch (e) {
showToast(t("errorWithMsg", e.message), "error");
return false;
}
};
// ── ページング ────────────────────────────────────────────────
const PAGE_SIZE = 50;
let _renderedCount = 0;
@@ -1506,6 +1543,68 @@ function bindEvents() {
}
});
// 選択画像を ComfyUI Comic Creator の選択コマ/オーバーレイへ送信
// (ComfyUI Comic CreaterからこのGalleryタブがiframe埋め込みされている場合のみ表示・動作する)
const sendCcBtn = document.getElementById("wfm-gallery-send-cc-btn");
if (sendCcBtn) {
let embedded = false;
try {
embedded = !!(window.parent && window.parent !== window);
} catch (e) {
embedded = false;
}
if (embedded) sendCcBtn.style.display = "";
sendCcBtn.addEventListener("click", () => {
if (!state.selectedImage) {
showToast(t("gallerySelectImageFirst"), "info");
return;
}
const url = API.serveImage(state.selectedImage.path);
// I2I送信元がImageタブだった場合はそちらへ画像を読み込ませる(_ccI2ITargetModeはComic Creater側が
// 「I2Iへ送る」ボタン押下時にセットするフラグ。undefined/'layout'なら従来通りコマ/オーバーレイへ挿入)
let targetMode = null;
try {
targetMode = window.parent?._ccI2ITargetMode || null;
} catch (e) {
targetMode = null;
}
if (targetMode === "image") {
let imageTab = null;
try {
if (window.parent && window.parent !== window && typeof window.parent._ccImageTab?.loadFromUrl === "function") {
imageTab = window.parent._ccImageTab;
}
} catch (e) {
imageTab = null;
}
if (!imageTab) {
showToast(t("galleryCCNotAvailable"), "info");
return;
}
imageTab.loadFromUrl(url, (state.selectedImage.filename || "cc-image").replace(/\.[^.]+$/, ""));
showToast(t("gallerySentCC"), "success");
return;
}
let insertFn = null;
try {
if (window.parent && window.parent !== window && typeof window.parent.insertImageFromUrl === "function") {
insertFn = window.parent.insertImageFromUrl;
}
} catch (e) {
insertFn = null;
}
if (!insertFn) {
showToast(t("galleryCCNotAvailable"), "info");
return;
}
insertFn(url);
showToast(t("gallerySentCC"), "success");
});
}
// 検索
document.getElementById("wfm-gallery-search")?.addEventListener("input", (e) => {
state.search = e.target.value;
+103 -20
View File
@@ -1397,7 +1397,7 @@ async function _expandWildcardsInWorkflow(workflow) {
// Generation (core — throws on error)
// ============================================
async function _coreGenerate(silent = false) {
async function _coreGenerate(silent = false, workflowOverride = null) {
const progressBar = document.getElementById("wfm-gen-progress-bar");
const progressText = document.getElementById("wfm-gen-progress-text");
const resultImg = document.getElementById("wfm-gen-result-img");
@@ -1409,7 +1409,8 @@ async function _coreGenerate(silent = false) {
if (progressBar) progressBar.style.width = "0%";
if (progressText) progressText.textContent = "Starting...";
const workflowExpanded = await _expandWildcardsInWorkflow({ ...comfyUI.currentWorkflow });
const baseWorkflow = workflowOverride || comfyUI.currentWorkflow;
const workflowExpanded = await _expandWildcardsInWorkflow({ ...baseWorkflow });
const workflowForGenerate = _applyStyleToWorkflow(workflowExpanded);
const { images, seed } = await comfyUI.generate(
workflowForGenerate,
@@ -1463,7 +1464,7 @@ async function _coreGenerate(silent = false) {
}
if (images.length > 0) {
saveGeneratedImagesMeta(images, { ...comfyUI.currentWorkflow }).catch(() => {});
saveGeneratedImagesMeta(images, { ...baseWorkflow }).catch(() => {});
}
if (!silent) showToast(t("generationComplete"), "success");
@@ -1559,20 +1560,89 @@ async function _runBatchGenerate() {
if (loraNodes.length === 0) { showToast(t("modelsGenUINoNode", "LoRA"), "error"); return; }
const list = [..._getSelectedLoraGroupItems()];
if (list.length === 0) { showToast(t("batchNoneSelected", "LoRAs"), "error"); return; }
await _runBatchLoop(list, (loraName) => {
for (const node of loraNodes) {
if (!comfyUI.currentWorkflow?.[node.id]) continue;
if (node.is_lora_manager) {
// 通常のLoraLoaderはComfyUI側のenumリストに存在しないファイル名だとバリデーションエラーになる。
// ComfyUI(Windows)はサブフォルダ区切りに"\"を使うが内部リストは"/"のため、事前に正しい表記へ変換しておく。
let loraNameMap = null;
if (loraNodes.some((node) => !node.is_lora_manager)) {
try {
const known = await comfyUI.fetchLoras();
loraNameMap = new Map(known.map((n) => [n.replace(/\\/g, "/"), n]));
const missing = list.filter((name) => !loraNameMap.has(name.replace(/\\/g, "/")));
if (missing.length > 0) {
showToast(t("batchLoraMissing", missing.length, list.length, missing[0]), "error");
}
} catch {}
}
// Positiveプロンプトへlora構文+トリガーワードを反映するための準備(Single/Stack適用と同じ仕組み)
const positiveNodes = (comfyUI.currentAnalysis?.prompt_nodes || []).filter((n) => n.role === "positive");
let metadata = {}, civitaiCache = {};
try {
const [metaRes, civRes] = await Promise.all([
fetch("/api/wfm/models/metadata"),
fetch("/api/wfm/models/civitai/cache"),
]);
metadata = metaRes.ok ? await metaRes.json() : {};
civitaiCache = civRes.ok ? await civRes.json() : {};
} catch {}
// バッチ開始前のプロンプトを保存し、完了・停止後に復元する
const posTextarea = document.getElementById("wfm-prompt-pos-text");
const savedTextareaValue = posTextarea ? posTextarea.value : null;
const savedNodeTexts = new Map();
for (const node of positiveNodes) {
const wfNode = comfyUI.currentWorkflow?.[node.id];
if (wfNode) savedNodeTexts.set(node.id, wfNode.inputs[node.textKey || "text"]);
}
try {
await _runBatchLoop(list, (loraName) => {
for (const node of loraNodes) {
if (!comfyUI.currentWorkflow?.[node.id]) continue;
if (node.is_lora_manager) {
const stem = loraName.replace(/\\/g, "/").split("/").pop().replace(/\.[^.]+$/, "");
comfyUI.currentWorkflow[node.id].inputs.loras = {
__value__: [{ name: stem, strength: 1.0, active: true, expanded: false, clipStrength: 1.0, locked: false }],
};
comfyUI.currentWorkflow[node.id].inputs.text = `<lora:${stem}:1:1>`;
} else {
const actualName = loraNameMap?.get(loraName.replace(/\\/g, "/")) || loraName;
comfyUI.currentWorkflow[node.id].inputs.lora_name = actualName;
}
}
if (positiveNodes.length > 0) {
const stem = loraName.replace(/\\/g, "/").split("/").pop().replace(/\.[^.]+$/, "");
comfyUI.currentWorkflow[node.id].inputs.loras = {
__value__: [{ name: stem, strength: 1.0, active: true, expanded: false, clipStrength: 1.0, locked: false }],
};
comfyUI.currentWorkflow[node.id].inputs.text = `<lora:${stem}:1:1>`;
} else {
comfyUI.currentWorkflow[node.id].inputs.lora_name = loraName;
const firstStandardNode = loraNodes.find((n) => !n.is_lora_manager);
const strModel = firstStandardNode ? (comfyUI.currentWorkflow[firstStandardNode.id]?.inputs.strength_model ?? 1.0) : 1.0;
const strClip = firstStandardNode ? (comfyUI.currentWorkflow[firstStandardNode.id]?.inputs.strength_clip ?? 1.0) : 1.0;
const loraSyntax = `<lora:${stem}:${strModel}:${strClip}>`;
const sha = (metadata[loraName] || {}).sha256;
const civInfo = sha && civitaiCache[sha];
const triggerWords = civInfo?.trainedWords || [];
const append = triggerWords.length > 0 ? `${loraSyntax}, ${triggerWords.join(", ")}` : loraSyntax;
for (const node of positiveNodes) {
const wfNode = comfyUI.currentWorkflow?.[node.id];
if (!wfNode) continue;
const base = (savedNodeTexts.get(node.id) || "").replace(/,\s*$/, "").trim();
wfNode.inputs[node.textKey || "text"] = base ? `${base}, ${append}` : append;
}
if (posTextarea && savedTextareaValue !== null) {
const base = savedTextareaValue.replace(/,\s*$/, "").trim();
posTextarea.value = base ? `${base}, ${append}` : append;
}
}
}, (name) => name.replace(/\.[^.]+$/, ""));
} finally {
// プロンプトをバッチ開始前の状態へ復元
for (const node of positiveNodes) {
const wfNode = comfyUI.currentWorkflow?.[node.id];
if (wfNode && savedNodeTexts.has(node.id)) {
wfNode.inputs[node.textKey || "text"] = savedNodeTexts.get(node.id);
}
}
}, (name) => name.replace(/\.[^.]+$/, ""));
if (posTextarea && savedTextareaValue !== null) posTextarea.value = savedTextareaValue;
}
break;
}
case "prompt": {
@@ -1660,14 +1730,20 @@ async function _runBatchGenerate() {
// Generate entry point
// ============================================
async function handleGenerate() {
if (!comfyUI.currentWorkflow) {
// workflowOverride: 明示的に渡された場合、comfyUI.currentWorkflow の代わりにこのワークフローで
// 生成する(GenerateUIの表示状態には触れない。Image Edit「Inpaint」の専用ワークフロー実行から利用)。
// ボタンのclickハンドラから呼ばれる場合は第一引数がMouseEventになるため、その場合は無視する。
async function handleGenerate(workflowOverride = null) {
if (workflowOverride instanceof Event) workflowOverride = null;
if (!workflowOverride && !comfyUI.currentWorkflow) {
showToast(t("noWorkflowLoaded"), "error");
return;
}
if (comfyUI.generating) return;
comfyEditor.syncToWorkflow();
// オーバーライド実行時は GenerateUI 側の表示中プロンプトを別ワークフローへ誤って書き込まないよう同期をスキップする
if (!workflowOverride) comfyEditor.syncToWorkflow();
const genBtn = document.getElementById("wfm-gen-generate-btn");
const interruptBtn = document.getElementById("wfm-gen-interrupt-btn");
@@ -1678,18 +1754,20 @@ async function handleGenerate() {
_ckptBatch.paused = false;
_ckptBatch._resumeResolve = null;
const batchEnabled = _activeBatchType !== null;
// オーバーライド実行時はバッチモードの影響を受けない単発生成に固定する
const batchEnabled = !workflowOverride && _activeBatchType !== null;
try {
if (batchEnabled) {
await _runBatchGenerate();
} else {
try {
await _coreGenerate(false);
await _coreGenerate(false, workflowOverride);
} catch (err) {
const progressText = document.getElementById("wfm-gen-progress-text");
if (progressText) progressText.textContent = "Error";
showToast(t("generationError", err.message), "error");
throw err;
}
}
} finally {
@@ -1750,7 +1828,12 @@ export async function initGenerateTab() {
});
// Generate button
document.getElementById("wfm-gen-generate-btn")?.addEventListener("click", handleGenerate);
document.getElementById("wfm-gen-generate-btn")?.addEventListener("click", () => {
handleGenerate().catch(() => {});
});
// Cross-tab entry point (Image Edit「Inpaint」タブの Run ボタンなど外部から生成を呼び出す用)
window._wfmGenerateTab = { generate: handleGenerate };
// Alt+Apply from Input/Model/Settings tabs → Apply & Generate
document.addEventListener("wfm:apply-and-generate", () => handleGenerate());
+36 -15
View File
@@ -116,6 +116,7 @@ const LANGUAGES = {
deleteConfirm: (name) => `Delete "${name}"?`,
summaryGenerated: "Summary generated",
summarizeError: "Summarize error",
summarizeOllamaOnly: "Summarize only supports the Ollama backend. Switch backend in Settings.",
copied: "Copied",
// -- GenerateUI --
@@ -210,6 +211,7 @@ const LANGUAGES = {
batchItemFailed: (i, total, msg) => `[${i}/${total}] Failed: ${msg}`,
batchStopped: (completed, failed) => `Batch stopped — ${completed} completed, ${failed} failed`,
batchComplete: (completed, total, failed) => failed > 0 ? `Batch complete: ${completed}/${total} (${failed} failed)` : `Batch complete: ${completed}/${total}`,
batchLoraMissing: (count, total, sample) => `${count}/${total} selected LoRAs are not recognized by ComfyUI yet (e.g. ${sample}). Click Refresh in ComfyUI or restart the server, then try again.`,
connectedToComfyUI: "Connected to ComfyUI",
failedToConnect: "Failed to connect",
modelListsRefreshed: "Model lists refreshed",
@@ -355,6 +357,7 @@ const LANGUAGES = {
modelsGenUIUnsupported: "This model type cannot be set in GenerateUI",
modelsGenUINoWorkflow: "No workflow loaded in GenerateUI",
modelsGenUINoNode: (type) => `No ${type} node found in current workflow`,
revertPromptTitle: "Revert to last applied prompt",
modelsCopyName: "Click to copy model name",
modelsCopiedName: "Model name copied",
modelsFilePath: "File Path",
@@ -471,6 +474,8 @@ const LANGUAGES = {
gallerySelectImageFirst: "Please select an image first",
galleryNoLoadImageNode: "No LoadImage node in current workflow",
gallerySentGenUI: "Sent to GenerateUI Image tab",
galleryCCNotAvailable: "Open this Gallery from ComfyUI Comic Creator to use Send CC",
gallerySentCC: "Sent to ComfyUI Comic Creator",
galleryNoEmbeddedWorkflow: "No ComfyUI workflow embedded in this image.",
galleryBulkSelected: "selected",
galleryBulkDeselectAll: "Deselect All",
@@ -615,7 +620,7 @@ const LANGUAGES = {
helpGen1: "Connect/disconnect ComfyUI and check connection status",
helpGen2: "Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor; Save button (right end of the tab bar) saves the current workflow — including any edits made in the editor — as a new .json file to the Workflow tab; a filename dialog appears with the current workflow name as the default",
helpGen3: "5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing",
helpGen4: "Input tab: inner tabs — Prompt and Image (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an Embeddings selector at the bottom — select a model, set Weight (default 1.0), then click Paste to insert (embedding:Name:weight) at the cursor position of the last focused textarea (defaults to Positive if neither is focused)",
helpGen4: "Input tab: inner tabs — Prompt and Image (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an Embeddings selector at the bottom — select a model, set Weight (default 1.0), then click Paste to insert (embedding:Name:weight) at the cursor position of the last focused textarea (defaults to Positive if neither is focused); a ↺ button next to each Apply button reverts the textarea to the node's currently applied value; select text (or just place the cursor on a word/parenthesis block) and press Ctrl+↑/↓ to adjust its emphasis weight in (text:weight) syntax by ±0.05 — the parentheses are removed automatically when the weight returns to 1.0",
helpGen5: "Model tab: Checkpoint, VAE, LoRA (Single/Stack tabs), ControlNet, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors), Hypernetwork (with Strength field) selectors with filter",
helpGen6: "Settings tab: KSampler and Latent Image side by side, each at 50% width",
helpGen7: "Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow",
@@ -630,6 +635,7 @@ const LANGUAGES = {
helpGen16: "SPA-side wildcard expansion (A1111-style): when prompt text in non-ImpactWildcard nodes (e.g. CLIPTextEncode) contains __name__ syntax, the SPA expands it at generation time by randomly picking a line from the matching file in the WFS wildcard folder; nested wildcards are re-expanded up to 5 passes; unresolved wildcards are passed through unchanged; ImpactWildcardEncode/Processor nodes are skipped (handled server-side by Impact Pack); works in both single and batch generation",
helpGen17: "Style batch: select styles from the Style tab in the left pane, enable the Style column in Batch Queue, then Generate — each selected style is applied in sequence to the positive and negative prompts; applied to workflow copies so the loaded workflow is not modified; style files are re-read on each page load from user/default/Workflow-Studio/style/*.json",
helpGen18: "Alt+Click any Apply button (Positive Prompt / Checkpoint / KSampler) to Apply & Generate in one step — applies the parameter to the workflow then immediately queues a generation; only fires when the target node exists in the loaded workflow",
helpGen19: "Lora batch: for each LoRA, its syntax (<lora:name:strength_model:strength_clip>) and CivitAI trained words are automatically appended to the Positive prompt — rebuilt from the original prompt each time, not accumulated; the prompt is automatically restored to its pre-batch state when the batch completes or is stopped; if a selected LoRA is not yet recognized by ComfyUI's model list, a warning toast is shown (Refresh or restart ComfyUI)",
helpFeederTitle: "GenerateUI Tab — Feeder subtab",
helpFeederDesc: "Two modes switchable via the [Image Loop] / [Gallery] toggle at the top of the left pane.",
helpFeederImgloopTitle: "Image Loop mode",
@@ -752,10 +758,10 @@ const LANGUAGES = {
helpImageEditTitle: "Image Edit Tab",
helpImageEdit1: "Layer-based image editor — compose images with multiple layers (Image, Text, Draw, Mask types) and export the composite",
helpImageEdit2: "Loading images: drag & drop onto the canvas, Upload button, or send from the Gallery tab via the Image Edit button in the Gallery toolbar; the first image becomes Layer 1 (auto-locked); subsequent images are added as new layers scaled to fit the canvas",
helpImageEdit3: "New button: create a blank canvas — prompts for WxH size (e.g. 512x768); clears all existing layers",
helpImageEdit3: "New button: create a blank canvas — prompts for WxH size (e.g. 512x768); clears all existing layers and automatically adds an empty Layer 1",
helpImageEditToolsTitle: "Tools",
helpImageEdit4: "Select (V): click to select a layer; drag to move; drag corner handles to resize; drag the circle above the top edge to rotate; double-click a text layer to re-edit its content; Tool Options bar shows Flip H / Flip V / Rotate field",
helpImageEdit5: "Draw (B): freehand brush drawing onto the active draw layer; Tool Options: color, brush size, blend mode",
helpImageEdit5: "Draw (B): freehand brush drawing onto the active draw layer; Tool Options: color, brush size, blend mode; Properties pane includes a MASK EDITOR ONE (COLOR) section for ABR image brushes — always visible, header text is green when brushes are available, gray when none are imported yet; Select is disabled until at least one brush exists",
helpImageEdit6: "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",
helpImageEdit7: "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",
helpImageEditLayerTitle: "Layer Panel",
@@ -788,13 +794,14 @@ const LANGUAGES = {
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 (requires Mask Editor One + birefnet.safetensors in ComfyUI/models/background_removal/); see the BG Remove Tool card below for details",
helpImageEdit7d: "Mask (🎭): paint masks on a mask layer using 6 sub-tools — Paint (freehand), Color (flood-select by similar color), Alpha (extract from image transparency), Text (stamp text), Vector (Catmull-Rom spline polygon), Shape (rect / ellipse); SAM3 text-prompt segmentation is also available when Mask Editor One is installed; click \"M\" in the Layers header to add a mask layer; see the Mask Tool card below for details",
helpImageEdit7e: "Inpaint (🩹): composites the visible layers plus a Mask layer into one RGBA image (mask baked into the alpha channel) and applies it to the first inpaint-capable LoadImage node in the workflow currently loaded in GenerateUI (a node whose MASK output feeds something like VAEEncodeForInpaint); enter Positive/Negative prompts, Grow Mask By (applied to the VAE Encode (for Inpainting) node), and Denoise (applied to KSampler) in the properties panel, then click Run to upload and generate without leaving the Image Edit tab — the result is shown back in the properties panel when done; requires a Mask layer to be painted first and an inpaint-capable workflow loaded in GenerateUI; also works with workflows built around the Mask Editor One custom node (comfyui-mask-editor-one) instead of LoadImage — image/mask are pushed to it via its node_id-keyed server cache and layer_data widget; \"Use dedicated workflow\" checkbox: when off, the workflow currently loaded in GenerateUI is used (unchanged); when on, pick a saved workflow from the dropdown — it is loaded, edited, and generated entirely in the background without disturbing the workflow shown in GenerateUI",
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 — sub-tools: Paint / Color / Alpha / Text / Vector / Shape (all work without Mask Editor One) / SAM3 (requires Mask Editor One, disabled if not installed); Invert checkbox inverts the overlay preview; Overlay color picker changes the preview color (default red); Blur slider (0–50 px) softens the overlay edge",
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)",
helpImageEditMask3: "Tool Options bar — sub-tools: Paint / Color / Alpha / Text / Vector / Shape (all work without Mask Editor One) / SAM3 (requires Mask Editor One, disabled if not installed); Invert checkbox inverts the overlay preview; Overlay color picker changes the preview color (default red); Blur slider (0–50 px) softens the overlay edge; the overlay is only shown for the currently active mask layer — inactive mask layers stay hidden until selected",
helpImageEditMask4: "Properties pane — Paint mode: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); MASK EDITOR ONE section (always visible — header text is green when ABR brushes are available, gray when none are imported yet): Select button opens the ABR brush library (disabled until at least one brush exists) — 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",
@@ -1093,6 +1100,7 @@ const LANGUAGES = {
deleteConfirm: (name) => `"${name}" を削除しますか?`,
summaryGenerated: "要約を生成しました",
summarizeError: "要約エラー",
summarizeOllamaOnly: "要約機能はOllamaバックエンドのみ対応しています。設定でバックエンドを切り替えてください。",
copied: "コピーしました",
// -- GenerateUI --
@@ -1187,6 +1195,7 @@ const LANGUAGES = {
batchItemFailed: (i, total, msg) => `[${i}/${total}] 失敗: ${msg}`,
batchStopped: (completed, failed) => `バッチ停止 — 完了${completed}件、失敗${failed}件`,
batchComplete: (completed, total, failed) => failed > 0 ? `バッチ完了: ${completed}/${total}件 (${failed}件失敗)` : `バッチ完了: ${completed}/${total}件`,
batchLoraMissing: (count, total, sample) => `選択したLoRAのうち${count}/${total}件がComfyUIに認識されていません(例: ${sample})。ComfyUIでRefreshするかサーバーを再起動してから再実行してください。`,
connectedToComfyUI: "ComfyUIに接続しました",
failedToConnect: "接続に失敗しました",
modelListsRefreshed: "モデルリストを更新しました",
@@ -1332,6 +1341,7 @@ const LANGUAGES = {
modelsGenUIUnsupported: "このモデルタイプはGenerateUIに設定できません",
modelsGenUINoWorkflow: "GenerateUIにワークフローが読み込まれていません",
modelsGenUINoNode: (type) => `現在のワークフローに${type}ノードが見つかりません`,
revertPromptTitle: "直前にApplyしたプロンプトに戻す",
modelsCopyName: "クリックでモデル名をコピー",
modelsCopiedName: "モデル名をコピーしました",
modelsFilePath: "ファイルパス",
@@ -1448,6 +1458,8 @@ const LANGUAGES = {
gallerySelectImageFirst: "先に画像を選択してください",
galleryNoLoadImageNode: "現在のワークフローにLoadImageノードがありません",
gallerySentGenUI: "GenerateUI Imageタブへ送信しました",
galleryCCNotAvailable: "Send CCはComfyUI Comic Creator内のギャラリーから開いた場合のみ使用できます",
gallerySentCC: "ComfyUI Comic Creatorへ送信しました",
galleryNoEmbeddedWorkflow: "この画像にはComfyUIワークフローが埋め込まれていません。",
galleryBulkSelected: "件選択中",
galleryBulkDeselectAll: "選択解除",
@@ -1592,7 +1604,7 @@ const LANGUAGES = {
helpGen1: "ComfyUIの接続・切断、接続状態の確認",
helpGen2: "Workflowタブからワークフローを読み込み(App形式 .app.json は非対応)。Reset Workflowボタンは現在のワークフローファイルをディスクから再読込してエディタをリロード。Saveボタン(タブバー右端)はエディタでの編集を含む現在のワークフローを新しい.jsonファイルとしてWorkflowタブに保存(現在のワークフロー名を初期値としたファイル名ダイアログを表示)",
helpGen3: "5タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder、Batch — Input/Model/SettingsタブにはRaw JSON列を常時表示",
helpGen4: "Inputタブ:Prompt・Imageの内部タブ切り替え;PromptタブにはPositive Prompt・Negative Promptに加え最下部にEmbeddingsセレクタを表示(Filter+セレクト+Weight入力+Pasteボタン)— Pasteは最後にフォーカスしたテキストエリアのカーソル位置に(embedding:Name:weight)を挿入(未フォーカス時はPositiveに追加)",
helpGen4: "Inputタブ:Prompt・Imageの内部タブ切り替え;PromptタブにはPositive Prompt・Negative Promptに加え最下部にEmbeddingsセレクタを表示(Filter+セレクト+Weight入力+Pasteボタン)— Pasteは最後にフォーカスしたテキストエリアのカーソル位置に(embedding:Name:weight)を挿入(未フォーカス時はPositiveに追加);各Applyボタンの左隣の↺ボタンはテキストエリアをノードの現在の適用値に戻す;テキストを選択(または単語・括弧内にカーソルを置くだけでも可)してCtrl+↑/↓を押すと(text:weight)形式で強調weightを±0.05単位で調整(weightが1.0に戻ると括弧を自動解除)",
helpGen5: "Modelタブ:Checkpoint/VAE/LoRA(Single/Stackタブ)/ControlNet/Diffusion Model(UNETLoader / UnetLoaderGGUF / LoaderGGUF対応)/Text Encoder(CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF対応 — typeおよびdevice選択付き、DualCLIPは2段モデル選択)/Hypernetwork(Strength入力付き)のセレクタ(フィルタ検索付き)",
helpGen6: "Settingsタブ:KSamplerとLatent Imageを横並び(各50%幅)",
helpGen7: "Raw JSONを各タブの右列に常時表示 — 直接編集してApplyでワークフロー即時反映",
@@ -1607,6 +1619,7 @@ const LANGUAGES = {
helpGen16: "SPAサイドのワイルドカード展開(A1111スタイル):ImpactWildcard系以外のノード(CLIPTextEncodeなど)のプロンプトに__name__構文が含まれる場合、生成時にSPA側がWFSワイルドカードフォルダの対応ファイルからランダムに1行選んで展開;ネストしたワイルドカードは最大5パスまで再展開;見つからないワイルドカードはそのまま送信;ImpactWildcardEncode/ProcessorノードはスキップしてComfyUIサーバー側(Impact Pack)が処理;単体生成・バッチ生成どちらでも機能",
helpGen17: "スタイルバッチ:左ペインのStyleタブでスタイルを選択し、バッチキューのStyle列を有効化してGenerateを実行 — 選択した各スタイルをPositiveおよびNegativeプロンプトに順番に適用;ワークフローコピーに適用されるため読み込み済みワークフローは変更されない;スタイルファイルはページロードのたびに user/default/Workflow-Studio/style/*.json から再読み込み",
helpGen18: "Applyボタンを Alt+Click すると Apply & Generate を1操作で実行 — 対象:Positive Prompt・Checkpoint・KSamplerの各Applyボタン;ワークフローに値を書き込んだ後、即座に生成をキューに追加;対象ノードが存在しない場合は何もしない",
helpGen19: "Loraバッチ:各LoRA適用時にLora構文(<lora:名前:strength_model:strength_clip>)とCivitAIトリガーワードをPositiveプロンプトへ自動追加 — 毎回元のプロンプトを起点に再構築するため蓄積しない;バッチ完了・停止後はプロンプトを開始前の状態へ自動復元;選択したLoRAがComfyUIのモデル一覧にまだ認識されていない場合は警告トーストを表示(ComfyUIのRefreshまたは再起動が必要)",
helpFeederTitle: "GenerateUI Tab — Feeder サブタブ",
helpFeederDesc: "左ペイン上部の [Image Loop] / [Gallery] トグルで2つのモードを切り替えられます。",
helpFeederImgloopTitle: "Image Loop モード",
@@ -1729,10 +1742,10 @@ const LANGUAGES = {
helpImageEditTitle: "Image Edit タブ",
helpImageEdit1: "レイヤーベースの画像エディタ — 複数のレイヤー(画像・テキスト・描画・マスク)を重ね合わせて画像を合成・エクスポート",
helpImageEdit2: "画像の読み込み:キャンバスへのドラッグ&ドロップ、Uploadボタン、またはGalleryタブのImage Editボタンから送信;最初の画像はLayer 1として自動ロック;以降の画像はキャンバスサイズに合わせてスケールされ新規レイヤーとして追加",
helpImageEdit3: "Newボタン:空白キャンバスを作成 — W×Hサイズを入力(例: 512x768);既存レイヤーは全て削除",
helpImageEdit3: "Newボタン:空白キャンバスを作成 — W×Hサイズを入力(例: 512x768);既存レイヤーは全て削除し、空のLayer 1を自動追加",
helpImageEditToolsTitle: "ツール",
helpImageEdit4: "Select (V):クリックでレイヤーを選択、ドラッグで移動、コーナーハンドルでリサイズ、上辺の円ハンドルで回転;テキストレイヤーをダブルクリックすると再編集可能;ツールオプションバーにFlip H / Flip V / 回転角度入力を表示",
helpImageEdit5: "Draw (B):アクティブな描画レイヤーにフリーハンドで描画;ツールオプション:カラー、ブラシサイズ、ブレンドモード",
helpImageEdit5: "Draw (B):アクティブな描画レイヤーにフリーハンドで描画;ツールオプション:カラー、ブラシサイズ、ブレンドモード;プロパティペインにABR画像ブラシ用のMASK EDITOR ONE (COLOR)セクションを常時表示 — ブラシが利用可能な場合は見出しが緑、未インポートの場合はグレー;ブラシが1つも無い間はSelectボタンが無効",
helpImageEdit6: "Text (T):キャンバス上をクリックしてテキスト入力オーバーレイを表示;ツールオプションバーでフォントファミリー・サイズ・太字/斜体・配置・カラーを設定;OKをクリックするとテキストの正確なサイズのテキストレイヤーとして配置;Selectツールで既存テキストレイヤーをダブルクリックすると再編集可能",
helpImageEdit7: "Shape (S):キャンバスに図形を描画;確定した図形は独立した描画レイヤーになる;ツールオプション:Shapeタイプ(Rect / Ellipse / Line / FreeLine)、Roundedチェック(Rect / Ellipseのみ)、Fillカラー + Noneトグル(Line / FreeLineでは非表示)、Strokeカラー + 幅 + Noneトグル(Line / FreeLineのNone非表示)、Opacityスライダー、↩ Undoボタン;ドラッグで形状プレビュー(青い破線)、離すと確定",
helpImageEditLayerTitle: "レイヤーパネル",
@@ -1765,12 +1778,13 @@ const LANGUAGES = {
helpImageEdit7b: "Blur (≈):アクティブレイヤーにガウスぼかしまたはモザイクを適用 — 全体またはドラッグで矩形範囲指定;詳細は下の「Blur Tool」カードを参照",
helpImageEdit7c: "BG Remove (⬚):Lightweight(@imgly、ブラウザ内処理)またはBiRefNet(Mask Editor One + ComfyUI/models/background_removal/にbirefnet.safetensors必須)でアクティブレイヤーの背景を除去;詳細は下の「BG Remove Tool」カードを参照",
helpImageEdit7d: "Mask (🎭):6つのサブツールでマスクレイヤーにマスクを描画 — Paint(フリーハンド)・Color(色類似度フラッドセレクト)・Alpha(画像の透過チャンネル抽出)・Text(テキストスタンプ)・Vector(Catmull-Romスプライン多角形)・Shape(矩形/楕円);Mask Editor OneインストールでSAM3テキストプロンプトセグメンテーションも利用可能;レイヤーヘッダーの「M」でマスクレイヤーを追加;詳細は下の「Mask Tool」カードを参照",
helpImageEdit7e: "Inpaint (🩹):表示中のレイヤーとマスクレイヤーを1枚のRGBA画像に合成(マスクをアルファチャンネルに焼き込み)し、GenerateUIで読み込み中のワークフロー内でインペイント対応の最初のLoadImageノード(MASK出力がVAEEncodeForInpaint等に接続されているノード)へ適用;プロパティパネルでポジ/ネガプロンプト、Grow Mask By(VAE Encode (for Inpainting)ノードへ反映)、Denoise(KSamplerへ反映)を入力してRunを押すと、Image Editタブに留まったままアップロード・生成を実行;完了後は結果画像がプロパティパネルに表示される;事前にマスクレイヤーの描画とインペイント対応ワークフローの読み込みが必要;LoadImageの代わりにMask Editor Oneカスタムノード(comfyui-mask-editor-one)を使ったワークフローにも対応(node_idキーのサーバーキャッシュとlayer_dataウィジェット経由で画像/マスクを反映);「Use dedicated workflow」チェックボックス:OFF時はGenerateUIで読み込み中のワークフローを使用(従来通り)、ON時はドロップダウンから保存済みワークフローを選択すると、GenerateUIの表示状態には触れずバックグラウンドで読み込み・編集・生成を実行",
helpImageEdit8b: "レイヤーヘッダーの「M」ボタン:アクティブレイヤーの上に新しいマスクレイヤーを追加し、自動的にMaskツールに切り替える",
helpImageEditMaskTitle: "Mask ツール (🎭)",
helpImageEditMask1: "マスクレイヤーの追加:レイヤーパネルヘッダーの「M」ボタンをクリック;新しいマスクレイヤーはアクティブレイヤーの上に挿入され、Maskツールが自動的に有効化される",
helpImageEditMask2: "レイヤーリストでマスクレイヤーをクリックすると自動的にMaskツールに切り替わる",
helpImageEditMask3: "ツールオプションバー — サブツール:Paint / Color / Alpha / Text / Vector / Shape(全てMask Editor One不要)/ SAM3(Mask Editor One必須・未インストール時は無効);Invertチェックボックスでオーバーレイプレビューを反転;Overlayカラーピッカーでプレビューカラーを変更(デフォルト赤);Blurスライダー(0〜50 px)でオーバーレイ輪郭をぼかす",
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)",
helpImageEditMask3: "ツールオプションバー — サブツール:Paint / Color / Alpha / Text / Vector / Shape(全てMask Editor One不要)/ SAM3(Mask Editor One必須・未インストール時は無効);Invertチェックボックスでオーバーレイプレビューを反転;Overlayカラーピッカーでプレビューカラーを変更(デフォルト赤);Blurスライダー(0〜50 px)でオーバーレイ輪郭をぼかす;オーバーレイは選択中(アクティブ)のマスクレイヤーのみ表示され、非アクティブなマスクは選択するまで非表示",
helpImageEditMask4: "プロパティペイン — Paintモード:Mode(Add / Erase)・Size(1〜200 px)・Hardness(0〜100%);MASK EDITOR ONEセクション(常時表示 — ABRブラシが利用可能な場合は見出しが緑、未インポートの場合はグレー):Selectボタンでブラシピッカーを開く(ブラシが1つも無い間は無効)(選択したブラシがデフォルト円形に代わる);✕で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)で現在のマスクレイヤーへの合成方法を制御;アクティブレイヤーがマスクでない場合は新規マスクレイヤーを自動作成",
@@ -2069,6 +2083,7 @@ const LANGUAGES = {
deleteConfirm: (name) => `确定删除 "${name}" 吗?`,
summaryGenerated: "摘要已生成",
summarizeError: "摘要错误",
summarizeOllamaOnly: "摘要功能仅支持 Ollama 后端,请在设置中切换后端。",
copied: "已复制",
// -- GenerateUI --
@@ -2163,6 +2178,7 @@ const LANGUAGES = {
batchItemFailed: (i, total, msg) => `[${i}/${total}] 失败: ${msg}`,
batchStopped: (completed, failed) => `批处理已停止 — 完成${completed}个,失败${failed}个`,
batchComplete: (completed, total, failed) => failed > 0 ? `批处理完成: ${completed}/${total}个 (${failed}个失败)` : `批处理完成: ${completed}/${total}个`,
batchLoraMissing: (count, total, sample) => `所选LoRA中有${count}/${total}个尚未被ComfyUI识别(例如:${sample})。请在ComfyUI中点击Refresh或重启服务器后再试。`,
connectedToComfyUI: "已连接到ComfyUI",
failedToConnect: "连接失败",
modelListsRefreshed: "模型列表已刷新",
@@ -2308,6 +2324,7 @@ const LANGUAGES = {
modelsGenUIUnsupported: "此模型类型无法在GenerateUI中设置",
modelsGenUINoWorkflow: "GenerateUI中未加载工作流",
modelsGenUINoNode: (type) => `当前工作流中未找到${type}节点`,
revertPromptTitle: "恢复到上次应用的提示词",
modelsCopyName: "点击复制模型名称",
modelsCopiedName: "模型名称已复制",
modelsFilePath: "文件路径",
@@ -2424,6 +2441,8 @@ const LANGUAGES = {
gallerySelectImageFirst: "请先选择图像",
galleryNoLoadImageNode: "当前工作流中没有LoadImage节点",
gallerySentGenUI: "已发送至GenerateUI图像标签",
galleryCCNotAvailable: "仅当从ComfyUI Comic Creator内的图库打开时才能使用Send CC",
gallerySentCC: "已发送至ComfyUI Comic Creator",
galleryNoEmbeddedWorkflow: "此图像中未嵌入ComfyUI工作流。",
galleryBulkSelected: "项已选择",
galleryBulkDeselectAll: "取消全选",
@@ -2568,7 +2587,7 @@ const LANGUAGES = {
helpGen1: "连接/断开ComfyUI,检查连接状态",
helpGen2: "从工作流标签页加载工作流(不支持App格式.app.json)。Reset Workflow按钮从磁盘重新读取当前工作流文件并重新加载编辑器。Save按钮(标签栏右端)将当前工作流(包括在编辑器中所做的编辑)保存为新的.json文件到工作流标签页;会显示以当前工作流名称为默认值的文件名对话框",
helpGen3: "5标签布局 — Input(提示词+图像)、Model、Settings、Feeder、Batch — Input/Model/Settings各含实时预览和直接编辑的Raw JSON列",
helpGen4: "Input标签:含Prompt和Image子标签(拖放上传);Prompt标签显示Positive Prompt、Negative Prompt,以及底部的Embeddings选择器(过滤+下拉+权重+Paste按钮)— Paste将(embedding:Name:weight)插入最后聚焦文本框的光标位置(未聚焦时默认追加到Positive)",
helpGen4: "Input标签:含Prompt和Image子标签(拖放上传);Prompt标签显示Positive Prompt、Negative Prompt,以及底部的Embeddings选择器(过滤+下拉+权重+Paste按钮)— Paste将(embedding:Name:weight)插入最后聚焦文本框的光标位置(未聚焦时默认追加到Positive);每个Apply按钮左侧的↺按钮可将文本框恢复为节点当前已应用的值;选中文字(或将光标置于单词/括号内也可)后按Ctrl+↑/↓,即可以(text:weight)语法以±0.05为单位调整强调权重(权重恢复为1.0时自动去除括号)",
helpGen5: "Model标签:Checkpoint/VAE/LoRA(Single/Stack标签)/ControlNet/Diffusion Model(支持UNETLoader / UnetLoaderGGUF / LoaderGGUF)/Text Encoder(支持CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — 含type和device选择器,DualCLIP显示两段模型选择)/Hypernetwork(带Strength输入)选择器(含筛选)",
helpGen6: "Settings标签:KSampler与Latent Image并排显示(各占50%宽度)",
helpGen7: "Raw JSON在每个标签右列常驻显示 — 直接编辑并Apply即时重载工作流",
@@ -2583,6 +2602,7 @@ const LANGUAGES = {
helpGen16: "SPA端通配符展开(A1111风格):当非ImpactWildcard系节点(如CLIPTextEncode)的提示词中含有__name__语法时,SPA在生成时从WFS通配符文件夹的对应文件中随机选取一行展开;嵌套通配符最多重复展开5次;未找到的通配符原样传递;ImpactWildcardEncode/Processor节点跳过(由ComfyUI服务端Impact Pack处理);单次生成和批量生成均有效",
helpGen17: "样式批处理:在左窗格Style标签中选择样式,启用批次队列Style列后点击Generate — 每个选中样式依次应用到正向和负向提示词;样式应用于工作流副本,不会修改已加载的工作流;每次页面加载时从 user/default/Workflow-Studio/style/*.json 重新读取样式文件",
helpGen18: "Alt+单击Apply按钮(Positive Prompt / Checkpoint / KSampler)可一步完成Apply & Generate — 将参数写入工作流后立即排队生成;仅当工作流中存在目标节点时才触发生成",
helpGen19: "Lora批处理:应用每个LoRA时,会自动将其语法(<lora:名称:strength_model:strength_clip>)和CivitAI触发词追加到Positive提示词 — 每次都基于原始提示词重新构建,不会累积;批处理完成或停止后提示词会自动恢复到批处理前的状态;若所选LoRA尚未被ComfyUI模型列表识别,会显示警告提示(需在ComfyUI中Refresh或重启)",
helpFeederTitle: "GenerateUI Tab — Feeder 子标签",
helpFeederDesc: "通过左侧面板顶部的 [图片循环] / [图库] 切换按钮可在两种模式间切换。",
helpFeederImgloopTitle: "图片循环模式",
@@ -2705,10 +2725,10 @@ const LANGUAGES = {
helpImageEditTitle: "图像编辑选项卡",
helpImageEdit1: "基于图层的图像编辑器 — 通过多个图层(图像、文字、绘制、遮罩类型)合成图像并导出",
helpImageEdit2: "加载图像:拖放到画布、点击Upload按钮、或通过Gallery标签工具栏的Image Edit按钮发送;第一张图像成为图层1(自动锁定);后续图像缩放至画布大小作为新图层添加",
helpImageEdit3: "New按钮:创建空白画布 — 输入宽高(如512x768);清除所有现有图层",
helpImageEdit3: "New按钮:创建空白画布 — 输入宽高(如512x768);清除所有现有图层并自动添加空白Layer 1",
helpImageEditToolsTitle: "工具",
helpImageEdit4: "Select (V):点击选择图层;拖动移动;拖动角点手柄调整大小;拖动顶边圆形手柄旋转;双击文字图层可重新编辑;工具选项栏显示翻转H / 翻转V / 旋转角度",
helpImageEdit5: "Draw (B):在当前绘制图层上自由绘画;工具选项:颜色、笔刷大小、混合模式",
helpImageEdit5: "Draw (B):在当前绘制图层上自由绘画;工具选项:颜色、笔刷大小、混合模式;属性面板包含用于ABR图像笔刷的MASK EDITOR ONE (COLOR)区域 — 始终显示,笔刷可用时标题为绿色,未导入笔刷时为灰色;没有任何笔刷时Select按钮为禁用状态",
helpImageEdit6: "Text (T):点击画布放置文字输入框;在工具选项栏设置字体、大小、粗体/斜体、对齐方式、颜色;点击OK后以精确文字边界框大小创建文字图层;用Select工具双击现有文字图层可重新编辑",
helpImageEdit7: "Shape (S):在画布上绘制几何图形;每个确认的图形成为独立的绘制图层;工具选项:图形类型(Rect / Ellipse / Line / FreeLine)、圆角复选框(仅Rect/Ellipse)、填充颜色+None切换(Line/FreeLine隐藏)、描边颜色+宽度+None切换(Line/FreeLine的None隐藏,始终有描边)、不透明度滑块、↩撤销按钮;拖动预览(蓝色虚线),释放确认",
helpImageEditLayerTitle: "图层面板",
@@ -2741,12 +2761,13 @@ const LANGUAGES = {
helpImageEdit7b: "Blur (≈):对活动图层应用高斯模糊或马赛克 — 整层或拖动矩形区域;详细内容参见下方「Blur Tool」卡片",
helpImageEdit7c: "BG Remove (⬚):使用Lightweight(@imgly,在浏览器中运行)或BiRefNet(需要Mask Editor One + ComfyUI/models/background_removal/中的birefnet.safetensors)去除活动图层背景;详细内容参见下方「BG Remove Tool」卡片",
helpImageEdit7d: "Mask (🎭):使用6种子工具在遮罩图层上绘制遮罩 — Paint(徒手绘制)、Color(按颜色相似度泛选)、Alpha(从图像透明度提取)、Text(文字图章)、Vector(Catmull-Rom样条多边形)、Shape(矩形/椭圆);安装Mask Editor One后还可使用SAM3文本提示分割;点击图层标题栏的「M」添加遮罩图层;详细内容参见下方「Mask Tool」卡片",
helpImageEdit7e: "Inpaint (🩹):将可见图层与遮罩图层合成为一张RGBA图像(遮罩烘焙进alpha通道),并应用到GenerateUI当前加载的工作流中第一个支持内绘的LoadImage节点(其MASK输出连接到VAEEncodeForInpaint等节点);在属性面板中输入正/负向提示词、Grow Mask By(应用到VAE Encode (for Inpainting)节点)、Denoise(应用到KSampler)后点击Run,即可在不离开Image Edit标签的情况下完成上传与生成;完成后结果图像会显示在属性面板中;需先绘制遮罩图层并在GenerateUI中加载支持内绘的工作流;同样支持基于Mask Editor One自定义节点(comfyui-mask-editor-one)而非LoadImage构建的工作流(通过其按node_id缓存的服务端图像与layer_data组件写入图像/遮罩);「Use dedicated workflow」复选框:关闭时使用GenerateUI当前加载的工作流(与之前相同);开启时可从下拉列表选择已保存的工作流,将在后台加载、编辑并生成,不影响GenerateUI中显示的工作流",
helpImageEdit8b: "图层标题栏的「M」按钮:在当前活动图层上方添加新的遮罩图层,并自动切换至Mask工具",
helpImageEditMaskTitle: "Mask 工具 (🎭)",
helpImageEditMask1: "添加遮罩图层:点击图层面板标题栏的「M」按钮;新遮罩图层插入到活动图层上方,Mask工具自动激活",
helpImageEditMask2: "在图层列表中点击遮罩图层会自动切换至Mask工具",
helpImageEditMask3: "顶部工具栏 — 子工具:Paint / Color / Alpha / Text / Vector / Shape(均无需Mask Editor One)/ SAM3(需要Mask Editor One,未安装时不可用);Invert复选框反转叠加预览;Overlay拾色器更改预览颜色(默认红色);Blur滑块(0–50 px)柔化叠加边缘",
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)",
helpImageEditMask3: "顶部工具栏 — 子工具:Paint / Color / Alpha / Text / Vector / Shape(均无需Mask Editor One)/ SAM3(需要Mask Editor One,未安装时不可用);Invert复选框反转叠加预览;Overlay拾色器更改预览颜色(默认红色);Blur滑块(0–50 px)柔化叠加边缘;叠加显示仅在当前激活的蒙版图层上显示,未激活的蒙版图层在被选中前保持隐藏",
helpImageEditMask4: "属性面板 — Paint模式:Mode(Add / Erase)、Size(1–200 px)、Hardness(0–100%);MASK EDITOR ONE区域(始终显示 — 有可用的ABR笔刷时标题为绿色,尚未导入笔刷时为灰色):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)控制蒙版与当前遮罩图层的合并方式;若活动图层非遮罩图层则自动创建新遮罩图层",
+238 -10
View File
@@ -12,6 +12,9 @@ import { ShapeTool } from "./image-edit/ShapeTool.js";
import { MaskTool } from "./image-edit/MaskTool.js";
import { MaskColorTool, MaskAlphaTool, MaskTextTool, MaskVectorTool, MaskShapeTool, MASK_TEXT_FONTS } from "./image-edit/MaskEditorOneTools.js";
import { showToast } from "./app.js";
import { comfyUI } from "./comfyui-client.js";
import { comfyEditor } from "./comfyui-editor.js";
import { comfyWorkflow } from "./comfyui-workflow.js";
const TOOL_DEFS = [
{ id: "select", icon: "▲", label: "Select", ready: true },
@@ -22,6 +25,7 @@ const TOOL_DEFS = [
{ id: "blur", icon: "≈", label: "Blur", ready: true },
{ id: "filter", icon: "★", label: "Filter", ready: true },
{ id: "bgremove", icon: "⬚", label: "BG Remove", ready: true },
{ id: "inpaint", icon: "🩹", label: "Inpaint", ready: true },
];
const UNDO_LIMIT = 20;
@@ -107,6 +111,17 @@ class ImageEditTab {
// ABR brush (Mask Editor One) — optional feature
this._abrAvailable = false;
this._abrBrushTree = [];
// Inpaint ツール
this._inpaintPositive = "";
this._inpaintNegative = "";
this._inpaintGrowMaskBy = null; // null = 未初期化(ワークフローの現在値から初期化)
this._inpaintDenoise = null; // null = 未初期化(ワークフローの現在値から初期化)
this._inpaintRunning = false;
this._inpaintResultUrl = null;
// Inpaint 専用ワークフロー(OFF時は GenerateUI で読み込み中のワークフローを使用)
this._inpaintUseDedicated = false;
this._inpaintDedicatedFilename = null;
this._inpaintWorkflowList = [];
}
// ── 初期化 ────────────────────────────────────
@@ -124,6 +139,20 @@ class ImageEditTab {
this._checkBiRefNetAvailability();
this._checkSam3Availability();
this._checkAbrAvailability();
// Inpaint「専用ワークフロー」選択肢のため、保存済みワークフロー一覧を取得
this._fetchInpaintWorkflowList();
}
async _fetchInpaintWorkflowList() {
try {
const resp = await fetch(`${comfyUI.baseUrl}/api/wfm/workflows`);
if (!resp.ok) return;
const list = await resp.json();
this._inpaintWorkflowList = (list || []).map((w) => w.filename).filter(Boolean);
if (this._activeTool === "inpaint") this._renderInpaintProps();
} catch {
this._inpaintWorkflowList = [];
}
}
async _checkBiRefNetAvailability() {
@@ -243,8 +272,8 @@ class ImageEditTab {
overlay.getContext("2d").clearRect(0, 0, overlay.width, overlay.height);
}
}
// Draw/Mask以外に切り替えたらプロパティペインを非表示
if (toolId !== "mask" && toolId !== "draw") {
// Draw/Mask/Inpaint以外に切り替えたらプロパティペインを非表示
if (toolId !== "mask" && toolId !== "draw" && toolId !== "inpaint") {
const pane = document.getElementById("ie-props-pane");
if (pane) pane.style.display = "none";
}
@@ -689,6 +718,10 @@ class ImageEditTab {
document.getElementById("ie-gmic-open-btn")?.addEventListener("click", () => this._gmicOpenGui());
document.getElementById("ie-gmic-apply-btn")?.addEventListener("click", () => this._gmicApplyResult());
document.getElementById("ie-gmic-abort-btn")?.addEventListener("click", () => this._gmicAbort());
} else if (toolId === "inpaint") {
el.innerHTML = "";
this._renderInpaintProps();
} else {
const def = TOOL_DEFS.find(d => d.id === toolId);
el.innerHTML = `<span style="font-size:12px;color:var(--wfm-text-secondary);">${def?.label ?? toolId}: coming soon</span>`;
@@ -724,15 +757,15 @@ class ImageEditTab {
${t.brushImage ? "disabled title='Hardness applies to circle brush only'" : ""}>
<span id="ie-mask-hard-lbl">${Math.round(t.hardness * 100)}%</span>
</div>
${this._abrAvailable ? `
<div style="margin:6px 0 4px;border-top:1px solid var(--wfm-border);padding-top:6px;font-size:10px;color:var(--wfm-text-secondary);letter-spacing:0.05em;">
<div style="margin:6px 0 4px;border-top:1px solid var(--wfm-border);padding-top:6px;font-size:10px;color:${this._abrAvailable ? "var(--wfm-success)" : "var(--wfm-text-secondary)"};letter-spacing:0.05em;"
title="${this._abrAvailable ? "Mask Editor One: brushes available" : "Mask Editor One: no brushes imported yet"}">
MASK EDITOR ONE
</div>
<div class="ie-props-row">
<label>Brush</label>
<span style="font-size:11px;color:var(--wfm-text-secondary);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"
title="${t.brushName ?? "Circle"}">${t.brushName ?? "Circle"}</span>
<button class="wfm-btn wfm-btn-sm" id="ie-mask-select-brush" style="font-size:10px;padding:1px 6px;flex-shrink:0;">Select</button>
<button class="wfm-btn wfm-btn-sm" id="ie-mask-select-brush" style="font-size:10px;padding:1px 6px;flex-shrink:0;" ${this._abrAvailable ? "" : "disabled"}>Select</button>
${t.brushImage ? `<button class="wfm-btn wfm-btn-sm" id="ie-mask-clear-brush" style="font-size:10px;padding:1px 5px;flex-shrink:0;">✕</button>` : ""}
</div>
${t.brushImage ? `
@@ -756,7 +789,7 @@ class ImageEditTab {
<label style="cursor:pointer;font-size:11px;">
<input type="checkbox" id="ie-mask-rotjitter" ${t.rotationJitter ? "checked" : ""}> On
</label>
</div>` : ""}` : ""}
</div>` : ""}
`;
document.getElementById("ie-mask-mode-add")?.addEventListener("click", () => {
this._maskTool.mode = "paint";
@@ -1054,15 +1087,15 @@ class ImageEditTab {
<input type="range" id="ie-draw-opacity" min="1" max="100" value="${Math.round(t.opacity * 100)}">
<span id="ie-draw-opacity-lbl">${Math.round(t.opacity * 100)}%</span>
</div>
${this._abrAvailable ? `
<div style="margin:6px 0 4px;border-top:1px solid var(--wfm-border);padding-top:6px;font-size:10px;color:var(--wfm-text-secondary);letter-spacing:0.05em;">
<div style="margin:6px 0 4px;border-top:1px solid var(--wfm-border);padding-top:6px;font-size:10px;color:${this._abrAvailable ? "var(--wfm-success)" : "var(--wfm-text-secondary)"};letter-spacing:0.05em;"
title="${this._abrAvailable ? "Mask Editor One: brushes available" : "Mask Editor One: no brushes imported yet"}">
MASK EDITOR ONE (COLOR)
</div>
<div class="ie-props-row">
<label>Brush</label>
<span style="font-size:11px;color:var(--wfm-text-secondary);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"
title="${t.brushName ?? "Circle"}">${t.brushName ?? "Circle"}</span>
<button class="wfm-btn wfm-btn-sm" id="ie-draw-select-brush" style="font-size:10px;padding:1px 6px;flex-shrink:0;">Select</button>
<button class="wfm-btn wfm-btn-sm" id="ie-draw-select-brush" style="font-size:10px;padding:1px 6px;flex-shrink:0;" ${this._abrAvailable ? "" : "disabled"}>Select</button>
${t.brushImage ? `<button class="wfm-btn wfm-btn-sm" id="ie-draw-clear-brush" style="font-size:10px;padding:1px 5px;flex-shrink:0;">✕</button>` : ""}
</div>
${t.brushImage ? `
@@ -1086,7 +1119,7 @@ class ImageEditTab {
<label style="cursor:pointer;font-size:11px;">
<input type="checkbox" id="ie-draw-rotjitter" ${t.rotationJitter ? "checked" : ""}> On
</label>
</div>` : ""}` : ""}
</div>` : ""}
`;
document.getElementById("ie-draw-mode-draw")?.addEventListener("click", () => {
@@ -1230,7 +1263,198 @@ class ImageEditTab {
return canvas;
}
// ── Inpaint ツール ─────────────────────────────
// マスクレイヤー(透過背景+白ペイント)を黒背景に合成し、白=インペイント対象/黒=維持の
// 不透明なグレースケールPNGとして書き出す(LayerのgetThumbnailDataURLと同じ規約)。
_exportMaskCanvas(maskLayer) {
const w = maskLayer.canvas.width, h = maskLayer.canvas.height;
const canvas = document.createElement("canvas");
canvas.width = w; canvas.height = h;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "#000";
ctx.fillRect(0, 0, w, h);
ctx.drawImage(maskLayer.canvas, 0, 0);
return canvas;
}
_renderInpaintProps() {
const pane = document.getElementById("ie-props-pane");
const body = document.getElementById("ie-props-body");
const title = document.getElementById("ie-props-title");
if (!pane || !body) return;
pane.style.display = "flex";
if (title) title.textContent = "Inpaint";
// 未初期化ならワークフローの現在値から初期化(VAEEncodeForInpaint.grow_mask_by / KSampler.denoise)
if (this._inpaintGrowMaskBy == null) {
this._inpaintGrowMaskBy = comfyUI.currentAnalysis?.inpaint_encode_nodes?.[0]?.grow_mask_by ?? 6;
}
if (this._inpaintDenoise == null) {
const samplerNode = (comfyUI.currentAnalysis?.sampler_nodes || []).find((n) => n.denoise !== undefined);
this._inpaintDenoise = samplerNode?.denoise ?? 1.0;
}
body.innerHTML = `
<div class="ie-props-row">
<label style="display:flex;align-items:center;gap:6px;cursor:pointer;">
<input type="checkbox" id="ie-inpaint-use-dedicated" ${this._inpaintUseDedicated ? "checked" : ""}>
Use dedicated workflow
</label>
</div>
<div class="ie-props-row" id="ie-inpaint-dedicated-row" style="${this._inpaintUseDedicated ? "" : "display:none;"}">
<select id="ie-inpaint-dedicated-select" style="flex:1;">
<option value="">-- select workflow --</option>
${this._inpaintWorkflowList.map((f) => `<option value="${f}" ${f === this._inpaintDedicatedFilename ? "selected" : ""}>${f}</option>`).join("")}
</select>
</div>
<div class="ie-props-row" style="flex-direction:column;align-items:stretch;">
<label>Positive Prompt</label>
<textarea id="ie-inpaint-positive" rows="3" style="width:100%;resize:vertical;font-size:12px;">${this._inpaintPositive}</textarea>
</div>
<div class="ie-props-row" style="flex-direction:column;align-items:stretch;">
<label>Negative Prompt</label>
<textarea id="ie-inpaint-negative" rows="3" style="width:100%;resize:vertical;font-size:12px;">${this._inpaintNegative}</textarea>
</div>
<div class="ie-props-row">
<label>Grow Mask By</label>
<input type="number" id="ie-inpaint-grow-mask" min="0" max="200" step="1" value="${this._inpaintGrowMaskBy}" style="width:60px;">
</div>
<div class="ie-props-row">
<label>Denoise</label>
<input type="number" id="ie-inpaint-denoise" min="0" max="1" step="0.01" value="${this._inpaintDenoise}" style="width:60px;">
</div>
<div class="ie-props-row">
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="ie-inpaint-run-btn" style="flex:1;" ${this._inpaintRunning ? "disabled" : ""}>
${this._inpaintRunning ? "Running..." : "Run"}
</button>
</div>
<span id="ie-inpaint-status" style="font-size:11px;color:var(--wfm-text-secondary);"></span>
${this._inpaintResultUrl ? `
<div class="ie-props-row" style="flex-direction:column;align-items:stretch;">
<label>Result</label>
<img src="${this._inpaintResultUrl}" style="max-width:100%;border-radius:var(--wfm-radius-sm);border:1px solid var(--wfm-border);">
</div>
` : ""}
`;
document.getElementById("ie-inpaint-use-dedicated")?.addEventListener("change", e => {
this._inpaintUseDedicated = e.target.checked;
this._renderInpaintProps();
});
document.getElementById("ie-inpaint-dedicated-select")?.addEventListener("change", e => {
this._inpaintDedicatedFilename = e.target.value || null;
});
document.getElementById("ie-inpaint-positive")?.addEventListener("input", e => { this._inpaintPositive = e.target.value; });
document.getElementById("ie-inpaint-negative")?.addEventListener("input", e => { this._inpaintNegative = e.target.value; });
document.getElementById("ie-inpaint-grow-mask")?.addEventListener("input", e => {
this._inpaintGrowMaskBy = parseInt(e.target.value) || 0;
});
document.getElementById("ie-inpaint-denoise")?.addEventListener("input", e => {
this._inpaintDenoise = Math.max(0, Math.min(1, parseFloat(e.target.value)));
if (Number.isNaN(this._inpaintDenoise)) this._inpaintDenoise = 1.0;
});
document.getElementById("ie-inpaint-run-btn")?.addEventListener("click", () => this._runInpaint());
}
async _runInpaint() {
if (this._inpaintRunning) return;
if (!this._layerMgr) { showToast("No image loaded", "error"); return; }
const maskLayer = (this._layerMgr.activeLayer?.type === "mask")
? this._layerMgr.activeLayer
: this._layerMgr.layers.find(l => l.type === "mask");
if (!maskLayer) { showToast("Create a mask layer first (Mask tool)", "info"); return; }
if (this._inpaintUseDedicated) {
if (!this._inpaintDedicatedFilename) { showToast("Select a dedicated workflow first", "info"); return; }
} else if (!comfyUI.currentAnalysis) {
showToast("Load a workflow in GenerateUI first", "info");
return;
}
const runBtn = document.getElementById("ie-inpaint-run-btn");
const statusEl = document.getElementById("ie-inpaint-status");
const setStatus = (msg) => { if (statusEl) statusEl.textContent = msg; };
this._inpaintRunning = true;
if (runBtn) { runBtn.disabled = true; runBtn.textContent = "Running..."; }
setStatus(this._inpaintUseDedicated ? "Loading dedicated workflow..." : "Compositing...");
try {
// 専用ワークフロー使用時は GenerateUI の comfyUI.currentWorkflow/currentAnalysis には
// 一切触れず、ここでロード・解析したローカルなワークフロー/解析結果だけを使う。
let targetWorkflow = null;
let targetAnalysis = null;
if (this._inpaintUseDedicated) {
const resp = await fetch(`${comfyUI.baseUrl}/api/wfm/workflows/raw?filename=${encodeURIComponent(this._inpaintDedicatedFilename)}`);
if (!resp.ok) throw new Error(`Failed to load workflow (HTTP ${resp.status})`);
let dedicatedWorkflow = await resp.json();
const format = comfyWorkflow.detectFormat(dedicatedWorkflow, this._inpaintDedicatedFilename);
if (format === "ui") {
dedicatedWorkflow = await comfyWorkflow.convertUiToApi(dedicatedWorkflow);
} else if (format !== "api") {
throw new Error("Unsupported or unrecognized workflow format");
}
targetWorkflow = dedicatedWorkflow;
targetAnalysis = comfyWorkflow.analyzeWorkflow(dedicatedWorkflow);
}
// LoadImage(の MASK 出力が使われている)スロットを優先し、無ければ Mask Editor One
// ノード(LoadImage を介さず画像/マスクを内包する custom node)にフォールバックする
const analysisForLookup = targetAnalysis || comfyUI.currentAnalysis;
const slotIndex = (analysisForLookup.load_image_nodes || []).findIndex(n => n.mask_used);
const meoNode = (analysisForLookup.mask_editor_one_nodes || [])[0];
if (slotIndex === -1 && !meoNode) {
throw new Error("No inpaint-capable LoadImage or Mask Editor One node found in the workflow");
}
setStatus("Compositing...");
const bgCanvas = this._buildBgCanvas();
const imageBlob = await new Promise((resolve) => bgCanvas.toBlob(resolve, "image/png"));
const maskCanvas = this._exportMaskCanvas(maskLayer);
const maskBlob = await new Promise((resolve) => maskCanvas.toBlob(resolve, "image/png"));
const overrideOpts = targetWorkflow ? { workflow: targetWorkflow, analysis: targetAnalysis } : {};
setStatus("Uploading...");
if (slotIndex !== -1) {
await comfyEditor.applyImageAndMaskToSlot(imageBlob, maskBlob, slotIndex, overrideOpts);
} else {
await comfyEditor.applyImageAndMaskToMaskEditorOneNode(imageBlob, maskBlob, meoNode.id, overrideOpts);
}
comfyEditor.setPromptText("positive", this._inpaintPositive, overrideOpts);
comfyEditor.setPromptText("negative", this._inpaintNegative, overrideOpts);
comfyEditor.setInpaintParams({
growMaskBy: this._inpaintGrowMaskBy,
denoise: this._inpaintDenoise,
...overrideOpts,
});
if (!window._wfmGenerateTab?.generate) throw new Error("GenerateUI is not ready yet");
setStatus("Generating...");
await window._wfmGenerateTab.generate(targetWorkflow || undefined);
const resultImg = document.getElementById("wfm-gen-result-img");
if (resultImg?.src) this._inpaintResultUrl = resultImg.src;
setStatus("Done");
showToast("Inpaint generation complete", "success");
} catch (err) {
setStatus("Error");
showToast(`Inpaint failed: ${err.message}`, "error");
} finally {
this._inpaintRunning = false;
this._renderInpaintProps();
}
}
_renderMaskLayerOverlay(ctx, maskLayer) {
// アクティブなマスクレイヤーのみオーバーレイ表示(非アクティブなマスクは隠す)
if (this._layerMgr?.activeLayer !== maskLayer) return;
const overlayColor = this._maskOverlayColor;
const blurPx = this._maskBlur;
const inverted = this._maskInverted;
@@ -1588,9 +1812,12 @@ class ImageEditTab {
this._canvasH = h;
this._baseName = "new-canvas";
this._initCanvases();
const layer1 = this._layerMgr.addLayer("draw", "Layer 1");
this._layerMgr.setActive(layer1.id);
this._undoStack = [];
this._redoStack = [];
this._setActiveTool("select");
this._selectTool?.setLayer(layer1);
this._refreshLayerList();
this._updateCompositeView();
this._fitToView();
@@ -2066,6 +2293,7 @@ class ImageEditTab {
this._updateCompositeView();
} else if (this._activeTool === "select" && layer) {
this._selectTool?.setLayer(layer);
this._updateCompositeView();
} else {
this._updateCompositeView();
}
+7 -1
View File
@@ -130,7 +130,7 @@ function applyToGenUI(modelName, modelType) {
};
comfyUI.currentWorkflow[nodeId].inputs.text = `<lora:${stem}:1:1>`;
} else {
comfyUI.currentWorkflow[nodeId].inputs.lora_name = modelName;
comfyUI.currentWorkflow[nodeId].inputs.lora_name = comfyEditor.resolveLoraName(modelName);
}
// Disable all Stack models and switch to Single tab
@@ -1386,6 +1386,7 @@ function openDetailModal(modelName) {
? `<button class="wfm-btn wfm-btn-sm" id="wfm-modal-genui-model" title="${t("modelsGenUITitle")}">${t("modelsGenUIBtn")}</button>`
: "")}
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-modal-model-delete" style="margin-left:auto;">${t("modelsDelete")}</button>
<button class="wfm-btn wfm-btn-sm" id="wfm-modal-model-close">${t("close")}</button>
</div>
</div>
</div>`;
@@ -1446,6 +1447,11 @@ function openDetailModal(modelName) {
applyEmbeddingToPrompt(modelName, "negative");
});
// Close button (連続作業時にXボタンまでマウス移動しなくて済むように)
document.getElementById("wfm-modal-model-close")?.addEventListener("click", () => {
closeModal();
});
// Delete model button
document.getElementById("wfm-modal-model-delete")?.addEventListener("click", async () => {
const confirmMsg = t("modelBulkDeleteConfirm").replace("{count}", "1");
+9 -1
View File
@@ -1129,10 +1129,18 @@ function openDetailModal(wf) {
try {
const wfJson = await getRawWorkflow(wf.filename);
const promptText = getSummaryPrompt() + JSON.stringify(wfJson).substring(0, 4000);
const aiCfg = readJsonStorage("wfm_prompt_ai_settings", {});
if (aiCfg.backend && aiCfg.backend !== "ollama") {
throw new Error(t("summarizeOllamaOnly"));
}
const chatRes = await fetch("/api/wfm/ollama/chat", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ messages: [{ role: "user", content: promptText }] }),
body: JSON.stringify({
url: aiCfg.backendUrl || undefined,
model: aiCfg.model || undefined,
messages: [{ role: "user", content: promptText }],
}),
});
const chatData = await chatRes.json();
if (chatData.error) throw new Error(chatData.error);
+9 -5
View File
@@ -1088,7 +1088,7 @@
<li id="wfm-help-gen-1">Connect/disconnect ComfyUI and check connection status</li>
<li id="wfm-help-gen-2">Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor; <b>Save</b> button (right end of the tab bar) saves the current workflow — including any edits made in the editor — as a new .json file to the Workflow tab; a filename dialog appears with the current workflow name as the default; <b>Style</b> checkbox and dropdown (next to Reset Workflow): enable to apply a Fooocus-style JSON style to the positive and negative prompts at generation time — style files are loaded from <code>user/default/Workflow-Studio/style/*.json</code>; the style's <code>{prompt}</code> placeholder is replaced with the original prompt, or the style text is appended if no placeholder exists</li>
<li id="wfm-help-gen-3">5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
<li id="wfm-help-gen-4">Input tab: inner tabs — <b>Prompt</b> and <b>Image</b> (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an <b>Embeddings</b> selector at the bottom — select a model, set Weight (default 1.0), then click <b>Paste</b> to insert <code>(embedding:Name:weight)</code> at the cursor position of the last focused textarea (defaults to Positive if neither is focused)</li>
<li id="wfm-help-gen-4">Input tab: inner tabs — <b>Prompt</b> and <b>Image</b> (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an <b>Embeddings</b> selector at the bottom — select a model, set Weight (default 1.0), then click <b>Paste</b> to insert <code>(embedding:Name:weight)</code> at the cursor position of the last focused textarea (defaults to Positive if neither is focused); a <b>↺</b> button next to each Apply button reverts the textarea to the node's currently applied value; select text (or just place the cursor on a word/parenthesis block) and press <b>Ctrl+↑/↓</b> to adjust its emphasis weight in <code>(text:weight)</code> syntax by ±0.05 — the parentheses are removed automatically when the weight returns to 1.0</li>
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, LoRA (Single/Stack tabs), ControlNet, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors), Hypernetwork (with Strength field) selectors with filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones</li>
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
<li id="wfm-help-gen-7">Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow</li>
@@ -1103,6 +1103,7 @@
<li id="wfm-help-gen-17">Style batch: select styles in the left pane Style tab, enable the Style column in Batch Queue, then Generate — each selected style is applied in sequence to the positive and negative prompts; styles are applied to workflow copies so the loaded workflow is not modified; style files are re-read each time the page loads from <code>user/default/Workflow-Studio/style/*.json</code></li>
<li id="wfm-help-gen-16">SPA-side wildcard expansion (A1111-style): when prompt text in non-ImpactWildcard nodes (e.g. CLIPTextEncode) contains __name__ syntax, the SPA expands it at generation time by randomly picking a line from the matching file in the WFS wildcard folder; nested wildcards are re-expanded up to 5 passes; unresolved wildcards are passed through unchanged; ImpactWildcardEncode/Processor nodes are skipped (handled server-side by Impact Pack); works in both single and batch generation</li>
<li id="wfm-help-gen-18">Alt+Click any Apply button (Positive Prompt / Checkpoint / KSampler) to Apply &amp; Generate in one step — applies the parameter to the workflow then immediately queues a generation; only fires when the target node exists in the loaded workflow</li>
<li id="wfm-help-gen-19">Lora batch: for each LoRA, its syntax (&lt;lora:name:strength_model:strength_clip&gt;) and CivitAI trained words are automatically appended to the Positive prompt — rebuilt from the original prompt each time, not accumulated; the prompt is automatically restored to its pre-batch state when the batch completes or is stopped; if a selected LoRA is not yet recognized by ComfyUI's model list, a warning toast is shown (Refresh or restart ComfyUI)</li>
</ul>
</div>
</div>
@@ -1313,19 +1314,20 @@
<ul>
<li id="wfm-help-imageedit-1">Layer-based image editor — compose images with multiple layers (Image, Text, Draw, Mask types) and export the composite</li>
<li id="wfm-help-imageedit-2">Loading images: drag &amp; drop onto the canvas, Upload button, or send from the Gallery tab via the Image Edit button in the Gallery toolbar; the first image becomes Layer 1 (auto-locked); subsequent images are added as new layers scaled to fit the canvas</li>
<li id="wfm-help-imageedit-3">New button: create a blank canvas — prompts for WxH size (e.g. 512x768); clears all existing layers</li>
<li id="wfm-help-imageedit-3">New button: create a blank canvas — prompts for WxH size (e.g. 512x768); clears all existing layers and automatically adds an empty Layer 1</li>
</ul>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-imageedit-tools-title">Tools</h3>
<ul>
<li id="wfm-help-imageedit-4">Select (V): click to select a layer; drag to move; drag corner handles to resize; drag the circle above the top edge to rotate; double-click a text layer to re-edit its content; Tool Options bar shows Flip H / Flip V / Rotate field</li>
<li id="wfm-help-imageedit-5">Draw (B): freehand brush drawing onto the active draw layer; Tool Options: color, brush size, blend mode</li>
<li id="wfm-help-imageedit-5">Draw (B): freehand brush drawing onto the active draw layer; Tool Options: color, brush size, blend mode; Properties pane includes a MASK EDITOR ONE (COLOR) section for ABR image brushes — always visible, header text is green when brushes are available, gray when none are imported yet; Select is disabled until at least one brush exists</li>
<li id="wfm-help-imageedit-6">Text (T): click on the canvas to place a text input overlay; configure font family, size, bold/italic, align, color in the Tool Options bar; click OK to place the text as an exact-size Text layer; double-click an existing text layer with the Select tool to re-edit</li>
<li id="wfm-help-imageedit-7">Shape (S): draw geometric shapes onto the canvas; each committed shape becomes an independent draw layer; Tool Options: Shape type (Rect / Ellipse / Line / FreeLine), Rounded checkbox (Rect / Ellipse only), Fill color + None toggle (hidden for Line / FreeLine), Stroke color + width + None toggle (None hidden for Line / FreeLine where stroke is always active), Opacity slider, ↩ Undo button; drag to draw — a blue dashed outline previews the shape; release to commit</li>
<li id="wfm-help-imageedit-7b">Blur (≈): apply Gaussian blur or mosaic to the active layer — whole-layer or region-based (drag a rectangle); see the Blur Tool card below for details</li>
<li id="wfm-help-imageedit-7c">BG Remove (⬚): remove the background from the active layer using Lightweight (@imgly, runs in browser) or BiRefNet (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 masks on a mask layer using 6 sub-tools — Paint (freehand), Color (flood-select by similar color), Alpha (extract from image transparency), Text (stamp text), Vector (Catmull-Rom spline polygon), Shape (rect / ellipse); SAM3 text-prompt segmentation is also available when Mask Editor One is installed; click "M" in the Layers header to add a mask layer; see the Mask Tool card below for details</li>
<li id="wfm-help-imageedit-7e">Inpaint (🩹): composites the visible layers plus a Mask layer into one RGBA image (mask baked into the alpha channel) and applies it to the first inpaint-capable LoadImage node in the workflow currently loaded in GenerateUI (a node whose MASK output feeds something like VAEEncodeForInpaint); enter Positive/Negative prompts, Grow Mask By (applied to the VAE Encode (for Inpainting) node), and Denoise (applied to KSampler) in the properties panel, then click Run to upload and generate without leaving the Image Edit tab — the result is shown back in the properties panel when done; requires a Mask layer to be painted first and an inpaint-capable workflow loaded in GenerateUI; also works with workflows built around the Mask Editor One custom node (comfyui-mask-editor-one) instead of LoadImage — image/mask are pushed to it via its node_id-keyed server cache and layer_data widget; "Use dedicated workflow" checkbox: when off, the workflow currently loaded in GenerateUI is used (unchanged); when on, pick a saved workflow from the dropdown — it is loaded, edited, and generated entirely in the background without disturbing the workflow shown in GenerateUI</li>
</ul>
</div>
<div class="wfm-help-card">
@@ -1366,8 +1368,8 @@
<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 — sub-tools: Paint / Color / Alpha / Text / Vector / Shape (all work without Mask Editor One) / SAM3 (requires Mask Editor One, disabled if not installed); Invert checkbox inverts the overlay preview; 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 — 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-3">Tool Options bar — sub-tools: Paint / Color / Alpha / Text / Vector / Shape (all work without Mask Editor One) / SAM3 (requires Mask Editor One, disabled if not installed); Invert checkbox inverts the overlay preview; Overlay color picker changes the preview color (default red); Blur slider (0–50 px) softens the overlay edge; the overlay is only shown for the currently active mask layer — inactive mask layers stay hidden until selected</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 (always visible — header text is green when ABR brushes are available, gray when none are imported yet): Select button opens the ABR brush library (disabled until at least one brush exists) — 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>
@@ -1543,6 +1545,7 @@
<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-send-cc-btn" class="wfm-btn wfm-btn-sm" title="Send selected image to ComfyUI Comic Creator's selected panel" style="display:none;">Send CC</button>
<button id="wfm-gallery-clear-filters-btn" class="wfm-btn wfm-btn-sm" title="Clear all filters"></button>
</div>
<!-- 複数選択時の一括操作バー -->
@@ -1668,6 +1671,7 @@
<button class="ie-tool-btn" data-tool="blur" title="Blur">≈</button>
<button class="ie-tool-btn" data-tool="filter" title="Filter">★</button>
<button class="ie-tool-btn" data-tool="bgremove" title="BG Remove">⬚</button>
<button class="ie-tool-btn" data-tool="inpaint" title="Inpaint">🩹</button>
</div>
<!-- Center -->
+665
View File
@@ -0,0 +1,665 @@
{
"id": "6d392e45-b20b-4dee-a422-0b4a18e645cd",
"revision": 0,
"last_node_id": 35,
"last_link_id": 102,
"nodes": [
{
"id": 8,
"type": "VAEDecode",
"pos": [
1351.4570000000006,
197.9979999999999
],
"size": [
210,
46
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"localized_name": "samples",
"name": "samples",
"type": "LATENT",
"link": 42
},
{
"localized_name": "vae",
"name": "vae",
"type": "VAE",
"link": 84
}
],
"outputs": [
{
"localized_name": "IMAGE",
"name": "IMAGE",
"type": "IMAGE",
"slot_index": 0,
"links": [
22
]
}
],
"properties": {
"Node name for S&R": "VAEDecode",
"cnr_id": "comfy-core",
"ver": "0.3.18",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": []
},
{
"id": 29,
"type": "CheckpointLoaderSimple",
"pos": [
-35,
161
],
"size": [
315,
98
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"localized_name": "ckpt_name",
"name": "ckpt_name",
"type": "COMBO",
"widget": {
"name": "ckpt_name"
},
"link": null
}
],
"outputs": [
{
"localized_name": "MODEL",
"name": "MODEL",
"type": "MODEL",
"slot_index": 0,
"links": [
80
]
},
{
"localized_name": "CLIP",
"name": "CLIP",
"type": "CLIP",
"slot_index": 1,
"links": [
81,
82
]
},
{
"localized_name": "VAE",
"name": "VAE",
"type": "VAE",
"slot_index": 2,
"links": [
84,
90
]
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple",
"cnr_id": "comfy-core",
"ver": "0.3.18",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"anime\\merge\\hayochamixIDXL_v11+_blueberryPlus_v10-amanatsuIllustrious_v11_x0.1_trainDifference.safetensors"
]
},
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
330,
369
],
"size": [
412.2799987792969,
88
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"localized_name": "clip",
"name": "clip",
"type": "CLIP",
"link": 82
},
{
"localized_name": "text",
"name": "text",
"type": "STRING",
"widget": {
"name": "text"
},
"link": null
}
],
"outputs": [
{
"localized_name": "CONDITIONING",
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
6
]
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode",
"cnr_id": "comfy-core",
"ver": "0.3.18",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"w\n"
]
},
{
"id": 32,
"type": "LoadImage",
"pos": [
-20.402179424849777,
348.01722821269084
],
"size": [
282.798828125,
314
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"localized_name": "image",
"name": "image",
"type": "COMBO",
"widget": {
"name": "image"
},
"link": null
},
{
"localized_name": "choose file to upload",
"name": "upload",
"type": "IMAGEUPLOAD",
"widget": {
"name": "upload"
},
"link": null
}
],
"outputs": [
{
"localized_name": "IMAGE",
"name": "IMAGE",
"type": "IMAGE",
"links": [
101
]
},
{
"localized_name": "MASK",
"name": "MASK",
"type": "MASK",
"links": [
102
]
}
],
"properties": {
"Node name for S&R": "LoadImage",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.8"
},
"image": "clipspace/clipspace-painted-masked-1784801792090.png [input]"
},
"widgets_values": [
"clipspace/clipspace-painted-masked-1784801792090.png [input]",
"image"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
997,
174
],
"size": [
315,
474
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"localized_name": "model",
"name": "model",
"type": "MODEL",
"link": 80
},
{
"localized_name": "positive",
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"localized_name": "negative",
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"localized_name": "latent_image",
"name": "latent_image",
"type": "LATENT",
"link": 72
},
{
"localized_name": "seed",
"name": "seed",
"type": "INT",
"widget": {
"name": "seed"
},
"link": null
},
{
"localized_name": "steps",
"name": "steps",
"type": "INT",
"widget": {
"name": "steps"
},
"link": null
},
{
"localized_name": "cfg",
"name": "cfg",
"type": "FLOAT",
"widget": {
"name": "cfg"
},
"link": null
},
{
"localized_name": "sampler_name",
"name": "sampler_name",
"type": "COMBO",
"widget": {
"name": "sampler_name"
},
"link": null
},
{
"localized_name": "scheduler",
"name": "scheduler",
"type": "COMBO",
"widget": {
"name": "scheduler"
},
"link": null
},
{
"localized_name": "denoise",
"name": "denoise",
"type": "FLOAT",
"widget": {
"name": "denoise"
},
"link": null
}
],
"outputs": [
{
"localized_name": "LATENT",
"name": "LATENT",
"type": "LATENT",
"slot_index": 0,
"links": [
42
]
}
],
"properties": {
"Node name for S&R": "KSampler",
"cnr_id": "comfy-core",
"ver": "0.3.18",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
1008854893628621,
"randomize",
30,
4,
"ddim",
"simple",
1
]
},
{
"id": 26,
"type": "VAEEncodeForInpaint",
"pos": [
759,
169
],
"size": [
226.8000030517578,
98
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"localized_name": "pixels",
"name": "pixels",
"type": "IMAGE",
"link": 101
},
{
"localized_name": "vae",
"name": "vae",
"type": "VAE",
"link": 90
},
{
"localized_name": "mask",
"name": "mask",
"type": "MASK",
"link": 102
},
{
"localized_name": "grow_mask_by",
"name": "grow_mask_by",
"type": "INT",
"widget": {
"name": "grow_mask_by"
},
"link": null
}
],
"outputs": [
{
"localized_name": "LATENT",
"name": "LATENT",
"type": "LATENT",
"slot_index": 0,
"links": [
72
]
}
],
"properties": {
"Node name for S&R": "VAEEncodeForInpaint",
"cnr_id": "comfy-core",
"ver": "0.3.18",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
6
]
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1362.0710000000008,
369.32099999999986
],
"size": [
210,
270
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"localized_name": "images",
"name": "images",
"type": "IMAGE",
"link": 22
},
{
"localized_name": "filename_prefix",
"name": "filename_prefix",
"type": "STRING",
"widget": {
"name": "filename_prefix"
},
"link": null
}
],
"outputs": [
{
"localized_name": "images",
"name": "images",
"type": "IMAGE",
"links": null
}
],
"properties": {
"Node name for S&R": "SaveImage",
"cnr_id": "comfy-core",
"ver": "0.3.18",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
326.97,
160
],
"size": [
422.8500061035156,
164.30999755859375
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"localized_name": "clip",
"name": "clip",
"type": "CLIP",
"link": 81
},
{
"localized_name": "text",
"name": "text",
"type": "STRING",
"widget": {
"name": "text"
},
"link": null
}
],
"outputs": [
{
"localized_name": "CONDITIONING",
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
4
]
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode",
"cnr_id": "comfy-core",
"ver": "0.3.18",
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.8",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"smile"
]
}
],
"links": [
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
22,
8,
0,
9,
0,
"IMAGE"
],
[
42,
3,
0,
8,
0,
"LATENT"
],
[
72,
26,
0,
3,
3,
"LATENT"
],
[
80,
29,
0,
3,
0,
"MODEL"
],
[
81,
29,
1,
6,
0,
"CLIP"
],
[
82,
29,
1,
7,
0,
"CLIP"
],
[
84,
29,
2,
8,
1,
"VAE"
],
[
90,
29,
2,
26,
1,
"VAE"
],
[
101,
32,
0,
26,
0,
"IMAGE"
],
[
102,
32,
1,
26,
2,
"MASK"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.9229599817706418,
"offset": [
365.6203139679832,
118.10373545614928
]
},
"ue_links": [],
"links_added_by_ue": []
},
"version": 0.4
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB