Nodes/LF Nodes/Clarity
ComfyUI Node

Clarity

Midtone contrast plus sharpening in one pass

By lucafoscili·Created 2 years ago·Updated 2 years ago· 50
Clarity
  • image
  • ui_widget
  • image
  • image_list
clarity_strength0.5
sharpen_amount1.0
blur_kernel_size7

"Clarity" is the photo-editing move people love and can't always name: it's midtone contrast plus a bit of sharpening - the difference between a render that looks flat and one that looks defined. LF_Clarity packages exactly that into one node, which is why it's one of the more satisfying filters in the LF Nodes family. Drop it after a sampler, give it a nudge, and the image snaps into focus without the radioactive edge halos a naive sharpen slider produces.

Under the hood it does two things at once, and both are exposed as separate controls:

  • clarity_strength - 0 to 5, default 0.5. This is the "contrast enhancement in midtones" part, per the tooltip. It adds local contrast around the tonal midpoint, which is what makes textures and edges feel sharper without blowing out highlights.
  • sharpen_amount - 0 to 5, default 1. The actual sharpening pass on top.
  • blur_kernel_size - 1 to 15, default 7, stepping by 2. This is the Gaussian kernel used inside the clarity algorithm (classic unsharp-mask style: blur the image, subtract, boost the difference). Higher values smooth more aggressively before the detail extraction.

For a beginner, the setting you'll touch is clarity_strength. Start at 0.3–0.5. sharpen_amount is where people overshoot - a value above 2 on a clean render starts showing crispening artifacts.

How it fits

Like the rest of the LF filter family, it takes a batch or a single tensor, returns image and image_list, and shows a KUL_COMPARE before/after widget on the node so you see the change inline. The natural pipeline: sampler → LF_Clarity → save. It's also genuinely useful before an upscaler, giving the upscale more detail to work with, though the pack's author mostly treats these filters as the finishing touch.

It's a per-image correction, not a generative tool - if your render is genuinely soft or out of focus, no amount of clarity will save it, and you're better off fixing the sampler settings. Clarity is for images that are almost right.

Installing it

Standard LF Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/comfyui-lf

or ComfyUI Manager → LF Nodes → install → restart. No dependencies, no models. Frozen legacy repo (development moved to lf-nodes), so this is stable, finished code.

Where people get burned

  • Stacking it with other sharpening. If you also run a sharpening upscaler or a detailer that sharpens, the results compound into crunchy, oversharpened garbage. Pick one place to sharpen.
  • blur_kernel_size matters more than it looks: too small and the midtone contrast gets noisy, too large and you start seeing soft glow. The default 7 is a good place to live.
  • Clarity is batch-safe but memory-linear - it's a blur + subtract + add, so a very large batch is just more work per frame. Downscale-then-preview if the node feels slow.

When a render needs "the pop," this is the single knob to reach for in this pack.

Category✨ LF Nodes/Filters

Inputs (5)

NameTypeDefaultDescription
imageIMAGEInput image tensor or a list of image tensors.
clarity_strengthFLOAT0.50–5Controls the amount of contrast enhancement in midtones.
sharpen_amountFLOAT1.00–5Controls how much sharpening is applied to the image.
blur_kernel_sizeINT71–15Controls the size of the Gaussian blur kernel. Higher values mean more smoothing.
ui_widgetoptKUL_COMPARE[object Object]

Outputs (2)

NameTypeDescription
imageIMAGE
image_listIMAGE