Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! #14

Open
yovsac opened this issue Oct 18, 2023 · 3 comments

Comments

@yovsac
Copy link

yovsac commented Oct 18, 2023

Get this error:

Error occurred when executing Cut By Mask:

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument tensors in method wrapper_CUDA_cat)

File "C:\IA\ComfyUI_windows_portable_03\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\IA\ComfyUI_windows_portable_03\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\IA\ComfyUI_windows_portable_03\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\IA\ComfyUI_windows_portable_03\ComfyUI_windows_portable\ComfyUI\custom_nodes\masquerade-nodes-comfyui\MaskNodes.py", line 702, in cut
image = tensor2rgba(image)
^^^^^^^^^^^^^^^^^^
File "C:\IA\ComfyUI_windows_portable_03\ComfyUI_windows_portable\ComfyUI\custom_nodes\masquerade-nodes-comfyui\MaskNodes.py", line 68, in tensor2rgba
return torch.cat((t, alpha_tensor), dim=3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Any ideas on how to solve it? It happens when I connect a color transfer node to a "cut by mask node". Any workarounds would be welcomed.

@osen77
Copy link

osen77 commented Dec 28, 2023

same here
Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument tensors in method wrapper_CUDA_cat)

@filip-nikacevic
Copy link

Seems to be an issue with ComfyI2I using both the CUDA device and CPU. I found a workaround by using an Images to RGB node between the Color Transfer and Cut by Mask.

@yovsac
Copy link
Author

yovsac commented Feb 28, 2024

Thank you! I’ll check that out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants