Nodes/deforum-comfy-nodes/Color Correction | Deforum
ComfyUI Node

Color Correction | Deforum

Fix washed-out frames without a color-grade model

By deforum·Created about a year ago·Updated 3 months ago· 29
Color Correction | Deforum
  • image
  • IMAGE
saturation_threshold0.40
max_saturation_factor1.3
enable_white_balancefalse
white_balance_scale_min0.97
white_balance_scale_max1.03

The complaint is always the same after a long Deforum render: the frames look flat, the blacks are lifted, the color has no punch. Color Correction is the deterministic fix - it measures how saturated your image actually is and boosts it only when it needs it, with an optional white-balance pass on top. No model, no training, no guesswork; it runs in milliseconds per frame on the CPU.

The "adaptive" part here is real, unlike some of its neighbors: it measures the image's mean saturation in HLS space, and only applies correction if that mean falls below your saturation_threshold. Already-saturated input passes through untouched. That's a genuinely nice property for a batch of frames that varies frame to frame - healthy frames stay put, washed-out ones get lifted, and you don't get the "everything's neon now" overcorrection you'd get from a blanket saturation boost.

The inputs that matter

  • saturation_threshold - FLOAT, default 0.4, range 0–1. The mean-saturation line below which correction kicks in. Lower = only very flat images get touched.
  • max_saturation_factor - FLOAT, default 1.3, range 1–2. The ceiling on how much the saturation gets multiplied. It scales as threshold / measured, capped here, so a nearly-gray frame can be boosted up to 1.3× but no more - the clamp is what stops you from turning gray into neon.
  • enable_white_balance - BOOLEAN, default false. When on, it scales each channel toward the mean intensity to neutralize a color cast.
  • white_balance_scale_min / white_balance_scale_max - the optional clamps on the white-balance scaling (defaults 0.97 and 1.03), so the correction can't go too far and introduce a new cast.

Output is a single IMAGE, batch-in batch-out - a full frame sequence goes through as one tensor.

Where it fits

After VAE decode, before save - the standard "post pass" position, same as Adaptive Sharpening. If you're running the combined node, Color Correction + Sharpening | Deforum wraps this exact logic plus the sharpen, so pick one path and stick with it. The KB's post-processing essay makes the general point that applies here perfectly: reach for the cheap deterministic primitive before throwing another generative pass at a color problem.

The trap

It's a global (per-frame) correction, not per-pixel - a frame that's half deep shadow, half blown highlight will get one average treatment. And remember it operates on the whole batch with the same parameters, which is what you want for consistency; if one specific frame needs special treatment, correct it separately.

Installing it

Part of deforum-comfy-nodes, the official Deforum ComfyUI pack. ComfyUI Manager: search "deforum" (comfyui-deforum), install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/deforum-art/deforum-comfy-nodes

Restart ComfyUI after. No extra dependencies, no models - pure numpy/PIL math. Load errors after upgrades usually mean an orphaned deforum pip package; pip uninstall deforum and restart.

CategoryDeforum/Image

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
saturation_thresholdFLOAT0.400–1
max_saturation_factorFLOAT1.31–2
enable_white_balanceBOOLEANfalse
white_balance_scale_minoptFLOAT0.970.8–1
white_balance_scale_maxoptFLOAT1.031–1.2

Outputs (1)

NameTypeDescription
IMAGEIMAGE