ComfyUI Node: contains

Class Name

Basic data handling: SetContains

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

contains Description

SetContains node checks if a specific value exists in a set, aiding data validation and filtering.

contains:

The SetContains node is designed to determine whether a specific value exists within a given set. This functionality is particularly useful when you need to verify the presence of an element in a collection of unique items, which is what a set represents. By leveraging this node, you can efficiently check for membership, which can be crucial in scenarios where you need to validate data, filter elements, or perform conditional operations based on the presence of certain values. The node simplifies the process of checking set membership, making it accessible even to those without a technical background, and ensures that you can quickly ascertain whether a particular value is part of your dataset.

contains Input Parameters:

set

The set parameter represents the collection of unique items you want to check against. It is a fundamental input for the node, as it defines the scope within which the search for the specified value will occur. The set can contain elements of any data type, including numbers, strings, and booleans. There are no explicit minimum or maximum values for the set, but it must be a valid set object. The set's content directly impacts the node's execution, as the presence or absence of the specified value within this set determines the output.

value

The value parameter is the specific item you are checking for within the set. This parameter can be of any data type, matching the types of elements that might be present in the set. The node evaluates whether this value exists in the set, and the result of this evaluation is what the node outputs. There are no default values for this parameter, as it is required to specify the exact value you are interested in finding within the set.

contains Output Parameters:

contains

The contains output parameter is a boolean value that indicates whether the specified value is present in the set. If the value is found within the set, the output will be True; otherwise, it will be False. This output is crucial for decision-making processes, as it allows you to branch logic based on the presence or absence of the value in the set. The simplicity of a boolean output makes it easy to integrate this node's result into larger workflows or conditional structures.

contains Usage Tips:

  • Use the SetContains node to quickly verify the presence of an element in a dataset, which can be particularly useful for filtering or validation tasks.
  • Ensure that the set parameter is correctly defined and contains the elements you expect to check against, as this will directly affect the accuracy of the node's output.

contains Common Errors and Solutions:

ValueError: Invalid set input

  • Explanation: This error occurs when the input provided for the set parameter is not a valid set object.
  • Solution: Ensure that the input for the set parameter is a properly defined set. You can create a set using curly braces {} or the set() function in Python.

TypeError: Unsupported value type

  • Explanation: This error arises when the value parameter is of a type that cannot be compared with the elements in the set.
  • Solution: Verify that the value parameter is of a compatible type with the elements in the set. Ensure that the data types are consistent to avoid comparison issues.

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

contains