Nodes/MTB Nodes/Sharpen (mtb)
ComfyUI Node Runs on cloud

Sharpen (mtb)

Unsharp-mask sharpening for ComfyUI images

By melMass·Created 3 years ago·Updated about a month ago· 721
Sharpen (mtb)
  • image
  • IMAGE
sharpen_radius1
sigma_x1.0
sigma_y1.0
alpha1.0

Diffusion output can come out a touch soft - especially after a VAE decode, an upscale, or a blur-heavy step. Sharpen (mtb) is the node that puts the crispness back. It's a straightforward unsharp-mask sharpener with enough knobs to control how aggressive it gets, so you can add a subtle bit of bite or really crunch the edges.

Where it fits: as a finishing touch near the end of a graph, or right after an upscale that left things a little muddy. It's the kind of node you don't think about until an image looks "almost there but a bit soft," and then it's exactly what you want. Keep it gentle for photoreal work; a heavy hand makes halos and looks obviously processed.

It's in the image-processing section of MTB Nodes (comfy_mtb) by melMass, next to Blur and Color Correct.

How it works

Unsharp masking works by blurring a copy of the image, subtracting that blur to find the edges, and adding the edges back with extra contrast - which is why a sharpen node has blur parameters. This one builds a Gaussian kernel from a radius and sigmas, and alpha controls how strongly the recovered edge detail is added back. Bigger kernel and sigma = the sharpening acts on broader features; higher alpha = more punch. It's a tensor operation, no model involved.

The inputs and outputs that matter

  • image - what you're sharpening.
  • alpha (default 1) - strength. This is the main dial. Below 1 for a subtle lift, above 1 for aggressive sharpening. Push it too far and you get white halos around edges - back off when you see them.
  • sharpen_radius (default 1) - the size of the sharpening kernel. Small values sharpen fine detail; larger values sharpen broader structures (and start looking crunchy).
  • sigma_x / sigma_y (both default 1) - the spread of the Gaussian in each direction. Equal values sharpen evenly; you can bias one axis, but for normal work leave them matched.

Output is a single IMAGE. Drop it near the end of your chain, just before saving.

How to install it

ComfyUI Manager: search MTB Nodes, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb

then restart. Pure Torch/Python - no models, nothing extra to install.

Common issues & troubleshooting

Ugly halos around edges. The classic over-sharpening artifact: bright fringes hugging high-contrast edges. Lower alpha, and shrink sharpen_radius. Sharpening is one of those effects where less is almost always more for a natural look.

Noise got sharper too. Sharpening amplifies whatever's there, including grain and compression noise. If your source is noisy, denoise (or sharpen more gently) - otherwise you're just making the noise crisp.

No visible change at defaults. alpha 1 with radius 1 is a mild effect. If you can't see it, nudge alpha up gradually rather than jumping to a big number that overshoots into halos.

Sharpen-then-scale undoes it. If you sharpen and then downscale afterward, the resize softens what you just added. Do the sharpen last, at final resolution, so it survives to the output.

Categorymtb/image processing

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
sharpen_radiusINT11–31
sigma_xFLOAT1.00.1–10
sigma_yFLOAT1.00.1–10
alphaFLOAT1.00–5

Outputs (1)

NameTypeDescription
IMAGEIMAGE