LayerStyle: Gradient Map
Gradient Map — remap tones to a three-color gradient
- image
- layer_mask
- image
- gradient
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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| start_color | STRING | #015A52 | — |
| mid_color | STRING | #02AF9F | — |
| end_color | STRING | #7FFFEC | — |
| mid_point | FLOAT | 0.600–1 | — |
| opacity | INT | 1000–100 | — |
| layer_maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| gradient | IMAGE | — |