ComfyUI > Nodes > ComfyUI-YCNodes > Extract Number (YC)

ComfyUI Node: Extract Number (YC)

Class Name

YC Extract Number

Category
YCNode/Logic
Author
yichengup (Account age: 473days)
Extension
ComfyUI-YCNodes
Latest Updated
2025-06-03
Github Stars
0.02K

How to Install ComfyUI-YCNodes

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

Extract Number (YC) Description

Efficiently extract numerical values from text input, automate extraction with default value support for versatility.

Extract Number (YC):

The YC Extract Number node is designed to efficiently extract numerical values from a given text input. This node is particularly useful when you need to parse and retrieve numbers embedded within strings, which can be a common requirement in various data processing tasks. By leveraging this node, you can automate the extraction of numbers, ensuring accuracy and consistency in your data handling processes. The node is capable of handling cases where no numbers are found by providing a default value, making it robust and versatile for different scenarios. Its primary goal is to simplify the task of number extraction from text, providing a straightforward and reliable solution for users who may not have a technical background.

Extract Number (YC) Input Parameters:

text

The text parameter is a string input where you provide the text from which you want to extract numbers. This parameter is crucial as it serves as the source of data for the node to process. The text can be any string, and the node will search through it to find numerical values. There are no specific minimum or maximum values for this parameter, as it is a free-form text input. The default value is an empty string, which means if no text is provided, the node will not have any data to process.

default_value

The default_value parameter is an integer that specifies the value to return if no numbers are found in the provided text. This parameter ensures that the node can still produce a meaningful output even when the text does not contain any numbers. The default value for this parameter is 0, but you can set it to any integer that suits your needs. This flexibility allows you to define a fallback value that aligns with your specific use case, ensuring that your workflow remains uninterrupted even in the absence of numerical data in the text.

Extract Number (YC) Output Parameters:

number

The number output parameter is an integer that represents the numerical value extracted from the input text. If the node successfully finds a number within the text, this parameter will contain that value. In cases where no numbers are found, the number parameter will return the default_value specified in the input parameters. This output is essential for further processing or analysis, as it provides a clear and concise representation of the numerical data extracted from the text.

Extract Number (YC) Usage Tips:

  • Ensure that the text input is correctly formatted and contains the numbers you wish to extract, as the node will only search for numerical values within the provided string.
  • Utilize the default_value parameter to handle cases where the text may not contain any numbers, allowing your workflow to continue smoothly without interruptions.

Extract Number (YC) Common Errors and Solutions:

No numbers found in text

  • Explanation: This error occurs when the node is unable to find any numerical values within the provided text input.
  • Solution: Verify that the text input contains numbers. If the absence of numbers is expected, ensure that the default_value parameter is set to an appropriate fallback value.

Invalid text input

  • Explanation: This error may arise if the text input is not a valid string or is improperly formatted.
  • Solution: Check that the text input is a valid string and is correctly formatted. Ensure that the input is not empty unless an empty string is intended for processing.

Extract Number (YC) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-YCNodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.