Donut CAS (Contrast Adaptive Sharpen) (DEPRECATED)
AMD's game sharpener, ported to your diffusion output
- image
- image
Sharpening diffusion output is mostly a choice between unsharp mask (halos on already-sharp edges) and nothing. DonutCAS is a third option with a pedigree: it's a port of AMD's Contrast Adaptive Sharpening, the FidelityFX shader developed to recover detail lost to temporal anti-aliasing in games. The core idea - and the reason it behaves better than USM - is that it's adaptive: it measures local contrast and sharpens only where there's detail to recover.
High-contrast edges are already sharp, so CAS leaves them mostly alone (no halo blowout). Low-contrast areas are where the fine texture got mushy, so CAS sharpens those harder. That's exactly the failure profile of a denoised AI image - soft microtexture on skin and fabric, hard edges that don't need help - which makes it a remarkably good fit for the job it was never designed for.
The inputs are a refreshingly short list: image, sharpness (0–1, default 0.5, overall strength), and contrast (−1 to 1, default 0, how strongly the adaptation kicks in - negative flattens the adaptive behavior, positive leans into it). One output: the sharpened image. The source claims a faithful implementation of the FidelityFX algorithm, and the node is a straightforward pixel-domain pass - fast, deterministic, no model involved.
Where it fits
Use it as a finishing step before save, especially if you want to keep a natural look. The post-processing mantra applies: it's a cheap deterministic operation, so it beats re-running the sampler to add perceived detail. Where it loses: it's not an upscaler and not a magic detail generator - on a genuinely blurry face it can't invent structure, it can only emphasize what's there. And on output that's already overprocessed, CAS has nothing to save and will just add noise.
The contrast knob is the one people ignore and shouldn't: at 0 the adaptation is balanced, but pushing it toward 1 makes the sharpening chase fine detail harder (good for soft, painterly output), and negative values make the result more uniform - closer to plain USM with fewer surprises. For a first pass, sharpness 0.4–0.6 with contrast at 0 is a safe, attractive starting point.
The honest verdict
The node is DEPRECATED - CAS lives on inside the pack's DonutSharpen family, which collects several sharpening methods (USM, high-pass, smart, deconvolution, HiRaLoAm, and CAS) behind one interface, and the standalone DonutCAS node is kept only so old workflows keep loading. If you're building new graphs and want this exact algorithm, look for it in the sharpen collection. The algorithm itself is legit and worth knowing - it's the sharpener people reach for when USM's halos start annoying them.
Install: part of the pack - ComfyUI Manager → search DonutNodes, or git clone into custom_nodes/ plus pip install -r requirements.txt with the same Python as ComfyUI. Needs opencv-python-headless (in the pack's requirements); no model downloads, and it runs fast enough to batch over a whole directory.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| sharpness | FLOAT | 0.500–1 | Sharpening strength |
| contrast | FLOAT | 0.0-1–1 | Contrast adjustment (0 = neutral) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |