ComfyUI > Nodes > CRT-Nodes > String Line Counter (CRT)

ComfyUI Node: String Line Counter (CRT)

Class Name

CRT_StringLineCounter

Category
CRT/utils
Author
CRT (Account age: 1707days)
Extension
CRT-Nodes
Latest Updated
2026-03-16
Github Stars
0.1K

How to Install CRT-Nodes

Install this extension via the ComfyUI Manager by searching for CRT-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter CRT-Nodes 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

String Line Counter (CRT) Description

Counts text lines efficiently, handling various newline characters for accurate text analysis.

String Line Counter (CRT):

The CRT_StringLineCounter node is a utility designed to efficiently count the number of lines in a given text input. This node is particularly useful for scenarios where you need to process or analyze text data and require an accurate count of lines, which can be crucial for formatting, data parsing, or simply understanding the structure of the text. By leveraging the count_lines method, the node automatically handles different newline characters such as \n, \r, and \r\n, ensuring compatibility across various text formats. This functionality is essential for AI artists and developers who work with text data, as it provides a straightforward and reliable way to quantify the number of lines, aiding in tasks like text analysis, content generation, or preprocessing text for further operations.

String Line Counter (CRT) Input Parameters:

text

The text parameter is a multiline string input that the node processes to count the number of lines. This parameter accepts any string value, including those with multiple lines separated by newline characters. The function of this parameter is to provide the text content that will be analyzed by the node. The impact of this parameter on the node's execution is direct, as the line count result is entirely dependent on the content of the text input. There are no explicit minimum or maximum values for this parameter, but it defaults to an empty string if not specified. This means that if no text is provided, the node will return a line count of zero.

String Line Counter (CRT) Output Parameters:

INT

The output parameter is an integer (INT) that represents the total number of lines counted in the provided text input. This output is crucial as it gives a clear and concise numerical representation of the line count, which can be used for further processing or decision-making in your workflow. The interpretation of this output is straightforward: it tells you how many lines are present in the input text, considering all types of newline characters. This information can be particularly valuable when dealing with large text files or when you need to ensure that text data is formatted correctly before proceeding with additional operations.

String Line Counter (CRT) Usage Tips:

  • Ensure that the text input is correctly formatted with newline characters to get an accurate line count.
  • Use this node to preprocess text data before performing operations that depend on the number of lines, such as batch processing or text segmentation.

String Line Counter (CRT) Common Errors and Solutions:

Empty Input Text

  • Explanation: The input text is empty, resulting in a line count of zero.
  • Solution: Verify that the text input is not empty and contains the expected content before passing it to the node.

Incorrect Line Count

  • Explanation: The line count may be incorrect if the text input does not use standard newline characters.
  • Solution: Ensure that the text input uses standard newline characters (\n, \r, or \r\n) to separate lines for accurate counting.

String Line Counter (CRT) Related Nodes

Go back to the extension to check out more related nodes.
CRT-Nodes
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.