ComfyUI Node

RC Levels

Levels with draggable handles, not guesswork

By kj863257·Created 11 months ago·Updated 10 months ago· 16
RC Levels
  • image
  • IMAGE
levels_state{"channel": "RGB", "values": {"input_black": 0.0, "input_white": 1.0, "gamma": 1.0, "output_black": 0.0, "output_white": 1.0}}

Levels is the histogram adjustment Photoshop users know as "drag the black point in until the blacks are actually black." It's a different muscle than curves - less artistic, more corrective - and for fixing washed-out or muddy images it's often the faster tool. RC_LevelsAdjust brings that to ComfyUI with an interactive editor that renders the handles right on the node, part of the RC Image Compositor suite under RC/Adjustments.

How it works

The node runs on a levels_state JSON payload that a bundled frontend widget (rc_levels_ui.js) manages for you. You get the full Photoshop set of controls on-screen:

  • Input levels - black point and white point. Drag them in to clip and remap the darkest/brightest values, which is how you fix a histogram that doesn't use its full range.
  • Gamma (midtone) - a separate handle that shifts the midpoint without moving the endpoints. This is the "brighten the midtones" control, and it's the one most people actually want when they say "make it pop."
  • Output levels - black/white output limits, which compress contrast instead of expanding it.
  • Channel selection - RGB plus individual Red/Green/Blue, so you can fix a channel-specific cast (a blue-heavy shadow, a green skin tone) by dragging one channel's black point.

The only required input beyond the image is levels_state, and the tooltip is explicit that the UI manages it. Output is a single IMAGE, same size, batch-safe.

The pack's README emphasizes "draggable handles" and "visual gradient preview" - the widget shows a gradient bar behind the points so you can see what the remap will do before you run it, which is the thing that makes levels feel non-scary.

Installing it

ComfyUI Manager → search "RC Image Compositor" → install, restart. Manual:

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

Dependencies are pillow, numpy, opencv-python - nothing to download.

Where people get burned

  • Input and output levels are opposite directions. Input levels expand contrast (pull points inward); output levels compress it (pull points inward too, but they cap the range). If your image looks more washed out after adjusting, you grabbed the wrong row of handles.
  • The state string is the whole configuration. Copying a workflow copies the state - great when it's a grade you like, confusing when a shared workflow ships with someone else's aggressive clip baked in. Check levels_state before assuming the node is broken.
  • Channel-specific edits compound. Fixing greens and then blues in the same run is fine, but each channel edit maps onto the RGB view, so a heavy single-channel drag can produce unexpected color shifts. Go gentle, per channel.
  • It doesn't do the "auto levels" for you. If you just want the histogram auto-fixed, this node expects you to move the handles. That's the point - but it means it's a manual tool for a manual workflow.

Levels is the correction-first counterpart to RC Curves in this pack. If curves is the artistic weapon, this is the clean-up pass - and for "my render came out flat" it's usually the faster fix.

CategoryRC/Adjustments

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
levels_stateSTRING{"channel": "RGB", "values": {"input_black": 0.0, "input_white": 1.0, "gamma": 1.0, "output_black": 0.0, "output_white": 1.0}}Interactive levels UI state (managed by UI, contains channel and adjustment values)

Outputs (1)

NameTypeDescription
IMAGEIMAGE