ComfyUI Node

CAS Luma Sharpening

Sharpening that won't halo your edges or bleed your colors

By turinastudio·Created 6 months ago·Updated 6 months ago· 1
CAS Luma Sharpening
  • image
  • image
amount1.00

The default sharpening move in most tools is an unsharp mask, and the default complaint is the same every time: halos around edges, oversaturated color, and a crispness that looks processed. This node does the version that game engines have used for years - AMD's FidelityFX Contrast Adaptive Sharpening (CAS) - and runs it on the luma channel only. You get real detail pop with none of the edge ringing, and the color channels never get touched, so nothing bleeds or saturates.

It lives in the SeedVR2 Tiling pack for a reason: SeedVR2's output is detail-dense but can land slightly soft, especially at high upscale factors. A luma-only adaptive sharpen is the safe finishing pass after the stitcher - the one you can put on every workflow without babysitting it. But like the pack's color matcher, it's fully standalone. It's equally happy sharpening a render, a photo, or anything else that came out of ComfyUI.

How it works

Three steps, all visible in the source:

  1. RGB → YCbCr using the BT.709 matrix. The image is split into a Y luma channel and two chroma channels.
  2. CAS runs on Y only. The algorithm looks at each pixel's four neighbors, computes the local min and max, and derives a contrast estimate. High-contrast areas - already-sharp edges - get less sharpening, because that's where unsharp mask produces halos. Smooth, low-contrast areas get more. That "contrast adaptive" bit is the whole trick.
  3. Put Y back, convert to RGB. The chroma channels pass through byte-for-byte untouched.

That's why you don't get color fringing: color isn't in the equation at all. And because the weight adapts to local contrast, the halo problem mostly doesn't materialize.

The inputs

One image, one slider:

  • image - anything, RGB or RGBA (alpha is preserved).
  • amount (default 1.0, range 0–1) - the sharpening intensity. 0 is a passthrough.

Output is image, same size and channels as the input.

What I'd actually set

amount is the entire UI - there's no radius, no threshold, no iterations. That's either liberating or annoying depending on how you feel about tuning sliders; for most output, 0.5–0.8 is the range where you notice it's sharper without it looking sharpened. The adaptive response means you can usually run it at the top of that range and not fight it. If you're unsure whether it's doing anything, toggle amount 0 vs 1 on a preview.

After a SeedVR2 pass, run it after the stitcher with amount around 0.6 and it'll pull texture back out of that slightly-smoothed look the model can leave behind.

Installing

Same as the rest of the pack: no dependencies beyond torch, so no requirements.txt, nothing to fight. ComfyUI Manager → search "SeedVR2 TilingWrapper", or:

cd ComfyUI/custom_nodes
git clone https://github.com/turinastudio/ComfyUI-SeedVR2-TilingWrapper.git

Restart, and it's under SeedVR2_Tiling. (The README's clone URL says shikasensei-dev/... but the repo actually lives at turinastudio/... - use the one above.)

Common issues

  • Not sharp enough. That's CAS being conservative by design. Crank amount toward 1.0 - it still won't halo like unsharp mask.
  • Something looks off after the SeedVR2 pipeline. CAS won't invent detail, and it can't fix blur from a bad upscale. If the output is fundamentally soft, the fix is upstream (SeedVR2 settings), not more sharpening.
  • It looks identical. At low amount on an already-sharp image, that's expected - the adaptive weight correctly decides there's nothing to do.
CategorySeedVR2_Tiling

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
amountFLOAT1.000–1

Outputs (1)

NameTypeDescription
imageIMAGE