Visit ComfyUI Online for ready-to-use ComfyUI environment
Transfer image or mask tensors to specified device for optimized AI model performance.
The To Device (mtb) node is designed to transfer image or mask tensors to a specified device, such as a CPU or GPU. This functionality is crucial for optimizing the performance of your AI models by ensuring that the data is processed on the most suitable hardware. By leveraging this node, you can seamlessly move your data between different devices, which can significantly enhance the efficiency and speed of your AI workflows. The node is particularly beneficial for AI artists who need to handle large image or mask tensors and want to take advantage of the computational power of GPUs. The main goal of this node is to provide a flexible and efficient way to manage the device allocation of your data, ensuring smooth and effective processing.
This parameter is a boolean that determines whether to ignore errors when neither an image nor a mask is provided. If set to True
, the node will pass through without raising an error even if no image or mask is given. This can be useful in scenarios where you want to ensure the workflow continues without interruption. The default value is False
.
This parameter specifies the device to which the image or mask tensor should be sent. The available options include cpu
, mps
(if available), and cuda
(if available). If CUDA is available, additional options like cuda0
, cuda1
, etc., will be included based on the number of CUDA devices present. The default value is cpu
.
This optional parameter accepts an image tensor that you want to transfer to the specified device. If provided, the image tensor will be moved to the device selected in the device
parameter.
This optional parameter accepts a mask tensor that you want to transfer to the specified device. If provided, the mask tensor will be moved to the device selected in the device
parameter.
This output parameter returns the image tensor that has been transferred to the specified device. If no image tensor was provided as input, this output will be None
.
This output parameter returns the mask tensor that has been transferred to the specified device. If no mask tensor was provided as input, this output will be None
.
cuda
can significantly speed up the processing.ignore_errors
parameter to prevent workflow interruptions in cases where it is acceptable to proceed without an image or mask tensor.ignore_errors
parameter is set to False
.ignore_errors
parameter to True
if it is acceptable to proceed without them.cpu
.mps
device, but it is not available on your system.cpu
or cuda
.© Copyright 2024 RunComfy. All Rights Reserved.