UI→API conversion ignores host values on a legacy proxyWidgets subgraph instance (convert path never runs flush_proxy_migration)

オープン
#1,070 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, cli

調査の方向性

Start with comfy_cli/workflow_to_api.py, especially _overlay_promoted_host_values, then read flush_proxy_migration in comfy_cli/cql/promoted.py and its existing call sites in workflow_ops.py and cql/engine.py. Reproduce with node 252 in tests/comfy_cli/fixtures/gallery/template_horizontal_vertical_extension.json; check whether conversion preserves the host value 9:16 rather than using the interior default. The suggested change is to run migration on an isolated copy before overlaying host values.

索引モデルが issue の本文から書いたものです。

説明

effort:small

Summary

convert_ui_to_api never runs the legacy proxyWidgets forward migration, so a subgraph instance whose promotion is still a legacy properties.proxyWidgets entry converts with its host-owned values ignored. The interior widget's default is submitted instead.

flush_proxy_migration (comfy_cli/cql/promoted.py:1985) is a full port of the frontend's flushProxyWidgetMigration, and it is called from exactly two places:

  • comfy_cli/workflow_ops.py:3458
  • comfy_cli/cql/engine.py:5533

Both are write paths. comfy_cli/workflow_to_api.py never calls it. Instead _overlay_promoted_host_values resolves promoted values through _promoted.promoted_inputs(sg, subgraph_defs) filtered to is_widget, which enumerates the definition's declared linked inputs. A legacy entry that the definition does not yet back with a linked input is invisible to that walk, so the host value attached to it is dropped.

The module docstring is explicit that the migration is the mechanism that makes a legacy promotion addressable (promoted.py:19-25), and that the CLI runs it "on the one instance whose legacy promotion a write is about to edit". Conversion is not a write, so it gets no migration.

Reproduction

On main @4d054af, using a fixture already in the repo — tests/comfy_cli/fixtures/gallery/template_horizontal_vertical_extension.json, node 252:

proxyWidgets (4): [["233","$$canvas-image-preview"], ["232","$$canvas-image-preview"],
                   ["234","$$canvas-image-preview"], ["285","aspect_ratio"]]
sg.inputs    (1): [["image","IMAGE"]]

The definition declares one input, and it is an IMAGE socket — no widget-backed linked inputs at all. Write the host values the way the frontend writes them, positionally in proxyWidgets order with the preview pseudo-widgets holding null:

inst["widgets_values"] = [None, None, None, "9:16"]
api = convert_ui_to_api(wf, object_info)
api["252:285"]["inputs"]["aspect_ratio"]
# -> "9:16 (Portrait Widescreen)"   the interior default
# expected "9:16"                   the host value

The user's choice is discarded and the graph validates and runs with a different aspect ratio.

Four more shipped gallery fixtures have the same shape — proxyWidgets longer than, or ordered differently from, the definition's inputs:

fixture node proxyWidgets sg.inputs
templates_graphic_design_recomposer.json 143 3 1
template_horizontal_vertical_extension.json 252 4 1
flux_dev_checkpoint_example.json 56 9 7
image_z_image_turbo.json 57 9 8
05_audio_ace_step_1_t2a_song_subgraphed.json 127 12 12

All five carry widgets_values: [], which is why no existing test catches this — with no host values stored, falling back to the interior default happens to be correct. The defect only appears once the host holds values, which is the state a user's own save is in.

Impact

The 2026-10 Comfy Hub conversion audit flagged this as its largest and most damaging finding: 25 of 392 public workflows. It is often silent — when the misassigned values share a type (cfg ↔ shift, two model filenames) the graph passes comfy workflow validate and runs on Cloud with the wrong settings. In the rest a prompt lands in a model-name field, which at least fails loudly.

Suggested fix

Run the same forward migration on an isolated copy before _overlay_promoted_host_values walks the instance, so conversion sees the same repaired state a write would. The migration is already deterministic (every minted id derived from (instance path, source node, widget)), already handles the cases the audit describes — $$-prefixed preview pseudo-widgets that own no slot, PrimitiveNode fan-out, control_after_generate companions, quarantine of unrepairable entries — and already picks host values positionally in proxyWidgets order (pickHostValue). Conversion needs its result, not a second implementation of it.

Relationship to other work

  • #1039 fixes a different half of promoted-value loss — a promoted value feeding a socket-only interior input — for promotions that are already backed by linked inputs. It does not add a migration step, so it does not cover this. Verified against its head: 13/13 parity, 99 promoted tests pass, and the fixture above still converts wrong.
  • #862 runs the migration before the first host write in the two slot-editing paths (closing #858's write-order bug). Same function, different call sites; it does not touch workflow_to_api.py. It is also currently conflicting and has had no activity since 2026-09-10.
  • #974 is the socket-target case #1039 addresses.

So this is uncovered by all three.

Cross-converter note

@comfyorg/api-to-workflow resolves promoted values through the proxyWidgets chain directly (comfy-cloud-mcp-server/src/converter/converter.ts:1571 resolveProxyWidgetValue), so it does not have this bug. The two converters therefore disagree on any legacy-promotion graph, and conversionParity.test.ts would show it — except that suite is skip-gated on comfy-cli being importable and CI installs no Python, so it never runs.

主要言語
Python
スター
1k
フォーク
176
平均マージ
1日 11時間
マージ済み PR(30日)
87

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Comfy-Org/comfy-cli のほかの issue

Comfy-Org/comfy-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。