Nodes/ComfyUI-NKD-Basic-Tools/😺NKD Gradient Map
ComfyUI Node

😺NKD Gradient Map

Recolor by brightness — instant duotones, teal-orange, and filmic grades

By Nekodificador·Created about a month ago·Updated 3 days ago· 71
😺NKD Gradient Map
  • image
  • mask
  • image
  • mask
â—„ramp{"stops": [{"pos": 0.0, "color": "#000000"}, {"pos": 1.0, "color": "#ffffff"}]}â–º
â—„invertfalseâ–º
â—„strength1.00â–º

Gradient mapping is the color-grading shortcut that looks like effort: darks land on one end of a color ramp, lights land on the other, and everything in between is a smooth translation of brightness into color. One ramp and a photo becomes a duotone, a teal-and-orange grade, a film stock look - the kind of thing that reads as "color graded" in a single node. 😺NKD Gradient Map does exactly that, with the grade updating live as you edit the ramp.

It shares the pack's color-ramp editor with 😺NKD Gradient Generate, which matters more than it sounds: you click the bar to add a stop, click a stop for the native color picker, drag to move, Shift-click to remove, and save/load your own ramps as presets. Once you've built a grade you like, it's a preset you can drop onto any image forever.

The inputs

  • image - the photo to recolor.
  • ramp - the color ramp, edited in the node. Default is a black→white ramp, which does nothing until you change it - worth knowing when you first drop the node in and nothing seems to happen.
  • invert - swap which end of the ramp lands on darks vs. lights. The fastest way to A/B a grade.
  • strength - how much of the effect shows through. 0 = original image, 1 = full effect. This is the dial that keeps gradient mapping from being a party trick: a duotone at 0.4 strength is a subtle grade; at 1.0 it's a poster.

The optional mask confines the recolor to part of the frame, feathered by its values - a grade on the sky only, or skin-only toning.

Outputs

image - the recolored photo. And mask, which is the luminance of the result - the grade itself as a mask. That's the output the docs highlight: if you've graded an image and want to use the grade's own brightness structure as a matte (for a composite, or to drive another effect), it's sitting right there.

Where it fits

This is the natural partner to the pack's procedural nodes: 😺NKD Noise's fBm output feeds straight into it to tint clouds or fog, and it's the fastest route to the "teal-orange blockbuster" and "duotone print" looks without any model re-roll. It's also a genuinely deterministic post-process - instant, repeatable, no diffusion pass involved. One honest note: it maps brightness, not hue, so it can't do "make the reds more orange." For that you want the wheel-based 😺NKD Color Warp.

Install and gotchas

Install via ComfyUI Manager (search ComfyUI-NKD-Basic-Tools) or:

cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-NKD-Basic-Tools

Restart after. Pack dependencies are onnxruntime and huggingface_hub; neither is needed here. The node is marked as an output node, so it previews and terminates its branch. And if your grade looks like a poster, the fix is almost always strength - the default of 1.0 is the "full effect" end, and most pleasing grades live well below it.

Category😺NKD Nodes/Basic

Inputs (5)

NameTypeDefaultDescription
imageIMAGE—
rampSTRING{"stops": [{"pos": 0.0, "color": "#000000"}, {"pos": 1.0, "color": "#ffffff"}]}The color ramp, edited above.
invertBOOLEANfalseSwap which end of the ramp lands on darks vs. lights.
strengthFLOAT1.000–1How much of the effect shows through. 0 = original image, 1 = full effect.
maskoptMASKOptional — confine the recolor to the mask, feathered by its values (soft edges blend in).

Outputs (2)

NameTypeDescription
imageIMAGEThe recolored image.
maskMASKLuminance of the result — use the grade as a mask.