ComfyUI Node

Curve

Photoshop-style tone curves for color grading a render

By licyk·Created 2 years ago·Updated 12 months ago· 14
Curve
  • image
  • image
all_x_point_163
all_y_point_163
all_x_point_2127
all_y_point_2127
all_x_point_3191
all_y_point_3191
r_x_point_163
r_y_point_163
r_x_point_2127
r_y_point_2127
r_x_point_3191
r_y_point_3191
g_x_point_163
g_y_point_163
g_x_point_2127
g_y_point_2127
g_x_point_3191
g_y_point_3191
b_x_point_163
b_y_point_163
b_x_point_2127
b_y_point_2127
b_x_point_3191
b_y_point_3191

Diffusion output tends to run hot - oversaturated, high-contrast, a little too punchy compared to an actual photograph. The standard fix in photo editing has always been a tone curve: remap shadows, midtones, and highlights independently instead of just dragging a single contrast or saturation slider. Curve brings that exact tool into your graph, four channels (overall + R/G/B) at once, so you can flatten contrast a touch or push a color cast without leaving ComfyUI.

How it works

Each channel - all (affects everything), plus r, g, and b separately - gets three control points, each defined by an x (input tone, 0–255) and y (output tone, 0–255). The node maps input pixel values through this curve: a point sitting on the diagonal (input equals output) does nothing; move a point's y value above or below its x value and you're brightening or darkening that part of the tonal range. It's the same three-point curve tool from any photo editor, just exposed as numbers instead of a draggable graph.

The inputs and outputs that matter

Twelve numeric fields, one image input, one image output. All twelve follow the same pattern per point: an _x_point_N and _y_point_N pair, for N in 1–3, across four channel prefixes:

  • all_* - global tone curve, affects every channel together. Point 1 sits around the shadows (default 63/63), point 2 around midtones (127/127), point 3 around highlights (191/191).
  • r_*, g_*, b_* - the same three-point structure, but applied to a single color channel. This is where color grading actually happens: push a channel's midtone y-value up and that color gets stronger in the midtones; pull it down and the opposite color dominates.

The defaults for every point sit exactly on the diagonal (x equals y at all three points), which means out of the box this node does nothing - you have to move a y-value away from its x-value to see any change. Think of it as "point 1 = shadows, point 2 = midtones, point 3 = highlights," and nudge one at a time rather than all twelve at once.

How to install it

Search ComfyUI-HakuImg in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone --recurse-submodules https://github.com/licyk/ComfyUI-HakuImg

Restart ComfyUI, then look under Image → HakuImg. Pure pixel math, no models, no GPU dependency.

Common issues & troubleshooting

Changed the numbers, nothing happened. Double-check you moved a y_point value, not the x_point. Moving x alone just shifts where on the input range the curve bends, without changing whether it bends up or down - it's the y value that actually alters brightness/color.

Trying to flatten oversaturated diffusion output. Pull all_y_point_2 (the midtone point) down slightly from its default of 127 to reduce overall contrast, and consider a very slight push on r/b in opposite directions for a subtle warm or cool cast - that combination is the standard "make it look less like a raw render" move.

There's no visual curve widget. Unlike Photoshop, you're setting numbers, not dragging a line on a graph. If you're used to eyeballing a curve visually, it helps to sketch the shape you want on paper first (or just move one point, generate, look, repeat) rather than trying to set all three points blind.

Categoryimage/HakuImg

Inputs (25)

NameTypeDefaultDescription
imageIMAGE
all_x_point_1INT630–255
all_y_point_1INT630–255
all_x_point_2INT1270–255
all_y_point_2INT1270–255
all_x_point_3INT1910–255
all_y_point_3INT1910–255
r_x_point_1INT630–255
r_y_point_1INT630–255
r_x_point_2INT1270–255
r_y_point_2INT1270–255
r_x_point_3INT1910–255
r_y_point_3INT1910–255
g_x_point_1INT630–255
g_y_point_1INT630–255
g_x_point_2INT1270–255
g_y_point_2INT1270–255
g_x_point_3INT1910–255
g_y_point_3INT1910–255
b_x_point_1INT630–255
b_y_point_1INT630–255
b_x_point_2INT1270–255
b_y_point_2INT1270–255
b_x_point_3INT1910–255
b_y_point_3INT1910–255

Outputs (1)

NameTypeDescription
imageIMAGE