ComfyUIの処理で「Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!」というエラーが出る場合の対処です。
「Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!」エラー
Tensorsの処理で、処理がCudaとCPUに分散されてしまうことで、計算処理にエラーが出ているようです。
うちではAnimate diffで出ましたが、ControlNetなどほかで出る場合もあるようです。
アップデート
まずは全ノード、ComfyUIをアップデートして最新にしておきましょう。
これで治る場合もあるようです。
run_nvidia_gpu
「run_nvidia_gpu」に引数オプションをつけて起動します。
[--medvram」や「--lowvram」をつけると、メモリ量を抑えるので改善されるかもしれません。
また「--disable-cuda-malloc」でCudaのメモリ割り当てをオフに?すると治った場合があるようです。
あるユーザは「-run_nvidia_gpu」に「--disable-cuda-malloc --lowvram --force-fp16」を追記してから起動、これで治ったとする意見があります。
cuda error (CPU and cuda:0!) : r/comfyui (reddit.com)
Got this error when running AnimateDiff : r/comfyui (reddit.com)
run_cpu.bat
「run_cpu.bat」からの起動、または「--cpu」をつけてのバッチ起動にすると、GPUでの計算は行いません。
レンダリングはできる可能性は高いですが、処理時間はかなりかかることになります。