ComfyUI Node: in range

Class Name

Basic data handling: NumberInRange

Category
Basic/comparison
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 range Description

The `NumberInRange` node checks if a number is within specified inclusive or exclusive bounds.

in range:

The NumberInRange node is designed to determine whether a given number falls within a specified range. This node is particularly useful when you need to validate numerical inputs against defined boundaries, ensuring they meet certain criteria. It allows you to specify both the minimum and maximum bounds of the range and provides the flexibility to decide whether these bounds are inclusive or exclusive. This capability is essential for scenarios where precise control over numerical data is required, such as in data validation processes or when setting constraints in computational models. By using this node, you can easily automate the process of checking if a number is within a desired range, thereby enhancing the robustness and reliability of your data handling workflows.

in range Input Parameters:

value

The value parameter represents the number you want to check against the specified range. It is a floating-point number, allowing for precise numerical comparisons. This parameter is crucial as it determines the subject of the range check. There is no explicit minimum or maximum value for this parameter, but it should be a valid number within the context of your application.

min_value

The min_value parameter defines the lower boundary of the range. It is a floating-point number with a default value of 0. This parameter sets the starting point of the range and plays a critical role in determining whether the value is considered within the range. You can adjust this parameter to suit the specific requirements of your application.

max_value

The max_value parameter specifies the upper boundary of the range. Like min_value, it is a floating-point number, with a default value of 100. This parameter establishes the endpoint of the range, and together with min_value, it defines the complete range within which the value is evaluated.

include_min

The include_min parameter is a boolean that determines whether the min_value is inclusive in the range check. By default, it is set to "True", meaning the min_value is included in the range. If set to "False", the range check will exclude the min_value, requiring the value to be strictly greater than min_value.

include_max

The include_max parameter is a boolean that specifies whether the max_value is inclusive in the range check. It defaults to "True", indicating that the max_value is part of the range. Setting this parameter to "False" will exclude the max_value, necessitating that the value be strictly less than max_value.

in range Output Parameters:

in_range

The in_range output parameter is a boolean that indicates whether the value falls within the specified range. If the value meets the criteria defined by min_value, max_value, include_min, and include_max, this parameter will return True. Otherwise, it will return False. This output is essential for making decisions based on whether a number satisfies the defined range conditions.

in range Usage Tips:

  • Use the include_min and include_max parameters to fine-tune the inclusivity of your range checks, allowing for precise control over boundary conditions.
  • When working with floating-point numbers, consider the precision of your inputs and the potential impact on range checks, especially when using exclusive bounds.

in range Common Errors and Solutions:

ValueError: invalid literal for float()

  • Explanation: This error occurs when the value, min_value, or max_value parameters are not valid floating-point numbers.
  • Solution: Ensure that all numerical inputs are correctly formatted as floating-point numbers and do not contain any invalid characters or symbols.

TypeError: '>' not supported between instances of 'str' and 'float'

  • Explanation: This error arises when a string is mistakenly passed as a numerical input, causing a type mismatch during comparison.
  • Solution: Verify that all inputs are of the correct type, converting strings to floats if necessary before passing them to the node.

in range 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 range