ComfyUI > Nodes > Basic data handling > Tensor Join

ComfyUI Node: Tensor Join

Class Name

TensorJoin

Category
Basic/tensor
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Tensor Join Description

`TensorJoin` node merges multiple tensors via concatenation or stacking for data integration.

Tensor Join:

The TensorJoin node is designed to facilitate the combination of multiple tensors, offering two primary methods: concatenation and stacking. This node is particularly useful when you need to merge data from different sources or dimensions into a single tensor, which is a common requirement in various AI and machine learning tasks. By providing a straightforward interface to join tensors, it simplifies the process of data manipulation and preparation, allowing you to focus on higher-level tasks without getting bogged down in the intricacies of tensor operations. Whether you are working with image data, audio signals, or any other form of multi-dimensional data, TensorJoin offers a flexible and efficient way to manage and organize your data structures.

Tensor Join Input Parameters:

tensor1

This parameter represents the first tensor to be joined. It can be any data type that can be converted into a tensor, such as a list or an existing tensor. The choice of this tensor will directly affect the resulting joined tensor, as it forms the initial part of the combination.

tensor2

Similar to tensor1, this parameter is the second tensor that you wish to join with the first. It also accepts any data type that can be converted into a tensor. The order and content of this tensor will influence the final output, as it is appended or stacked with tensor1.

dim

The dim parameter specifies the dimension along which the tensors will be joined. It is an integer value, with a default of 0, indicating the first dimension. Adjusting this parameter allows you to control how the tensors are combined, whether by extending rows, columns, or other dimensions, depending on the structure of your data.

mode

This parameter determines the method of joining the tensors, with options being "concatenate" or "stack". The default mode is "concatenate", which appends the tensors along the specified dimension. Alternatively, "stack" creates a new dimension, stacking the tensors on top of each other. The choice of mode affects the shape and structure of the resulting tensor.

Tensor Join Output Parameters:

torch.Tensor

The output is a single tensor that results from joining tensor1 and tensor2 according to the specified dim and mode. This tensor can be used in subsequent operations or analyses, providing a unified data structure that incorporates the information from both input tensors. The shape and dimensions of this output tensor will vary based on the input parameters and the method of joining.

Tensor Join Usage Tips:

  • When using the "concatenate" mode, ensure that the tensors have compatible shapes along the specified dimension to avoid errors.
  • Use the "stack" mode when you need to add a new dimension to your data, which can be useful for creating batches or organizing data hierarchically.

Tensor Join Common Errors and Solutions:

ValueError: Tensors must have the same shape except in the concatenating dimension

  • Explanation: This error occurs when the tensors have incompatible shapes for the specified dimension in "concatenate" mode.
  • Solution: Verify that the tensors have the same shape in all dimensions except the one specified by dim.

RuntimeError: stack expects each tensor to be equal size

  • Explanation: This error arises in "stack" mode when the tensors do not have the same shape.
  • Solution: Ensure that both tensors have identical shapes before attempting to stack them.

Tensor Join Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.