Skip to content

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

Description

@annehe9

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.

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