Visit ComfyUI Online for ready-to-use ComfyUI environment
Generate random integer within specified range for AI art projects, ensuring controlled randomness and reproducibility.
The LogicUtil_UniformRandomInt
node is designed to generate a random integer within a specified range, providing a simple yet powerful tool for introducing randomness into your AI art projects. This node ensures that a random integer is selected between the given minimum and maximum values, and it gracefully handles cases where the minimum value is greater than the maximum by defaulting to the minimum value. This functionality is particularly useful for creating varied and dynamic outputs in generative art, where controlled randomness can lead to more interesting and unique results. By using a seed value, you can also ensure reproducibility of the random values, which is essential for consistent results in iterative design processes.
min_val
specifies the lower bound of the range from which the random integer will be selected. If this value is greater than max_val
, the node will default to this value. The minimum value for min_val
is -999999999, the maximum is 999999999, and the default is 0. This parameter allows you to control the starting point of the random selection range.
max_val
defines the upper bound of the range for the random integer selection. If min_val
is greater than this value, the node will default to min_val
. The minimum value for max_val
is -999999999, the maximum is 999999999, and the default is 1. This parameter sets the endpoint of the random selection range.
seed
is used to initialize the random number generator, ensuring that the sequence of random numbers can be reproduced if needed. The minimum value for seed
is 0, the maximum is 9999999999, and the default is 0. This parameter is crucial for achieving consistent results across different runs, which is particularly useful in iterative design processes.
The output parameter is an integer (INT
) that represents the randomly selected value within the specified range. This value can be used directly in your AI art projects to introduce controlled randomness, enhancing the variability and uniqueness of the generated outputs.
seed
parameter to a specific value. This is particularly useful when you need consistent results across different runs.min_val
and max_val
to introduce more variability in your outputs, which can lead to more dynamic and interesting results in your generative art projects.min_val
is less than or equal to max_val
. However, the node will handle cases where min_val
is greater by defaulting to min_val
.min_val
parameter is greater than the max_val
parameter.min_val
is less than or equal to max_val
. If this condition is not met, the node will default to min_val
, but it is good practice to set the parameters correctly to avoid confusion.seed
parameter is not an integer.seed
parameter. This ensures that the random number generator is initialized correctly.min_val
or max_val
is not an integer.min_val
and max_val
are set to integer values. This is necessary for the node to function correctly and generate a random integer within the specified range.© Copyright 2024 RunComfy. All Rights Reserved.