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

Abierto
#974 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@allenflux ya está trabajando en esto.

Desde el 20/10/2026.

  • #1039 de @allenflux — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
1k
Forks
176
Merge medio
1 d 11 h
PR fusionados (30 d)
87

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Comfy-Org/comfy-cli

Todos los issues de Comfy-Org/comfy-cli

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.