Color Ramp
The Blender-style color ramp you actually want in ComfyUI
- image
- image
If you've spent any time in Blender's shader editor, you know exactly what a color ramp is: you feed it a grayscale value and it paints it through a gradient you've defined. This node is that, living in ComfyUI, and it's the fun part of the TextureAlchemy pack - the node that turns a boring height or AO map into a stylized albedo, a heat map, or a rust-and-copper surface with a few clicks.
Here's the setup. You feed any image in, it converts to grayscale (using perceptual luminance weights, so a colorful albedo isn't just averaged blindly), and each pixel's brightness gets remapped through your gradient into a color. Brightness 0.0 hits the left end of your ramp, 1.0 hits the right, everything between interpolates. That's the entire mechanism, and it's GPU-accelerated, so even a 4K texture ramps in a blink.
The fun part is the color_stops widget. The pack ships a custom visual editor (color_ramp_widget.js in its web folder) that gives you the Blender-style gradient bar: click to add stops, drag to move them, double-click to remove, click a swatch for a color picker. You don't have to hand-edit the JSON that backs it - the widget manages that string for you. It's one of those rare cases where a custom node's UI actually justifies the hype.
If you'd rather not fiddle, the preset dropdown has your back:
heat- black → red → orange → yellow, the classic data-viz ramprainbow,gold_metal,rust,copper,blue_metal- material-flavored gradientsgrayscale,custom- plain or yours
interpolation controls the transition between stops: linear, ease_in, ease_out, and constant (hard banding). For metallic looks, ease curves give more believable falloff than raw linear; constant is how you make deliberate posterized bands.
In the wider PBR workflow this is where "AI extracted a height map and I want something art-directed" happens. The pack's own docs suggest Height → Gradient Map → Color Ramp → stylized albedo, which is a genuinely good pipeline: use the Gradient Map node to isolate a height range, then ramp it into gold or rust for a stylized material. It's also the fastest way to make an AO map look like a heat visualization if you're doing technical debug art.
Inputs: image, preset, interpolation, color_stops. Output: image. That's it - no hidden pipes.
Install: it's the pack, so ComfyUI Manager → search "Texture Alchemy" or:
cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy
Restart, then Texture Alchemist/Color → Color Ramp. No dependencies, no models. One honest caveat: if the visual gradient bar doesn't appear, you're likely on a stale node cache or an old front-end - refresh the browser hard, and if the widget still doesn't load, the presets and manual color_stops JSON still work fine.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| preset | COMBO | custom | Load a preset gradient or use custom colors |
| interpolation | COMBO | linear | Interpolation mode between color stops |
| color_stops | STRING | [{"pos":0.0,"r":0.0,"g":0.0,"b":0.0},{"pos":1.0,"r":1.0,"g":1.0,"b":1.0}] | Color stops data (managed by visual widget) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |