ComfyUI  >  Nodes  >  Bmad Nodes >  SampleColorHSV

ComfyUI Node: SampleColorHSV

Class Name

SampleColorHSV

Category
Bmad/CV/Color A.
Author
bmad4ever (Account age: 3591 days)
Extension
Bmad Nodes
Latest Updated
8/2/2024
Github Stars
0.1K

How to Install Bmad Nodes

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

SampleColorHSV Description

Extracts color samples from RGB image, converts to HSV for AI color analysis, grading, and segmentation with reproducible sampling.

SampleColorHSV:

The SampleColorHSV node is designed to extract a representative set of color samples from an RGB image and convert them into the HSV color space. This node is particularly useful for AI artists who need to analyze and manipulate colors within an image. By sampling a specified number of pixels from the image and converting these samples to HSV, you can gain insights into the color distribution and characteristics of the image. This can be beneficial for tasks such as color grading, palette extraction, and image segmentation. The node ensures that the sampling process is both random and reproducible by allowing you to set a seed for the random number generator.

SampleColorHSV Input Parameters:

rgb_image

This parameter expects an image in RGB format. The image serves as the source from which color samples will be extracted. The quality and content of the image directly impact the resulting HSV samples, as the node will randomly select pixels from this image to analyze.

sample_size

This integer parameter determines the number of pixels to sample from the RGB image. The default value is 1000, with a minimum of 1 and a maximum of 65536 (256 * 256). A larger sample size provides a more comprehensive representation of the image's color distribution but requires more computational resources.

sampling_seed

This integer parameter sets the seed for the random number generator used in the sampling process. The default value is 0, with a minimum of 0 and a maximum value determined by the system's maximum integer size. Setting a specific seed ensures that the sampling process is reproducible, allowing you to obtain the same set of samples each time you run the node with the same seed.

SampleColorHSV Output Parameters:

HSV_SAMPLES

The output is an object containing the sampled pixels converted to the HSV color space. This object provides a structured way to access and analyze the HSV values of the sampled pixels, enabling further color-based operations and analyses.

SampleColorHSV Usage Tips:

  • To get a more accurate representation of the image's color distribution, consider increasing the sample_size parameter, especially for images with a high level of detail or color variation.
  • Use the sampling_seed parameter to ensure reproducibility in your experiments. This is particularly useful when you need to compare results across different runs or share your workflow with others.
  • Combine this node with other color manipulation nodes to create complex color-based effects or analyses. For example, you can use the HSV samples to build color ranges or perform color-based segmentation.

SampleColorHSV Common Errors and Solutions:

"Invalid image format"

  • Explanation: The input image is not in the expected RGB format.
  • Solution: Ensure that the image provided to the rgb_image parameter is in RGB format. Convert the image to RGB if it is in a different format.

"Sample size out of range"

  • Explanation: The sample_size parameter is set to a value outside the allowed range.
  • Solution: Adjust the sample_size parameter to be within the range of 1 to 65536.

"Sampling seed out of range"

  • Explanation: The sampling_seed parameter is set to a value outside the allowed range.
  • Solution: Ensure that the sampling_seed parameter is set to a value between 0 and the system's maximum integer size.

SampleColorHSV Related Nodes

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