EasyWan22でRuntimeError: Boolean value of Tensor with more than one value is ambiguous
たぶんすぐ対応されるだろうけど、EasyWan22で下記ランタイムエラーが出た場合の対処方法を備忘録として残しておきます。
うちの環境では、開始画像と終了画像を両方指定した上で、Refiner処理をしたときにだけ発生しました。
Runtime Errorの内容
コマンドプロンプト上のエラー内容は下記のとおり。(うちはC:EasyWan22へインストールしているので適宜読み替えてください)
!!! Exception during processing !!! Boolean value of Tensor with more than one value is ambiguous
Traceback (most recent call last):
File "C:\EasyWan22\ComfyUI\execution.py", line 496, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\EasyWan22\ComfyUI\execution.py", line 315, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\EasyWan22\ComfyUI\execution.py", line 289, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "C:\EasyWan22\ComfyUI\execution.py", line 277, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "C:\EasyWan22\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 3673, in decode
if end_image:
^^^^^^^^^
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
対処方法
読めば書いてあるんですけど、たくさんの文字で面喰ってしまうと思うので、抜き出します。
C:\EasyWan22\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py
の3673行目にある
if end_image:という評価式があいまいだよってことです。
これを if end_image is not None: に書き換えればOK。
正誤表っぽく書くとこんな感じ。
誤)if end_image:
正)if end_image is not None:
nodes.pyはただのテキストファイルなのでテキストエディターならメモ帳でもなんでもOK。
怖いなら元のnodes.pyファイルをどこかへコピーしておけば良いし、壊してもカスタムノードのComfyUI-WanVideoWrapperを入れなおせば良いだけ。
………本当ににっちもさっちもいかなくなったとしてもEasyWan22自体消して入れなおせば1時間くらいで復旧できるでしょ?
nodes.py書き換えた後はComfyUIの再起動を忘れずにね。
まとめ
EasyWan22で開始画像/終了画像を指定した動画生成を試していたら、なぜかRefiner処理中にランタイムエラー発生。
エラー内容によると ComfyUI-WanVideoWrapper\nodes.py の3673行目のif文に問題あるらしいので、修正して再起動。
問題なく動作するようになりました。
尚、nodes.pyを書き換えた後、再起動せずに再実行を繰り返し、なおらんなぁー、この書き方でランタイムエラーのわけないんだがなぁーと1時間くらい悩んだのは内緒。
ソース書き換えたら忘れずにComfyUIを再起動するんだぞ!!
















