Unsharp Mask
The sharpen node that actually tells you what it's doing
- image
- ui_widget
- image
- image_list
Sharpening is unsharp masking, and the name is literally the recipe: blur a copy of the image, subtract it to isolate the fine detail, then add that detail back scaled by an amount. That's not trivia - knowing it tells you exactly why the two knobs are called radius and amount, and why cranking amount produces halos. LF_UnsharpMask is that classic filter as a clean ComfyUI node, from the lf-nodes filter family. If you've been reaching for "sharpen" magic, this is the honest, deterministic version: no model, no seed lottery, milliseconds, fully reproducible.
It earns its place at the end of an upscaling chain or as the final detail pass before saving - the "crisp it up" step that turns a soft render into something that snaps.
How it works
The source is a textbook unsharp mask: a Gaussian-blurred copy of the image, the original minus the blur (the high-frequency detail), added back scaled by amount. The two parameters that matter are the usual suspects:
- radius (INT, 1–31, default 5) - the Gaussian kernel size. This sets what counts as detail. Small radius sharpens fine texture; large radius sharpens broad edges. Odd values work best, and the node steps by 2 for that reason.
- amount (FLOAT, 0–5, default 0.5) - how hard the detail gets added back. 0.5 is subtle. Past 1.5 you're courting halos - bright edges around every high-contrast boundary.
- sigma (FLOAT, 0.1–5, default 1) - the Gaussian sigma that controls how soft the reference blur is. Tune it together with radius; it changes the character of what gets emphasized.
- threshold (FLOAT, 0–1, default 0) - the underrated one. It suppresses sharpening on pixels below a contrast threshold, which means flat areas (sky, skin, walls) stay smooth while edges get sharpened. Without it, sharpening amplifies noise and grain in areas that shouldn't have detail at all. If you're sharpening something with visible noise, this is the knob that saves you.
Outputs are image and image_list, standard for the pack.
Install
Ships with lf-nodes:
- ComfyUI Manager: search "LF Nodes", install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/lucafoscili/lf-nodes.git, restart.
No models. OpenCV does the blur; already present.
Common issues
- Halos on every edge. That's amount too high, radius too wide, or both. Back amount to ≤1 and shrink radius until the halo disappears - halos are the universal tell that you've oversharpened.
- "It sharpened my noise." You're missing the threshold. Set it just above the noise floor (0.05–0.15 is a common zone) so flat regions are left alone and only real edges get the boost. This is the difference between a clean sharpen and a grainy mess.
- Sharpening after upscaling vs. before. Do it after upscaling - sharpening a small image and then upscaling sharpens the upscale artifacts too. This node sits naturally after an upscaler, and the pack's own LF_TiledSuperRes even has a built-in post-blend sharpen amount for exactly that pipeline slot.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image tensor or list of tensors to sharpen. | |
| amount | FLOAT | 0.500–5 | Strength of the sharpening effect. |
| radius | INT | 51–31 | Gaussian blur kernel size (odd values work best). |
| sigma | FLOAT | 1.00.1–5 | Gaussian blur sigma controlling softness of edges. |
| threshold | FLOAT | 0.000–1 | Suppress sharpening for pixels below this contrast threshold. |
| ui_widgetopt | LF_COMPARE | [object Object] | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Image tensor with unsharp mask effect applied. |
| image_list | IMAGE | List of image tensors with unsharp mask effect applied. |