ComfyUI Node: contains

Class Name

Basic data handling: DataListContains

Category
Basic/Data List
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

The `DataListContains` node checks if a specified value exists in a list, aiding decision-making.

contains:

The DataListContains node is designed to efficiently determine whether a specified value exists within a given list. This node is particularly useful when you need to verify the presence of an item in a collection, allowing you to make decisions based on the existence of that item. By providing a straightforward mechanism to check for membership, it simplifies workflows that require conditional logic based on list contents. This node is essential for tasks where verifying the presence of elements in a dataset is crucial, enhancing the flexibility and control you have over data processing operations.

contains Input Parameters:

list

The list parameter is the collection of items you want to search through. It can contain any type of data, such as numbers, strings, or objects. The function of this parameter is to serve as the dataset in which the node will look for the specified value. There are no specific minimum or maximum values for this parameter, as it can be any list of items. The impact of this parameter on the node's execution is direct; the node will return True if the specified value is found within this list, and False otherwise.

value

The value parameter represents the item you are searching for within the list. This parameter can also be of any data type, matching the types of items within the list. The node checks if this value is present in the list provided. If the value parameter is empty or not specified, the node will return False, as there is nothing to search for. This parameter is crucial as it defines the target of the search operation within the list.

contains Output Parameters:

contains

The contains output parameter is a boolean value that indicates whether the specified value is present in the list. If the value is found, this parameter will return True; otherwise, it will return False. This output is essential for decision-making processes, as it allows you to branch your workflow based on the presence or absence of the value in the list. It provides a clear and concise result that can be used to trigger subsequent actions or conditions in your data processing pipeline.

contains Usage Tips:

  • Ensure that the list parameter contains the type of data you expect to search for, as mismatched types between the list and the value can lead to unexpected results.
  • Use this node in conjunction with other data handling nodes to create complex conditional logic based on the presence of items in your datasets.

contains Common Errors and Solutions:

ValueError: value parameter is empty

  • Explanation: This error occurs when the value parameter is not provided or is an empty list, leading to an automatic False result.
  • Solution: Ensure that the value parameter is specified and contains the item you wish to search for in the list.

TypeError: Unsupported data types in list or value

  • Explanation: This error can occur if the data types in the list and value parameters are incompatible or not supported by the node.
  • Solution: Verify that the data types in both the list and value parameters are compatible and supported by the node, ensuring they can be compared correctly.

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