ComfyUI > Nodes > ComfyUI-JDCN > LogicUtil_Uniform Random Float

ComfyUI Node: LogicUtil_Uniform Random Float

Class Name

LogicUtil_UniformRandomFloat

Category
LogicUtil
Author
daxcay (Account age: 93days)
Extension
ComfyUI-JDCN
Latest Updated
2024-06-13
Github Stars
0.06K

How to Install ComfyUI-JDCN

Install this extension via the ComfyUI Manager by searching for ComfyUI-JDCN
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-JDCN 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

LogicUtil_Uniform Random Float Description

Generate random float within range for AI art projects, adjustable decimal places, seed for reproducibility.

LogicUtil_Uniform Random Float:

The LogicUtil_UniformRandomFloat node is designed to generate a random floating-point number within a specified range. This node is particularly useful when you need to introduce variability or randomness into your AI art projects. It ensures that the generated float falls between the minimum and maximum values you set, and it can be fine-tuned to a specific number of decimal places. If the minimum value is greater than the maximum value, the node will default to the minimum value to avoid errors. This node also allows for reproducibility by accepting a seed value, which ensures that the same random number can be generated consistently if needed.

LogicUtil_Uniform Random Float Input Parameters:

min_val

This parameter sets the lower bound of the range from which the random float will be selected. It accepts floating-point numbers and has a default value of 0.0. The minimum value it can take is -999999999, and the maximum is 999999999.0. Adjusting this value will change the starting point of the range for the random number generation.

max_val

This parameter sets the upper bound of the range from which the random float will be selected. It accepts floating-point numbers and has a default value of 1.0. The minimum value it can take is -999999999, and the maximum is 999999999.0. Adjusting this value will change the endpoint of the range for the random number generation.

decimal_places

This parameter determines the number of decimal places to which the generated random float will be rounded. It accepts integer values and has a default value of 1. The minimum value is 0, and the maximum is 10. Setting this value to 0 will result in an integer, while higher values will provide more precision.

seed

This parameter allows you to set a seed value for the random number generator. It accepts integer values and has a default value of 0. The minimum value is 0, and the maximum is 9999999999. Using the same seed value will produce the same random float, which is useful for reproducibility.

LogicUtil_Uniform Random Float Output Parameters:

FLOAT

The output is a single floating-point number that falls within the specified range and is rounded to the specified number of decimal places. This value can be used in various parts of your AI art project to introduce controlled randomness.

LogicUtil_Uniform Random Float Usage Tips:

  • To generate a random float within a specific range, ensure that min_val and max_val are set to your desired bounds.
  • Use the decimal_places parameter to control the precision of the generated float, which can be useful for fine-tuning effects in your project.
  • Set the seed parameter to a specific value if you need to reproduce the same random float in multiple runs.

LogicUtil_Uniform Random Float Common Errors and Solutions:

"min_val is greater than max_val"

  • Explanation: This error occurs when the minimum value is set higher than the maximum value.
  • Solution: Ensure that min_val is less than or equal to max_val to avoid this error.

"Invalid decimal_places value"

  • Explanation: This error occurs when the decimal_places parameter is set to a value outside the allowed range (0 to 10).
  • Solution: Adjust the decimal_places parameter to be within the range of 0 to 10.

"Seed value out of range"

  • Explanation: This error occurs when the seed parameter is set to a value outside the allowed range (0 to 9999999999).
  • Solution: Ensure that the seed parameter is within the range of 0 to 9999999999.

LogicUtil_Uniform Random Float Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-JDCN
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.