ComfyUI > Nodes > Basic data handling > in (contains)

ComfyUI Node: in (contains)

Class Name

Basic data handling: StringIn

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

in (contains) Description

StringIn node checks for a substring in a string using Python's `in` operator, returning a boolean.

in (contains):

The StringIn node is designed to determine whether a specified substring exists within a given string. This node leverages the Python in operator, which is a straightforward and efficient way to check for the presence of a substring. By returning a boolean value, it provides a simple yet powerful mechanism for string analysis, allowing you to quickly ascertain if a particular sequence of characters is part of a larger string. This functionality is particularly useful in scenarios where you need to validate input, search for keywords, or filter data based on string content.

in (contains) Input Parameters:

string

This parameter represents the main string in which you want to search for the presence of a substring. It is the primary input against which the search operation is performed. The default value is an empty string, and there are no specific minimum or maximum length constraints, allowing you to input any string you wish to analyze.

substring

This parameter is the sequence of characters you are looking to find within the main string. It acts as the search query in the operation. Like the string parameter, it defaults to an empty string, and there are no restrictions on its length, enabling you to search for any substring you need to identify.

in (contains) Output Parameters:

boolean

The output is a boolean value that indicates whether the specified substring is found within the main string. If the substring is present, the output will be True; otherwise, it will be False. This output is crucial for decision-making processes where the presence or absence of a substring can influence subsequent actions or logic flows.

in (contains) Usage Tips:

  • Use the StringIn node to quickly verify if a keyword or phrase is present in user input or data fields, which can be particularly useful for validation or filtering tasks.
  • Combine this node with other string manipulation nodes to create complex string processing workflows, such as checking for multiple substrings or performing actions based on the presence of certain text.

in (contains) Common Errors and Solutions:

Empty string or substring

  • Explanation: If both the string and substring parameters are empty, the node will return True because an empty substring is technically present in any string, including an empty one.
  • Solution: Ensure that at least one of the parameters is non-empty to avoid unintended results.

Incorrect data type

  • Explanation: If a non-string data type is passed to either the string or substring parameters, the node may not function as expected.
  • Solution: Always ensure that the inputs are of string type to guarantee correct operation.

in (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.

in (contains)