ComfyUI Node: contains

Class Name

Basic data handling: ListContains

Category
Basic/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 `ListContains` node checks if a specified value exists in a list, aiding data validation and filtering.

contains:

The ListContains 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, which can be a common requirement in various data processing and manipulation tasks. By providing a straightforward mechanism to check for membership, the ListContains node helps streamline workflows that involve conditional logic based on the presence or absence of elements in a list. This functionality is essential for tasks that require validation, filtering, or decision-making processes based on list contents, making it a valuable tool for AI artists who need to manage and manipulate data collections effectively.

contains Input Parameters:

list

The list parameter represents the collection of items in which you want to check for the presence of a specific value. This parameter can accept any type of list, including lists of numbers, strings, or mixed data types. The contents of this list determine the scope of the search operation performed by the node. There are no specific minimum or maximum values for this parameter, as it is designed to handle lists of varying lengths and types. The effectiveness of the node's operation depends on the accuracy and relevance of the items contained within this list.

value

The value parameter specifies the item you are searching for within the provided list. This parameter can be of any data type, matching the types of elements within the list. The node checks if this value is present in the list and returns a boolean result based on the outcome. The value parameter is crucial for defining the target of the search operation, and its correct specification ensures the node functions as intended. There are no default values for this parameter, as it must be explicitly provided to perform the search.

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 within the list, the output will be True; otherwise, it will be False. This output is essential for decision-making processes, as it provides a clear and concise result that can be used to trigger subsequent actions or logic based on the presence or absence of the value in the list. The simplicity of this output makes it easy to integrate into larger workflows and systems.

contains Usage Tips:

  • Ensure that the list parameter contains elements of the same type as the value parameter to avoid unexpected results.
  • Use the ListContains node in conjunction with other nodes to build complex logic flows that depend on the presence of specific items in a list.

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, which prevents the node from performing the search operation.
  • Solution: Ensure that the value parameter is specified and contains the item you wish to search for in the list.

TypeError: Unsupported data type in list or value

  • Explanation: This error arises when the list or value parameters contain unsupported or incompatible data types, leading to a failure in the search operation.
  • Solution: Verify that the data types of the elements in the list and the value are compatible and supported by the node. Adjust the data types if necessary to ensure compatibility.

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.