LayerStyle

2167
By chflame
Updated 15 days ago
View on GitHub →See Common Issues →

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.

Available Nodes

LayerUtility: RandomGeneratorV2

LayerUtility: Random Generator V2 Node Documentation

Introduction

The LayerUtility: Random Generator V2 node is part of the ComfyUI node collection and offers users a flexible way to generate random numbers with specific characteristics. This node is designed to cater to a variety of use cases that require random number generation, including scenarios with constraints on numerical ranges and decimal precision.

Node Functionality

This node generates random integers, floating-point numbers, and boolean values. It can be configured to:

  • Control the range of the generated numbers
  • Set the precision of floating-point numbers
  • Use a specific seed for determinism

Inputs

Required Inputs

  • Min Value: The minimum value that can be generated. It can be any floating-point number within the range [-1.0e14, 1.0e14]. The default value is 0.

  • Max Value: The maximum value that can be generated. It similarly spans the range [-1.0e14, 1.0e14], with a default of 10.

  • Least: The least positive value that should be considered significant when generating numbers. This value ranges from 0 to 1.0e14, defaulting to 0.

  • Float Decimal Places: The number of decimal places for the generated floating-point numbers. This is adjustable from 1 to 14, with a default of 1.

  • Seed: An integer value used for initializing the random number generator. The seed ensures deterministic behavior if set. The seed can be any positive integer up to 1e14, with a default of 0.

Optional Inputs

  • Image: An image input can be provided to determine the batch size for the generation process. If the image input is provided, random numbers are generated for each image in the batch.

Outputs

This node generates three types of output:

  • Integer: The integer part of the generated floating-point number.

  • Float: A floating-point number generated within the specified constraints.

  • Boolean: A boolean value indicating whether the generated integer is even.

Usage in ComfyUI Workflows

The LayerUtility: Random Generator V2 node can be utilized in ComfyUI workflows where randomization is necessary. Some potential use cases include:

  • Creating variable effects in graphic design applications where randomness in values can lead to unique visual styles.

  • Testing scenarios where multiple inputs are needed, and variations of those inputs are generated randomly.

  • Data processing tasks requiring batch randomization based on associated image data.

Special Features and Considerations

  • Deterministic Randomization: By utilizing the seed input, users can ensure that random number generation remains consistent across runs, enabling reproducible results.

  • Least Value Consideration: The least value input acts as a floor for randomness, ensuring generated numbers do not fall below a certain threshold. This is particularly useful for ensuring significance in generated values.

  • Batch Processing: When an image input is provided, the node processes data in batches, generating a unique set of numbers for each image.

While the LayerUtility: Random Generator V2 node excels in versatility and customization, care should be taken to set appropriate numerical ranges and precisions to fit the specific needs of the workflow.