ComfyUI > Nodes > ComfyUI-LogicUtils > Triangular Random Float

ComfyUI Node: Triangular Random Float

Class Name

TriangularRandomFloat

Category
Logic Gates
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

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

Triangular Random Float Description

Generates random float using triangular distribution, defined by lower, upper limits, and mode.

Triangular Random Float:

The TriangularRandomFloat node is designed to generate a random floating-point number based on a triangular distribution, which is a continuous probability distribution shaped like a triangle. This node is particularly useful when you want to simulate a random process where values around a specific mode are more likely to occur, providing a more realistic distribution compared to uniform randomness. The triangular distribution is defined by a lower limit, an upper limit, and a mode, which is the most likely value. This node ensures that if the minimum value is greater than the maximum value, it will default to the minimum value, thus preventing errors and ensuring smooth operation. This feature makes it a robust choice for generating random values in scenarios where a specific distribution pattern is desired.

Triangular Random Float Input Parameters:

low

The low parameter specifies the minimum value of the range from which the random float will be selected. It defines the lower bound of the triangular distribution. The minimum value for this parameter is -999999999, the maximum is 999999999.0, and the default value is 0.0. This parameter is crucial as it sets the starting point of the distribution, influencing the range and potential outcomes of the random number generation.

high

The high parameter sets the maximum value of the range for the random float selection, defining the upper bound of the triangular distribution. The minimum value for this parameter is -999999999, the maximum is 999999999.0, and the default value is 1.0. This parameter is important because it determines the endpoint of the distribution, affecting the spread and possible values that can be generated.

mode

The mode parameter indicates the most likely value within the specified range, effectively shaping the peak of the triangular distribution. The minimum value for this parameter is -999999999, the maximum is 999999999.0, and the default value is 0.5. This parameter is essential as it influences the skewness of the distribution, determining where the highest probability of occurrence lies within the range.

seed

The seed parameter is an integer that initializes the random number generator, ensuring reproducibility of results. The minimum value is 0, the maximum is 2^63-1, and the default value is 0. By setting a specific seed, you can generate the same sequence of random numbers across different runs, which is useful for debugging and testing purposes.

Triangular Random Float Output Parameters:

FLOAT

The output of the TriangularRandomFloat node is a single floating-point number that falls within the specified range and follows the triangular distribution defined by the low, high, and mode parameters. This output is significant as it provides a random value that is more likely to be near the mode, offering a realistic simulation of scenarios where certain outcomes are more probable than others.

Triangular Random Float Usage Tips:

  • To achieve a balanced distribution where the most likely value is centered, set the mode parameter to be the midpoint between low and high.
  • Use the seed parameter to generate consistent results across multiple runs, which is particularly useful for testing and comparing outcomes.

Triangular Random Float Common Errors and Solutions:

Min value is greater than max value

  • Explanation: This error occurs when the low parameter is set to a value greater than the high parameter.
  • Solution: Ensure that the low parameter is less than or equal to the high parameter. The node will automatically default to the low value if this condition is not met, but it's best practice to set the parameters correctly.

Invalid mode value

  • Explanation: The mode parameter is set outside the range defined by low and high.
  • Solution: Adjust the mode parameter to ensure it falls within the low and high range to maintain a valid triangular distribution.

Triangular Random Float Related Nodes

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

Triangular Random Float