UI→API conversion drops a promoted subgraph value that feeds a non-widget input (Qwen Image 2.1 t2i loses its prompt)

オープン
#974 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@allenflux がすでに取り組んでいます。

2026年10月20日 から。

  • #1039 @allenflux による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

Start in workflow_to_api.py, especially _overlay_promoted_host_values, and trace how it uses cql.promoted.boundary_widget_targets and _boundary_targets. Reproduce with the supplied workflow and object-info inputs, then check that the converted ComfySwitchNode receives the promoted prompt on on_false when the prompt-rewrite switch is off. Done means the API output preserves the prompt for that socket as the ComfyUI frontend does.

索引モデルが issue の本文から書いたものです。

説明

Versions: comfy-cli 1.22.0 (PyPI); same logic on main at 09cfceb. ComfyUI 0.38.0, comfyui-workflow-templates 0.11.76.

What happens: converting the stock image_qwen_image_2_1_t2i template (as comfy run / comfy-mcp's run_workflow do) produces a ComfySwitchNode with no on_false input:

import json
from comfy_cli.workflow_to_api import convert_ui_to_api
wf = json.load(open("image_qwen_image_2_1_t2i.json"))   # GET /templates/image_qwen_image_2_1_t2i.json
oi = json.load(open("object_info.json"))                 # GET /object_info
api = convert_ui_to_api(wf, oi)
print(api["459:474"]["inputs"])
# {'switch': 'False', 'on_true': ['459:471', 0]}   <- on_false missing

In the template, subgraph input prompt (linkIds 684, 711) feeds TextGenerate.prompt (a widget, 711) and ComfySwitchNode.on_false (a plain socket, 684). With the prompt-rewrite switch off (the template default), the switch returns nothing, TextEncodeQwenImage21 encodes an empty prompt, and the image ignores the prompt entirely.

Expected: on_false receives the promoted host value (the prompt string), as the ComfyUI frontend does.

Cause: workflow_to_api._overlay_promoted_host_values writes the host value only to targets returned by cql.promoted.boundary_widget_targets → _boundary_targets, which keeps a target only when its input entry has a widget marker. A promoted widget value that also fans out to a socket-only input is never written there, and the expansion leaves that input unlinked.

Workaround we use: route such inputs through a Primitive node inside the subgraph (-10 → PrimitiveStringMultiline.value → original socket), so the value lands on a widget.

主要言語
Python
スター
1k
フォーク
176
平均マージ
1日 11時間
マージ済み PR(30日)
87

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Comfy-Org/comfy-cli のほかの issue

Comfy-Org/comfy-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。