ComfyUI Node

Levels (RGB)

Turn down the green channel, get a red glow instead of a red house

By maludwig·Created 2 years ago·Updated about a year ago· 6
Levels (RGB)
  • image
  • mask_opt
  • image
masked_areatrue
channelall
shadows0.0
midtones1.0
highlights1.0

The README's example for this node is the best one-liner in the whole pack: you want a spooky haunted house that glows red, but every time you put "red" in the prompt, the model paints the house red. The fix is to stop prompting and start grading - turn down the blue and green channels, turn up red. Level (RGB) is the only node in Basix Image Filters that operates on raw RGB channels, and that's precisely why it can do something the HSL/HSV nodes can't: shift the balance of the image toward a color rather than the overall tone.

How it works

Where the rest of the pack converts to HSL or HSV and edits one channel, this node runs the same shadows/midtones/highlights levels pipeline directly on RGB. The channel input picks whether the curve applies to red, green, blue, or all three. Apply it to a single channel and you re-weight that color's contribution to the image - set a strong midtones lift on red and the whole image leans red, because the red channel is now brighter relative to the others. That's a color-grade, not a tone-grade, and it's the difference between "the house is red" and "the house is lit by red."

The inputs that matter

  • channel (default all) - red, green, blue, or all. This is the input that makes the node what it is; all behaves like a normal levels tool, single channels shift the color balance.
  • shadows (default 0, range 0–1) - channel values below this crush to black.
  • midtones (default 1, range 0–100) - the gamma curve. Above 1 darkens, below 1 brightens, same as everywhere else in the pack.
  • highlights (default 1, range 0–1) - channel values above this clip to white.
  • masked_area + optional mask_opt - the pack's standard masking.

Output: one image tensor. Note there's no HSV/HSL "lightness keeps saturation" safety net here - you're editing raw RGB, so the results are more direct and slightly easier to blow out.

What to keep in mind

The midtones slider's 0–100 range is normal for this pack (real work: ~0.5–2.5). The in-UI description is the same stale generic text as the other levels nodes - read the sliders, not the tooltip. And the one real trap: per-channel levels can push values out of balance fast. A midtones lift of 2 on red is a statement; 3+ is a party. Small moves, look at the result, adjust.

Installing it

ComfyUI Manager → search "Basix Image Filters" (repo basix_image_filters) → install → restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/maludwig/basix_image_filters

Restart after. No models, no keys, no heavy dependencies - pure torch math, like the rest of the pack.

Putting it to work

Color balance via channel levels is a classic technique, and in an img2img workflow it doubles as a hint: rebalance a reference toward red, run it back through at 0.7–0.9 denoise, and the model tends to reproduce the red glow rather than a red house. Need only the house to glow? mask_opt with a MaskEditor mask and the masked_area toggle confine the grade to one region. It's the one node in the pack you'll reach for when the problem is what color the light is, not how bright it is.

CategoryImage Filters

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
masked_areaBOOLEANtrue
channelCOMBOall4 options: red, green, blue, all
shadowsFLOAT0.00–1
midtonesFLOAT1.00–100
highlightsFLOAT1.00–1
mask_optoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE