Nodes/ComfyUI_ColorMod/ColorMod (edges)
ComfyUI Node

ColorMod (edges)

Shadow and highlight gain, independently

By city96·Created 3 years ago·Updated 2 years ago· 111
ColorMod (edges)
  • image
  • IMAGE
low1.00
pivot0.50
high1.00
cliptrue

Most brightness tools move the whole image. ColorMod (edges) splits the tonal range at a pivot and gives you separate control over the two sides: a low gain for shadows, a high gain for highlights. It's the closest thing in this pack to a real contrast curve, and it's the node I'd hand someone who wants an S-curve but doesn't want to touch a spline editor.

The name "edges" is a little misleading - nothing about this detects image edges. It's about the edges of the tonal range, the dark end and the bright end, and adjusting how far each one extends. Think of it as "lift the blacks / tame the highlights," but with precise numbers.

How it works

Values below the pivot get remapped by the low factor, values above it by the high factor, with the pivot point itself staying fixed. The visualization canvas (every ColorMod node has one) shows this as a two-segment line that bends at the pivot - drag low or high and one leg of the curve steepens or flattens while the other stays put.

The inputs that matter

  • low (default 1.0, range 0–2) - shadow gain. Below 1 lifts the dark end up toward the pivot (less crushing, flatter blacks); above 1 pushes shadows darker (deeper blacks, more contrast).
  • high (default 1.0, range 0–2) - highlight gain. Above 1 stretches bright values brighter; below 1 pulls them down and protects highlights from clipping.
  • pivot (default 0.5) - where the split happens. 0.5 is a good neutral start.
  • clip (default True) - clamp to [0, 1]; off for HDR pass work.
  • image in, one IMAGE out.

A classic move: low just under 1.0 and high just above 1.0 makes an S-curve - richer shadows and brighter highlights, which reads as "more contrast" without moving the midtones. The reverse (low above 1, high below 1) compresses the range for a flatter, softer look.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/city96/ComfyUI_ColorMod
cd ComfyUI_ColorMod
pip install -r requirements.txt

Restart, or install via ComfyUI Manager ("ComfyUI_ColorMod"). No dependencies beyond the pack - pure PyTorch.

Where it fits

  • Perceptual contrast - the S-curve above, done without a LUT or a gamma hack.
  • Recovering crushed shadows after a merge or an upscale; a low below 1 pulls them back without flattening the bright side.
  • Taming hot highlights before the VAE - a high below 1 with clip on keeps the top of the range safely inside [0, 1].

One honest caveat: with low or high far from 1.0 you can push the curve past the pivot and get reversals (the visualization will literally show you the line kinking). Keep the slider moves modest and read the canvas - the whole point of the drawing is that you see the curve before it bites you.

CategoryColorMod

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
lowFLOAT1.000–2
pivotFLOAT0.500–1
highFLOAT1.000–2
clipCOMBOtrue2 options: true, false

Outputs (1)

NameTypeDescription
IMAGEIMAGE