ComfyUI Node: union

Class Name

Basic data handling: SetUnion

Category
Basic/SET
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

union Description

SetUnion node merges multiple sets into one, ensuring all elements are unique.

union:

The SetUnion node is designed to efficiently combine multiple sets into a single set that contains all unique elements from the input sets. This node is particularly useful when you need to merge data from different sources or collections, ensuring that each element is represented only once in the resulting set. By leveraging the union operation, this node simplifies the process of aggregating data, making it an essential tool for tasks that require comprehensive data integration. The primary goal of the SetUnion node is to provide a straightforward and effective way to unify sets, enhancing data handling capabilities without requiring complex operations or extensive technical knowledge.

union Input Parameters:

set1

set1 is a required input parameter representing the first set to be included in the union operation. This parameter is crucial as it forms the initial basis of the union, and its elements will be part of the final output set. There are no specific minimum or maximum values for this parameter, as it can contain any number of elements. The default value is not applicable since it is a required input.

set2

set2 is another required input parameter that represents the second set to be included in the union operation. Like set1, this parameter is essential for expanding the union with additional elements. The elements from set2 will be added to the resulting set, ensuring that all unique elements are included. There are no specific constraints on the number of elements, and no default value is provided as it is a required input.

set3

set3 is an optional input parameter that allows you to include a third set in the union operation. If provided, the elements from set3 will be added to the resulting set, further expanding the union. This parameter is useful when you have more than two sets to combine. There are no specific constraints on the number of elements, and if not provided, it defaults to None, meaning it will not affect the union.

set4

set4 is another optional input parameter that allows you to include a fourth set in the union operation. Similar to set3, if provided, the elements from set4 will be added to the resulting set. This parameter is beneficial when dealing with multiple sets that need to be unified. There are no specific constraints on the number of elements, and if not provided, it defaults to None, meaning it will not affect the union.

union Output Parameters:

SET

The output parameter is a single set that contains all unique elements from the input sets. This resulting set is the culmination of the union operation, ensuring that each element from the provided sets is represented only once. The importance of this output lies in its ability to consolidate data efficiently, providing a comprehensive view of all elements across the input sets. This output is particularly valuable for tasks that require data aggregation and integration, as it simplifies the process of combining multiple data sources into a single, unified collection.

union Usage Tips:

  • Use the SetUnion node when you need to merge multiple sets into one, ensuring that all unique elements are included without duplicates.
  • Consider using optional parameters set3 and set4 when you have more than two sets to combine, as this can streamline your workflow by reducing the need for multiple union operations.

union Common Errors and Solutions:

TypeError: 'NoneType' object is not iterable

  • Explanation: This error occurs when one of the optional parameters (set3 or set4) is not provided and defaults to None, but the code attempts to iterate over it.
  • Solution: Ensure that you only provide sets as input parameters. If you do not have a third or fourth set, you can safely omit set3 and set4, as the node is designed to handle None values for these parameters without attempting to iterate over them.

ValueError: Input must be a set

  • Explanation: This error arises when the input provided is not of type set, which is required for the union operation.
  • Solution: Verify that all inputs are indeed sets. If you have data in other formats, convert them to sets before using the SetUnion node to avoid this error.

union 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.

union