Skip to content

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

Description

@sickbraintwo

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions