Nodes/ComfyUI_Curves/RGB Curves (Advanced)
ComfyUI Node

RGB Curves (Advanced)

Sine, saw and square waves you can still hand-edit — procedural RGB curves

By tavyra·Created about a year ago·Updated about a year ago· 1
RGB Curves (Advanced)
  • rgb_curve_points
  • red_curve
  • green_curve
  • blue_curve
curve_typeLinear
frequency1
offset0.00
invertfalse

Hand-drawing a curve is fine, but what if you want a perfect sine wave, a sawtooth ramp, or a square-wave pulse - without clicking in a dozen points? That's what ComfyUI_Curves's RGBCurvesAdvanced is for. It's the RGB Curve Editor plus a procedural waveform generator: pick a curve type, dial in frequency and offset, and the node draws the wave for you. Then you can still drag points by hand to mangle it to your liking.

Same idea as the plain RGB Curve Editor, one big upgrade: your starting shape is a math function, not a blank diagonal line.

How it works

The node's input, rgb_curve_points, is the same custom canvas widget, but this version generates waveform points in JavaScript for the active channel from your settings. The curve shapes are computed live in web/rgb_curves_advanced.js:

  • Linear - the plain diagonal ramp (or its inverse).
  • Sine - smooth oscillation.
  • Saw - ramps up and snaps back.
  • Triangle - up, down, up, down, no snap.
  • Square - hard on/off pulsing.
  • Log and Exponential - curved ramps with different easing.
  • Max - a flat line at the top (essentially "always on").

Each channel gets the wave generated as a set of points, then interpolated to 256 values, clamped to 0–1, and returned as a tensor per channel. The Python side barely does anything - it clamps, converts, and hands out red_curve, green_curve, and blue_curve.

The parameters that matter

  • curve_type - the shape (Sine, Saw, Triangle, Square, Log, Exponential, Linear, Max).
  • frequency - how many cycles of the wave fit across the 0–1 range. 1 to 32, default 1.
  • offset - phase shift. Only goes negative (-1 to 0), which delays the wave.
  • invert - flips the wave vertically.

And here's the gotcha that will trip you up on your first try: changing curve_type, frequency, or offset does not live-update the drawing. Those inputs drive the widget, but you have to click the Apply Curve button inside the node to regenerate the active channel. Tweak a setting, hit Apply Curve, and the wave rebuilds. Change another setting and forget to re-apply? Your curve silently stays the old shape. The output only changes when you actually apply.

Also note the default state is a flat line at 0.5 for each channel, not a diagonal - so before you've applied anything, all three outputs are constant halves.

Outputs

  • red_curve, green_curve, blue_curve (FLOAT) - three 256-element arrays, one per channel, in the same "float array" format the pack is built around. Wire them into whatever accepts custom curves: audio-style filters, per-channel color grading, automation ramps. Feed them into the pack's Curve Debugger node if you want to eyeball the shape first.

Installing it

It's part of the ComfyUI_Curves pack, so install once and all three nodes come along. In ComfyUI Manager, search ComfyUI_Curves, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/tavyra/ComfyUI_Curves

Then restart ComfyUI. No requirements.txt, no model files - just torch and numpy, both already present in ComfyUI. One of the cleaner custom-node installs you'll do.

Where people get burned

The Apply Curve button is the big one - settings change silently until you click it. Beyond that: offset only goes negative (there's no positive phase shift, so if you want to advance a wave you'll have to invert or accept the delay), and frequency is capped at 32 cycles, which is plenty for anything you'd reasonably use a waveform for here. If you just need a flat "always high" channel for one color, Max does it in one click.

Is it the most exciting node in the world? No. But if your workflow needs a repeating ramp or pulse and you're tired of hand-plotting it point by point, this is the one you reach for - a genuine time-saver hiding in a small pack.

CategoryRGB Curve Editor

Inputs (5)

NameTypeDefaultDescription
rgb_curve_pointsrgb_curve_editor_widget
curve_typeCOMBOLinear8 options: Linear, Sine, Saw, Triangle, Square, Log, +2
frequencyINT11–32
offsetFLOAT0.00-1–0
invertBOOLEANfalse

Outputs (3)

NameTypeDescription
red_curveFLOAT
green_curveFLOAT
blue_curveFLOAT