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: GetMainColorsV2

Documentation for LayerUtility: GetMainColorsV2 Node

Introduction

The LayerUtility: GetMainColorsV2 node is an advanced tool in ComfyUI designed to analyze an image and extract the predominant colors, along with detailed information on these colors. It is specifically useful for those who want to get a quick overview of the color scheme of an image, which can be advantageous in various creative and analytical workflows.

What This Node Does

The LayerUtility: GetMainColorsV2 node processes an input image using a k-means clustering algorithm to determine the main colors present in the image. It outputs these colors as both visual previews and textual information, providing insights into their relative proportions within the image.

Inputs

The node accepts the following inputs:

  • Image: This is the primary input, where you provide the image that you want to analyze for its color palette.

  • K-Means Algorithm: You can choose between two k-means clustering algorithms, "lloyd" and "elkan", to tailor the color extraction process based on your specific requirements.

Outputs

Upon processing the input image, the node produces the following outputs:

  1. Preview Image: An image displaying swatches of the main colors extracted from the input image, each labeled with detailed color information.

  2. Color 1 to Color 5: Five distinct color strings in hexadecimal format representing the most predominant colors in the image, sorted by prevalence.

Usage in ComfyUI Workflows

The node is typically used in workflows where understanding and manipulating the color scheme of an image is necessary. It can be an initial step in design processes, allowing designers to extract and utilize the primary colors from an image to inform their color choices. Additionally, the node is beneficial for tasks involving image analysis and color management across different media formats.

To use this node effectively in a ComfyUI workflow:

  1. Image Analysis: Load the image you wish to analyze into the workflow.
  2. Color Extraction: Configure the k-means algorithm option to extract colors that best suit the desired level of precision.
  3. Review and Application: Utilize the output colors in further design or creative processes, or to compare how different algorithms might extract different sets of colors from similar images.

Special Features and Considerations

  • Precision and Customization: The node provides two algorithm options for extracting colors, offering flexibility depending on the precision requirements.

  • Detailed Color Information: Along with hexadecimal color values, each color is listed with RGB and HSB values. This information helps in understanding the hue, saturation, and brightness aspects of the colors.

  • Visual Output: The preview image output is beneficial for a quick visual reference and can be used to inform further modifications to the image or other elements in a design.

By leveraging these features, users can gain insightful color data from images, which can facilitate a wide range of use cases from digital media creation to aesthetic analysis in various domains.