Nodes/RyanOnTheInside/Image Contrast Adaptive Sharpen Batch βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Image Contrast Adaptive Sharpen Batch βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

A cheap sharpen pass for video frames that doesn't wreck the noise floor

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Image Contrast Adaptive Sharpen Batch βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • image
  • IMAGE
β—„amount0.80β–Ί
β—„batch_size4β–Ί

CAS is AMD's Contrast Adaptive Sharpening algorithm - originally built for real-time game rendering, where you need sharpening that's cheap and doesn't blow up noise in flat areas the way a naive unsharp mask does. This node runs it over a batch of frames, which makes it a reasonable last step before you write out a video: it crisps up detail that got softened by upscaling or VAE decode without the halo-y, over-processed look you get from cranking a generic sharpen filter.

It's not a Flex node - no feature modulation, no audio reactivity, nothing fancy. Just image in, sharper image out.

Inputs and outputs

  • image - your frame batch.
  • amount (0.0-1.0, default 0.8) - sharpening strength. This is the only knob that changes the look.
  • batch_size (1-64, default 4) - how many frames get processed per chunk internally. This is a memory/performance setting, not a visual one - it doesn't change the output, only how much VRAM the operation eats at once.

Output is a single IMAGE.

How it works

CAS looks at local contrast around each pixel and sharpens edges more where contrast is already high, less where it's low - which is why it holds up better on gradients and skin tones than a plain unsharp mask, which sharpens everything uniformly and turns smooth areas grainy. amount scales how aggressively that contrast-adaptive boost gets applied.

Where it fits

Reach for this after an upscale pass, or after decoding a video model's output, when things look a little soft compared to source. It's a cheap, final polish step - not a substitute for actually fixing a blurry generation upstream.

Installing it

Via ComfyUI Manager: search RyanOnTheInside, install, restart. Manually:

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

This particular node just needs the image-processing dependencies already in the pack's requirements.txt (OpenCV, scikit-image) - no model weights, no separate download.

Where people get burned

amount near 1.0 looks harsh, especially on faces and smooth gradients where the extra contrast reads as oversharpened rather than crisp - most people land somewhere around 0.4-0.7 depending on source quality. And don't chase quality by raising batch_size: it's purely a chunking parameter for memory management on long clips, so if you're hitting an out-of-memory error on a long video, lower it rather than raise it, and expect no visual difference either way. If sharpening alone isn't fixing softness, the problem is upstream (resolution, upscaler choice, denoise strength) - this node can't recover detail that was never generated.

CategoryRyanOnTheInside/Utility/Images

Inputs (3)

NameTypeDefaultDescription
imageIMAGEInput image to be processed (IMAGE type)
amountFLOAT0.800–1Strength of the contrast adaptive sharpening effect (0.0 to 1.0)
batch_sizeINT41–64Number of images to process in each batch (1 to 64)

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”