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 个 reaction 已指派 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 小时
30 天内合并 PR
87

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Comfy-Org/comfy-cli 的其他 Issue

查看 Comfy-Org/comfy-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。