diff --git a/DEVLOG.md b/DEVLOG.md index 7dc3c0d..0bd2d80 100644 --- a/DEVLOG.md +++ b/DEVLOG.md @@ -1,5 +1,45 @@ # DEVLOG - ComfyUI-Workflow-Studio +## 2026-06-27: WFS_PromptText の GenerateUI 対応・ドロップ時 title 固定 + +**変更ファイル**: `static/js/comfyui-workflow.js`, `web/comfyui/node_sets_menu.js` + +### 概要 + +`WFS_PromptText` ノードを含むワークフローを GenerateUI タブで読み込んだ際に、Prompt タブの Positive/Negative テキストエリアへ正しく反映されるよう対応。あわせてサイドバーのプロンプトプリセットをキャンバスにドロップしたときのノード title をプリセット名から「Wfs Prompt」固定に変更し、ワークフローの再利用性を向上。 + +--- + +### WFS_PromptText → GenerateUI Prompt タブ対応 + +#### 変更内容(`static/js/comfyui-workflow.js`) + +- **`analyzeWorkflow` Pass2** に `WFS_PromptText` 検出を追加 + - `inputs.positive` が文字列 → `role: "positive"`, `textKey: "positive"` で `prompt_nodes` に登録 + - `inputs.negative` が文字列 → `role: "negative"`, `textKey: "negative"` で `prompt_nodes` に登録 + - 同一ノードが positive/negative の両ロールを持つため(CLIPTextEncode 経由の伝播で両参照される)、`getRole()` に依存せず固定ロールで登録 +- **`_getWidgetMapping`** に `WFS_PromptText: ["positive", "negative"]` を追加 + - UI 形式 → API 形式変換時のフォールバック: `widgets_values[0]` → `inputs.positive`、`[1]` → `inputs.negative` + +#### 動作 + +| 手順 | 内容 | +|------|------| +| UI 形式読み込み | `convertUiToApi` が `widgets_values` を `inputs.positive/negative` にマップ | +| 解析 | `analyzeWorkflow` が `WFS_PromptText` を positive/negative 2 つの `prompt_node` として認識 | +| 表示 | Prompt タブのセレクトに `ID:X Wfs Prompt [positive]` / `[negative]` が表示される | +| Apply | `textKey: "positive"/"negative"` でワークフローへ書き戻し | + +--- + +### ドロップ時 title 固定(`web/comfyui/node_sets_menu.js`) + +- `placePromptNode` 内の `if (promptName) node.title = promptName;` を `node.title = "Wfs Prompt";` に変更 +- サイドバーの Prompts タブからどのプリセットをドロップしても title が「Wfs Prompt」固定になる +- プリセット内容(positive/negative テキスト)はウィジェット値として保存されるため変わらない + +--- + ## 2026-06-27: v0.3.62 — Send GenUI Image ボタン追加・tagger_settings.json バグ修正・README 更新 **変更ファイル**: `static/js/gallery-tab.js`, `static/js/comfyui-editor.js`, `static/js/i18n.js`, `static/js/app.js`, `templates/index.html`, `py/routes/settings_routes.py`, `README.md` diff --git a/static/js/comfyui-workflow.js b/static/js/comfyui-workflow.js index 32dbf26..3bf9e99 100644 --- a/static/js/comfyui-workflow.js +++ b/static/js/comfyui-workflow.js @@ -713,6 +713,22 @@ export const comfyWorkflow = { } } + // WFS_PromptText — 2出力ノード。output[0]=positive / output[1]=negative + if (ct === "WFS_PromptText") { + if (typeof inputs.positive === "string") { + result.prompt_nodes.push({ + id, type: ct, title: `${title} [positive]`, role: "positive", + text: inputs.positive, textKey: "positive", + }); + } + if (typeof inputs.negative === "string") { + result.prompt_nodes.push({ + id, type: ct, title: `${title} [negative]`, role: "negative", + text: inputs.negative, textKey: "negative", + }); + } + } + // PrimitiveStringMultiline / PrimitiveString — when feeding a prompt node if ((ct === "PrimitiveStringMultiline" || ct === "PrimitiveString") && (isPos || isNeg)) { result.prompt_nodes.push({ @@ -899,6 +915,7 @@ function _getWidgetMapping(nodeType) { // vary between versions and include frontend-only extras, so we leave them unmapped. ImpactWildcardProcessor: ["wildcard_text"], ImpactWildcardEncode: ["wildcard_text"], + WFS_PromptText: ["positive", "negative"], }; return mappings[nodeType] || null; } diff --git a/web/comfyui/node_sets_menu.js b/web/comfyui/node_sets_menu.js index 88aff6d..96da88a 100644 --- a/web/comfyui/node_sets_menu.js +++ b/web/comfyui/node_sets_menu.js @@ -408,7 +408,7 @@ const placePromptNode = (posText, negText, promptName, pos) => { } node.pos = pos || [100, 100]; - if (promptName) node.title = promptName; + node.title = "Wfs Prompt"; graph.add(node);