The message
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
Affects: ComfyUI
Why is this happening?
PyTorch can only compute when all data involved is on the same device. If a node forgets to move a weight or a mask to the graphics card, you get this message. This happens especially when parts of a model are moved to RAM because of low VRAM. The usual cause is Custom Nodes or newly supported models, and sometimes built-in nodes too; these errors are fixed in updates.
How to fix it
- Read the last lines of the error message in the console window. If you see a path with
custom_nodes\…, the error is in that Custom Node; otherwise, it is in ComfyUI itself. - Update ComfyUI. Portable: run
update\update_comfyui.batin theComfyUI_windows_portablefolder. Desktop app: Manage → Update tab. Manual installation: activate venv, rungit pullin theComfyUIfolder, thenpip install -r requirements.txt. - Update all Custom Nodes through the ComfyUI Manager and restart ComfyUI.
- Test without Custom Nodes. Portable: open a terminal in the
ComfyUI_windows_portablefolder and run.\python_embeded\python.exe -s ComfyUI\main.py --disable-all-custom-nodes --windows-standalone-build. Manual installation:python main.py --disable-all-custom-nodes. Desktop app: start with Custom Nodes disabled in the settings. - If the error is gone without Custom Nodes, turn them back on one by one until you find the culprit, and report the error with the console log on its GitHub page.
- If the error still happens without Custom Nodes, report it to ComfyUI on GitHub with the log and workflow. Until it is fixed, it often helps to replace the affected node with a different approach.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- expected scalar type Half but found Float (number formats do not match)
- Cannot execute because a node is missing the class_type property (Node not loaded or wrong workflow format)
- Prompt outputs failed validation: Required input is missing (Required input not connected)
- Windows SmartScreen or Defender blocks an installer or .exe
- torch._scaled_mm is only supported on CUDA devices with compute capability >= 9.0 or 8.9 (fp8 fast mode needs RTX 40 or newer)
Sources
- https://github.com/Comfy-Org/ComfyUI/issues/16686
- https://github.com/Comfy-Org/ComfyUI/issues/2556
- https://docs.comfy.org/troubleshooting/custom-node-issues
- https://docs.comfy.org/installation/update_comfyui
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.