ComfyUI > Nodes > ComfyUI-0246 > Random Int

ComfyUI Node: Random Int

Class Name

0246.RandomInt

Category
0246
Author
Trung0246 (Account age: 3389days)
Extension
ComfyUI-0246
Latest Updated
2024-05-24
Github Stars
0.09K

How to Install ComfyUI-0246

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

Random Int Description

Generate random integers within specified range for AI artists, with various modes and batch processing support.

Random Int:

The 0246.RandomInt node is designed to generate random integers within a specified range, providing a versatile tool for AI artists who need to introduce randomness into their workflows. This node can handle various modes of operation, including keeping previous values, forcing new values, or using usual random generation methods. It supports batch processing, allowing you to generate multiple random integers at once, and can be seeded for reproducibility. The node ensures that the generated integers are within the defined minimum and maximum bounds, making it a reliable component for tasks requiring randomization.

Random Int Input Parameters:

val

This parameter accepts a string that defines the mode of random integer generation. The default value is "rand,0", and it does not support multiline input. This string can include specific instructions for how the random integers should be generated or manipulated.

min

This integer parameter sets the minimum value for the random integers. It has a default value of 0 and can range from -9007199254740991 to 9007199254740991. Setting this value ensures that no generated integer will be less than this minimum.

max

This integer parameter sets the maximum value for the random integers. It has a default value of 9007199254740991 and can range from -9007199254740991 to 9007199254740991. This ensures that no generated integer will exceed this maximum.

batch_size

This integer parameter determines the number of random integers to generate in one batch. The default value is 2, with a minimum of 1 and a maximum limited by the system's maximum integer size. This allows for efficient batch processing of random integers.

mode

This parameter is a list that defines the mode of operation for the random integer generation. The available options are "usual", "keep", and "force". Each mode dictates how the node handles the generation and storage of random integers, providing flexibility in its operation.

seed (optional)

This optional integer parameter sets the seed for the random number generator, ensuring reproducibility of the generated integers. The default value is 0, with a range from -1125899906842624 to 1125899906842624. Using a seed allows for consistent results across different runs.

_id (hidden)

This hidden parameter is a unique identifier for the node instance, used internally to track and manage the state of the random number generation.

Random Int Output Parameters:

rand_int

This output parameter returns a list of randomly generated integers. The integers are within the specified minimum and maximum bounds and are generated according to the defined mode and batch size. This output can be used directly in your workflow to introduce randomness where needed.

Random Int Usage Tips:

  • To ensure reproducibility, always set the seed parameter when you need consistent random integers across different runs.
  • Use the batch_size parameter to generate multiple random integers at once, which can be useful for batch processing tasks.
  • Experiment with different mode settings to understand how "usual", "keep", and "force" affect the random integer generation and choose the one that best fits your needs.

Random Int Common Errors and Solutions:

Min is greater than max.

  • Explanation: This error occurs when the minimum value is set higher than the maximum value.
  • Solution: Ensure that the min parameter is less than or equal to the max parameter.

Invalid value "<value>".

  • Explanation: This error occurs when an invalid value is provided in the val parameter string.
  • Solution: Check the val parameter string for any typos or unsupported values and correct them.

Seed out of range.

  • Explanation: This error occurs when the seed value is outside the allowed range.
  • Solution: Ensure that the seed parameter is within the range of -1125899906842624 to 1125899906842624.

Random Int Related Nodes

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