ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Text_Processor / 文本数字提取

ComfyUI Node: 🍒Text_Processor / 文本数字提取

Class Name

Text_Processor

Category
🍒 Kim-Nodes/🔍Text_Tools | 文本工具
Author
Kim (Account age: 2536days)
Extension
ComfyUI_KimNodes
Latest Updated
2025-09-22
Github Stars
0.05K

How to Install ComfyUI_KimNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI_KimNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_KimNodes 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_Processor / 文本数字提取 Description

Efficiently processes text by cleaning whitespace and extracting the first numerical value.

🍒Text_Processor / 文本数字提取:

The Text_Processor node is designed to handle and manipulate text inputs efficiently, providing both string and integer outputs. This node is particularly useful for tasks that involve extracting numerical data from text or processing the text content itself. By offering a streamlined approach to text manipulation, it allows you to easily clean up text, extract meaningful data, and prepare it for further analysis or use in creative projects. The node's primary function is to process the input text by removing unnecessary whitespace and optionally extracting the first numerical value found within the text. This makes it an essential tool for AI artists who need to preprocess text data for various applications, ensuring that the text is in the desired format and any relevant numerical information is readily available.

🍒Text_Processor / 文本数字提取 Input Parameters:

输入文本

This parameter accepts the text input that you wish to process. It is a multiline string, allowing you to input extensive text content. The default value is "请输入文本内容," which translates to "Please enter text content." This parameter is crucial as it serves as the primary data source for the node's processing functions.

提取数字

This boolean parameter determines whether the node should extract numbers from the input text. By default, it is set to True, meaning the node will attempt to find and extract the first numerical value present in the text. If set to False, the node will skip the number extraction process. This parameter is important for tasks where numerical data extraction is necessary, such as when dealing with text that contains measurements or quantities.

🍒Text_Processor / 文本数字提取 Output Parameters:

文本

This output provides the processed text after removing any leading or trailing whitespace. It ensures that the text is clean and ready for further use or analysis. This output is essential for maintaining text consistency and readability, especially when preparing text for display or further processing.

数字提取

This output returns the first numerical value extracted from the input text as an integer. If no numbers are found, it defaults to 0. This output is particularly useful for applications that require numerical data, such as statistical analysis or when the text contains important numerical information that needs to be isolated.

🍒Text_Processor / 文本数字提取 Usage Tips:

  • To ensure accurate number extraction, make sure that the input text contains clearly defined numerical values. This will help the node efficiently identify and extract the numbers you need.
  • Use the 提取数字 parameter wisely. If your task does not require number extraction, set it to False to optimize processing time and focus solely on text manipulation.

🍒Text_Processor / 文本数字提取 Common Errors and Solutions:

"AttributeError: 'str' object has no attribute 'strip'"

  • Explanation: This error occurs when the input provided is not a string, and the node attempts to apply the strip method, which is only available for string objects.
  • Solution: Ensure that the 输入文本 parameter is always a string. If you are dynamically generating or altering inputs, verify that they are converted to strings before being processed by the node.

"ValueError: invalid literal for int() with base 10"

  • Explanation: This error happens when the node tries to convert a non-numeric string to an integer during the number extraction process.
  • Solution: Check the input text to ensure that any numbers are correctly formatted and free from non-numeric characters. If necessary, preprocess the text to remove or correct any problematic characters before using the node.

🍒Text_Processor / 文本数字提取 Related Nodes

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