UI→API conversion assigns the wrong widget value when a node has a multi-type input

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

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

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

評価

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

調査の方向性

保存したキャンバスワークフローを comfy --json run --workflow <saved.json> --print-prompt で使って問題を再現し、その後、UI-to-API 変換経路と comfy_extras/nodes_lt_audio.py の LTXVEmptyLatentAudio の入力を調べます。生成されたグラフを ComfyUI の Export (API) 出力と比較し、複数の型を持つ入力によって後続のウィジェット値がずれなくなっていることを確認し、バリデーション警告が同じ型処理経路を共有している場合はその警告にも対処します。

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

説明

bug

UI→API conversion assigns the wrong widget value when a node has a multi-type input

Environment

   
comfy-cli 1.18.0
ComfyUI 0.33.1 (Windows portable, python_embeded)
Python 3.10.11
OS / GPU Windows, RTX 4090
Workflow ComfyUI built-in template Text to Video (LTX-2.5)

Summary

When lowering a UI-format (canvas) workflow to API format, comfy-cli mis-assigns widgets_values for nodes whose schema contains a multi-type input (io.MultiType.Input, surfaced as a FLOAT,INT type). The multi-type input appears to be skipped when building the ordered list of widget-capable inputs, so every widget declared after it receives the value belonging to the previous one.

The result is a silently wrong graph that validates clean and then fails at runtime.

Concrete case

LTXVEmptyLatentAudio (comfy_extras/nodes_lt_audio.py) declares its inputs in this order:

frames_number : Int
frame_rate    : MultiType(Float, [Int])    <-- multi-type
batch_size    : Int
audio_vae     : Vae

The frontend stores "widgets_values": [97, 25, 1] (frames_number=97, frame_rate=25, batch_size=1).

In this workflow frames_number and frame_rate are both driven by links; only batch_size uses its widget value.

Expected — ComfyUI's own Workflow > Export (API):

"405:366": {
  "class_type": "LTXVEmptyLatentAudio",
  "inputs": {
    "frames_number": ["405:378", 1],
    "frame_rate":    ["405:359", 1],
    "batch_size":    1,
    "audio_vae":     ["405:386", 0]
  }
}

Actual — comfy --json run --workflow <canvas.json> --print-prompt:

"405:366": {
  "class_type": "LTXVEmptyLatentAudio",
  "inputs": {
    "batch_size":    25,
    "frames_number": ["405:378", 1],
    "frame_rate":    ["405:359", 1],
    "audio_vae":     ["405:386", 0]
  }
}

batch_size receives 25, which is frame_rate's widget value.

The sibling node EmptyLTXVLatentVideo in the same graph — width, height, length, batch_size, all plain Int, the first three linked — converts correctly ("batch_size": 1). The only structural difference between the two nodes is the multi-type input.

Consequence

The audio latent is built with batch size 25 while the video latent has batch size 1, and execution dies when the two are packed together:

node 405:344  SamplerCustomAdvanced
RuntimeError: Sizes of tensors must match except in dimension 2.
Expected size 1 but got size 25 for tensor number 1 in the list.

comfy/samplers.py:1282 in sample -> pack_latents(latent_image.unbind())
comfy/utils.py:1381 in pack_latents -> torch.cat(tensors, dim=-1)

Steps to reproduce

  1. Open the built-in template Text to Video (LTX-2.5) in the ComfyUI frontend and save it (canvas format).
  2. Run comfy --json run --workflow <saved.json> --print-prompt.
  3. Inspect the LTXVEmptyLatentAudio node in the printed graph: batch_size is 25 instead of 1.
  4. comfy run on the same file fails with the RuntimeError above. Pressing Run in the browser succeeds, and so does passing the frontend's Export (API) output to comfy run.

Possibly related

comfy workflow validate on the same graph reports, for the same field:

node 405:366, field frame_rate, code edge_type_mismatch
input 'frame_rate' expects FLOAT,INT but ComfyMathExpression[1] produces INT

INT is within the accepted set, so this warning is itself a false positive — which suggests multi-type inputs are not fully modelled in the type-checking layer either, not only in the widget-mapping path.

Workaround

Export the workflow with ComfyUI's Workflow > Export (API) and pass that file to comfy-cli instead of the canvas-format file.

主要言語
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 を短くまとめたダイジェスト。