Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > Sage Utils > Text Select Line

ComfyUI Node: Text Select Line

Class Name

Sage_TextSelectLine

Category
Sage Utils/text
Author
arcum42 (Account age: 6442days)
Extension
Sage Utils
Latest Updated
2026-05-17
Github Stars
0.03K

How to Install Sage Utils

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

Text Select Line Description

Extracts a specified line from text by line number, ensuring safe operation even if out of range.

Text Select Line:

The Sage_TextSelectLine node is designed to extract a specific line from a block of text based on a given line number. This node is particularly useful when you need to isolate and work with a particular line within a larger text document, such as extracting a specific instruction or piece of information from a list. By allowing you to specify the line number, this node provides precise control over text manipulation tasks, making it an essential tool for text processing workflows. The node ensures that even if the specified line number exceeds the available lines, it will safely return the closest valid line, thus preventing errors and ensuring smooth operation.

Text Select Line Input Parameters:

text

The text parameter is a multiline string input that represents the block of text from which you want to select a specific line. This input is crucial as it serves as the source material for the node's operation. The text can contain multiple lines, and each line is separated by a newline character. The node processes this input by splitting it into individual lines, which are then used to determine the output based on the specified line number.

line_number

The line_number parameter is an integer input that specifies the index of the line you wish to extract from the provided text. Line numbers start from 0, meaning that if you want to select the first line, you should set this parameter to 0. The default value is 0, and it must be a non-negative integer. If the specified line number is greater than the number of available lines, the node will automatically adjust it to the last available line, ensuring that the operation does not result in an error.

Text Select Line Output Parameters:

selected_line

The selected_line output is a string that contains the line extracted from the input text based on the specified line number. This output is the result of the node's operation and represents the specific line you intended to isolate. If the input text is empty or the line number is out of range, the node will return an empty string, ensuring that the output is always valid and predictable.

Text Select Line Usage Tips:

  • Ensure that the text input contains the lines you want to work with, and verify that the lines are separated by newline characters to ensure proper line separation.
  • Use the line_number parameter to precisely target the line you need. Remember that line numbering starts from 0, so adjust your input accordingly.

Text Select Line Common Errors and Solutions:

Empty Output

  • Explanation: This occurs when the input text is empty or consists only of whitespace, resulting in no lines to select.
  • Solution: Ensure that the text input contains valid lines of text. Check for any unintended whitespace or empty input.

Line Number Out of Range

  • Explanation: If the specified line_number exceeds the number of lines in the text, the node will adjust it to the last available line.
  • Solution: Verify the total number of lines in your input text and adjust the line_number accordingly to ensure it falls within the valid range.

Text Select Line Related Nodes

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

Text Select Line