feat: WFS_PromptText を GenerateUI Prompt タブで認識・ドロップ title 固定

- analyzeWorkflow に WFS_PromptText 検出を追加(positive/negative を個別の prompt_node として登録)
- _getWidgetMapping に WFS_PromptText フォールバックマッピングを追加(UI→API 変換対応)
- placePromptNode のドロップ時 title をプリセット名から「Wfs Prompt」固定に変更

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ketle-man
2026-06-27 21:58:27 +09:00
co-authored by Claude Sonnet 4.6
parent 71ed9788a6
commit 78b34c99f7
3 changed files with 58 additions and 1 deletions
+40
View File
@@ -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`
+17
View File
@@ -713,6 +713,22 @@ export const comfyWorkflow = {
}
}
// WFS_PromptText — 2出力ノード。output[0]=positive / output[1]=negative
if (ct === "WFS_PromptText") {
if (typeof inputs.positive === "string") {
result.prompt_nodes.push({
id, type: ct, title: `${title} [positive]`, role: "positive",
text: inputs.positive, textKey: "positive",
});
}
if (typeof inputs.negative === "string") {
result.prompt_nodes.push({
id, type: ct, title: `${title} [negative]`, role: "negative",
text: inputs.negative, textKey: "negative",
});
}
}
// PrimitiveStringMultiline / PrimitiveString — when feeding a prompt node
if ((ct === "PrimitiveStringMultiline" || ct === "PrimitiveString") && (isPos || isNeg)) {
result.prompt_nodes.push({
@@ -899,6 +915,7 @@ function _getWidgetMapping(nodeType) {
// vary between versions and include frontend-only extras, so we leave them unmapped.
ImpactWildcardProcessor: ["wildcard_text"],
ImpactWildcardEncode: ["wildcard_text"],
WFS_PromptText: ["positive", "negative"],
};
return mappings[nodeType] || null;
}
+1 -1
View File
@@ -408,7 +408,7 @@ const placePromptNode = (posText, negText, promptName, pos) => {
}
node.pos = pos || [100, 100];
if (promptName) node.title = promptName;
node.title = "Wfs Prompt";
graph.add(node);