UI→API conversion gives no widgets_values slot to newer frontend widget types (COLOR, CURVE, ...)

未关闭
#893 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python, typescript
领域
api, backend, cli

调研方向

Start with the converter's _is_widget_input logic and engine._is_link, then compare them with the widget registrations in src/scripts/widgets.ts and serialization behavior in useColorWidget.ts. Check which listed frontend widget types write slots and reconcile NUMBER handling. Done means UI-to-API conversion preserves positional widget values and the converter and engine agree on widget inputs.

由索引模型根据 Issue 内容生成。

描述

Found while reviewing #891.

1. Newer frontend widget types get no slot

_is_widget_input knows INT, FLOAT, STRING, BOOLEAN, COMBO, the _FRONTEND_DOM_WIDGET_TYPES set and V3 dynamic combos. The frontend's core registry (ComfyWidgets in src/scripts/widgets.ts) also registers MARKDOWN, COLOR, IMAGECOMPARE, BOUNDING_BOX, BOUNDING_BOXES, CHART, GALLERIA, PAINTER, COMPOSITOR, TEXTAREA, CURVE, RANGE, VIDEO_EDIT, RESOLUTION_PREVIEW and COLORS. The converter treats all of these as links. engine._is_link does too.

Core nodes use several of them as widget inputs: TextOverlay.color, Painter.bg_color, ImageCropToMask.background, MediaPipeFaceMeshVisualize.color, CurveEditor.curve, ImageCompositor.compositor, CreateBoundingBoxes.editor_state.

The COLOR widget writes a slot (useColorWidget.ts passes serialize: true), so every widget after it shifts by one. Repro on main (f35e41c) with the TextOverlay schema from /object_info and a hand-built node:

widgets_values = ["hello", 24, "#ff0000", "top", "left", True]
# text, font_size, color, position, align, outline
{'text': 'hello', 'font_size': 24, 'color': '#ffffff', 'position': '#ff0000', 'align': 'top', 'outline': 'left'}

color falls back to its default and every later value lands one input early.

I only checked serialize for COLOR. Each of the other types needs the same check before it goes in the set, since some may not write a slot (like LOAD3D_CAMERA).

2. Converter and engine disagree on NUMBER

engine._IMPLICIT_WIDGET_TYPES includes NUMBER, so the engine treats a NUMBER input as a widget. The converter treats it as a link. The frontend's core registry has no NUMBER widget. I did not check whether any extension registers one.

WAS Node Suite (Number Operation.number_a, ...) and ComfyMath (CM_NumberBinaryOperation.a, ...) declare NUMBER inputs. #891 aims for the converter and the engine to use one rule, and they still differ here.

Related: #873 suggests pairing widgets_values by name, which would avoid positional shifts like the one above.

主要语言
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 摘要。