UI→API conversion emits frontend-only custom nodes (rgthree Bookmark) → unknown_class_type; consider pairing widgets by name via widgets_values_named

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start in comfy_cli/workflow_to_api.py at convert_ui_to_api and review _UI_ONLY_NODE_TYPES, then compare the related workflow_ops.UI_ONLY_NODE_TYPES behavior. Reproduce with the Bookmark (rgthree) workflow using comfy workflow validate and inspect how widgets_values_named is handled. Done means the affected UI workflow validates without unknown_class_type errors and the chosen conversion behavior is covered consistently.

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

描述

convert_ui_to_api (comfy_cli/workflow_to_api.py) skips only the frontend's own virtual nodes — _UI_ONLY_NODE_TYPES = {Note, MarkdownNote, PrimitiveNode, GetNode, SetNode, Reroute}. Popular packs ship more of them: rgthree's Bookmark (rgthree), Label (rgthree), Fast Groups Muter (rgthree)… are isVirtualNode in the frontend, have no Python class and never reach the executor. The converter still emits them, so comfy workflow validate / comfy workflow run (and comfy-mcp's validate_workflow / run_workflow, which call the same code) fail with unknown_class_type on a workflow that runs fine from the UI.

Repro: any UI-format workflow with one Bookmark (rgthree) node (rgthree-comfy installed):

comfy workflow validate --workflow my_ui_workflow.json
→ valid: false, errors: [{"type": "unknown_class_type", "node_id": "160", "class_type": "Bookmark (rgthree)"}]

Measured on comfy-cli 1.18.0 and on main (2026-09-15) with a 149-node workflow carrying 5 bookmarks: 5 × unknown_class_type, nothing else wrong with the graph (the same graph exported to API from the UI validates clean).

Two suggestions

  1. Skip a node whose type is absent from object_info when it declares neither inputs nor outputs (decorative by construction), and/or extend _UI_ONLY_NODE_TYPES (and workflow_ops.UI_ONLY_NODE_TYPES) with rgthree's virtual types. We run exactly that as a 20-line wrapper loaded by a .pth in our venv: https://github.com/sickbraintwo/WextraUI/blob/main/tools/comfy_cli_patch.py — with it the same workflow converts to 60 clean nodes.

  2. The frontend (≥ 1.5x) now saves widgets_values_named next to widgets_values (a {input name: value} map, present on every node of files saved by recent frontends). When it is there, pairing widget values by name instead of by position would make the converter — and comfy workflow slots — immune to the positional drift that produces pairing_suspect slots whenever a custom node draws a widget its schema does not list, or changed its input order between versions. We hit this on our own pack (40 suspect slots on one workflow) and fixed it on our side, but the name map is already in the file and would make the converter robust for every pack.

Happy to open a PR for either if you tell me which shape you prefer.

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