Nodes/ComfyUI Layer Style/LayerStyle: Gradient Map
ComfyUI Node Runs on cloud

LayerStyle: Gradient Map

Gradient Map — remap tones to a three-color gradient

By chflame163·Created 3 years ago·Updated 4 days ago· 3,113
LayerStyle: Gradient Map
  • image
  • layer_mask
  • image
  • gradient
â—„start_color#015A52â–º
â—„mid_color#02AF9Fâ–º
â—„end_color#7FFFECâ–º
â—„mid_point0.60â–º
â—„opacity100â–º

If you've ever used a gradient map in Photoshop to turn a photo into a moody duotone or a teal-and-orange poster look, this is the same tool in ComfyUI. Gradient Map reads the brightness of your image and repaints it using a color gradient - shadows take one color, midtones another, highlights a third. It's a stylizing node, and a genuinely fun one for grading renders, building color-themed thumbnails, or slapping a consistent look across a batch.

How it works

A gradient map ignores the original hues and works purely off luminance. Every pixel's brightness becomes a position along your gradient: the darkest pixels get the start color, the brightest get the end color, everything in between interpolates. This node uses a three-stop gradient - start, mid, end - with a control for where the midpoint sits, so you can bias the transition toward the shadows or the highlights.

The inputs and outputs that matter

  • image (IMAGE) - the source whose tones get remapped.
  • start_color / mid_color / end_color - hex colors for shadows, midtones, highlights. The defaults are a teal set (#015A52 → #02AF9F → #7FFFEC), which is a fine preview but you'll want your own.
  • mid_point (default 0.6, range 0–1) - where the mid color lands along the tonal range. Push it down to give more image to the highlights, up to give more to the shadows.
  • opacity (default 100) - how strongly the gradient replaces the original. Drop it below 100 to blend the effect back over the untouched image, which is how you get a subtle grade instead of a full poster look.
  • layer_mask (optional MASK) - confine the effect to part of the image.

Two outputs: image (your picture with the gradient map applied) and gradient (the raw gradient itself as an image, handy for reusing or previewing the ramp).

How to install it

ComfyUI Manager: search ComfyUI Layer Style, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle

install requirements.txt, restart. Node's under 😺dzNodes → LayerStyle.

Common issues

No model, nothing to download - the only "problems" here are aesthetic. If the result looks flat or muddy, your three colors are probably too close in brightness; a gradient map reads tone, so pick colors with real light-to-dark separation (a dark start, a bright end) and the image keeps its contrast. If the effect is too heavy-handed, that's what opacity is for - pulling it to 40–60 gives a color grade rather than a full repaint. And if you only want it on the subject or the background, mask it with layer_mask.

Category😺dzNodes/LayerStyle

Inputs (7)

NameTypeDefaultDescription
imageIMAGE—
start_colorSTRING#015A52—
mid_colorSTRING#02AF9F—
end_colorSTRING#7FFFEC—
mid_pointFLOAT0.600–1—
opacityINT1000–100—
layer_maskoptMASK—

Outputs (2)

NameTypeDescription
imageIMAGE—
gradientIMAGE—