Nodes/ComfyUI Layer Style/LayerUtility: HSV Value
ComfyUI Node Runs on cloud

LayerUtility: HSV Value

HSV Value — break a color down into hue, saturation, and value

By chflame163·Created 3 years ago·Updated 5 days ago· 3,114
LayerUtility: HSV Value
  • color_value
  • H
  • S
  • V

The sibling to Gray Value, and just as small: instead of collapsing a color down to one brightness number, this one splits it into its three HSV components - hue, saturation, and value - as separate integers you can wire around independently. Reach for it when you need to react to a specific property of a color rather than its overall brightness: "is this color saturated or washed out," "what hue family is this," "is it dark regardless of hue."

How it works

Standard RGB-to-HSV conversion, the same math your image editor uses when it shows you a color picker's H/S/V sliders. Hue describes the color family (where it sits around the color wheel), saturation how intense or muted it is, and value how light or dark. Splitting these apart is useful precisely because they're independent - two colors can share a hue but differ wildly in saturation or value, and averaging them down to one "brightness" number (which is what Gray Value does) would hide that difference.

The inputs and outputs that matter

One input, color_value, untyped so it accepts a color string from any color-producing node in the pack - Get Main Colors, Name To Color, or a plain typed hex value.

Three outputs, all INT: H, S, V. Wire whichever one you actually need - for example, gate a conditional on S to detect "this is basically grayscale," or route on V to branch light-background vs. dark-background logic without caring about hue at all. You can also ignore the two you don't need entirely; unused outputs don't cost you anything, so it's fine to grab just H if hue is the only thing driving your downstream logic.

How to install it

Search ComfyUI Layer Style in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt

Restart; it's under 😺dzNodes → LayerUtility → Data, right next to Gray Value. No models, no extra dependencies beyond the base pack install.

Common issues

Same story as its sibling node: color_value accepts "anything," so the failure mode when you feed it garbage isn't a wrong number, it's an error - the node needs something that actually parses as a color, not arbitrary text. The one conceptual trap worth flagging: people sometimes expect S and V to behave like percentages out of the box and get confused by the integer range - check what scale your downstream node expects and rescale if needed, since this node reports raw HSV integers, not a normalized 0–1 float. It's also easy to reach for Gray Value when you actually wanted HSV Value's V output, or vice versa - they overlap conceptually (both describe "how light or dark"), but V in HSV is a simpler max-channel calculation while Gray Value's luminance formula weights the channels by perceived brightness, so the two numbers genuinely can differ on the same color. Beyond that, it's a clean, predictable conversion with nothing else to debug.

Category😺dzNodes/LayerUtility/Data

Inputs (1)

NameTypeDefaultDescription
color_value*—

Outputs (3)

NameTypeDescription
HINT—
SINT—
VINT—