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

LayerUtility: RGB Value

RGB Value — split a color into its R, G, B numbers

By chflame163·Created 3 years ago·Updated 8 days ago· 3,118
LayerUtility: RGB Value
  • color_value
  • R
  • G
  • B

A small converter: feed it a color, get back its red, green, and blue channels as three separate numbers. That's it - but it's the node you reach for the moment you need to do math with a color instead of just displaying it. Pick a color visually with something like Color Picker, then split it here if you need to feed one channel into a threshold, a conditional, or a numeric input somewhere else in the graph.

How it works

color_value accepts a color in whatever form an upstream node hands it - most commonly a hex string like #FF8000 from a color widget or another LayerStyle color node. RGB Value parses that and returns the three 0–255 integer channels that make it up. There's no image involved and no sampling - it's a pure value-to-value conversion, not a "pick a pixel from this image" node.

The inputs and outputs that matter

  • color_value - the color to break apart. Wire in a hex string or a color output from another node in the pack.

Outputs: R, G, B - three plain integers, each 0–255, in that order. Wire any of them into a numeric node, a comparison, or a conditional if your workflow needs to branch or scale based on how bright, how red, or how blue a given color is.

How to install it

Ships as part of the LayerStyle pack. ComfyUI Manager: search ComfyUI Layer Style, install, restart. Manual:

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

Restart and it'll be under 😺dzNodes → LayerUtility → Data. Pure logic, no model files to fetch.

Common issues

The one real snag is format mismatch on the input. color_value is typed as a wildcard so ComfyUI's graph editor will let you connect almost anything to it, but under the hood it's expecting a color it can actually parse - a hex string is the safe bet. If you wire in something that isn't a recognizable color (a raw image, for instance, rather than a color value), expect an error rather than a sensible R/G/B split; that's a mismatch on your end, not the node malfunctioning.

Past that, the standard pack-wide issue applies: if this node - or any LayerUtility node - is simply absent from your menu, LayerStyle failed to import rather than this node being broken specifically. The usual trigger is a transformers/tensorflow version conflict dragged in by some other custom node pack sharing your Python environment, and it's especially common on an old install from before LayerStyle split into the base pack and the heavier LayerStyle Advance repo. Reinstall clean or use Manager's "Try Fix," and read the actual traceback before chasing the wrong node.

Category😺dzNodes/LayerUtility/Data

Inputs (1)

NameTypeDefaultDescription
color_value*—

Outputs (3)

NameTypeDescription
RINT—
GINT—
BINT—