Nodes/Face Processor for ComfyUI/High Pass Filter (HPF)
ComfyUI Node

High Pass Filter (HPF)

The AE-style clarity trick, in a node

By SykkoAtHome·Created 2 years ago·Updated 10 months ago· 20
High Pass Filter (HPF)
  • image
  • image
  • HPF Settings
blur_radius2
blur_iterations6
blend_opacity0.50
input_black117
input_white137
gamma1.00
show_histogramfalse

If you've ever touched the "Clarity" slider in After Effects or Lightroom, you already know what this node does. A high-pass "clarity" filter takes the original image, blurs it hard, inverts it, and blends the two - the result keeps the fine detail of the original while the blurred-and-inverted layer pulls the midtones around it, giving that crisp, contrasty pop without the halos you get from a naive sharpen. It's a paint-shop classic, and it works on anything, which is why it lives in a face pack's Tools category rather than pretending to be face-specific.

Where it earns its keep here is the Fit → sharpen → Restore loop: take the 1024 crop that FaceFitAndRestore hands you, run this over it, and suddenly the detail you want to survive the trip back into the full frame is already emphasized. It's also handy for cleaning up a face before a second img2img pass - punch in the fine texture, then let the model preserve it.

The controls that matter

The mechanism is: blur (box filter, repeated), invert, blend, then levels and gamma. The inputs map directly onto that chain:

  • blur_radius (1–20) and blur_iterations (1–6 default, 1–20 range) - together define the "size" of detail the filter treats as fine. Bigger radius = coarser detail gets the clarity treatment. Six iterations of a radius-2 box blur is the default for a reason; it's a soft, smooth base to invert.
  • blend_opacity - the strength of the effect. Note the range is deliberately tiny: 0.45 to 0.55. That's not a bug, that's the AE-style sweet spot where the effect reads as clarity rather than as a bad Instagram filter. Treat 0.5 as "medium" and nudge from there.
  • input_black (117) and input_white (137) - the levels remap. These default to a tight range right around mid-gray, which is exactly where the blended result's information sits. Pull them apart to soften, push together to crunch.
  • gamma - one more tonal adjuster on top of the levels. 1.0 is a no-op; below 1 lifts midtones, above crushes them.

The show_histogram toggle stacks a 200px histogram strip onto the bottom of the output so you can watch the levels do their thing. Nice for learning the effect, but remember it changes the output's dimensions - turn it off before you feed the result into anything that cares about aspect ratio.

Outputs

image is the processed frame. The second output is literally named "HPF Settings" (space and all) and is a DICT describing the filter parameters used - a record more than a wire you'll pull from, though in principle you could pass it around like the pack's fp_pipe.

Install and context

Same pack, same drill - Manager search "Face Processor", or:

cd ComfyUI/custom_nodes
git clone https://github.com/SykkoAtHome/ComfyUI_FaceProcessor.git

restart, and let the requirements (mediapipe, dlib, pandas, cupy-cuda12x) install. This node itself only needs numpy/OpenCV, so if the heavier deps are fighting you, this is the one node in the pack that will keep working when the face stuff won't.

Troubleshooting

  • No visible effect - check blend_opacity is above 0.45 and that blur_iterations isn't 1. A single low-radius blur produces a near-identical inverted base, so the blend cancels out.
  • Everything looks chalky - your levels are too tight and gamma is pulling midtones. Loosen input_white up toward 180 or so.
  • Output got taller - show_histogram is still on. That strip is debug furniture.
CategoryFace Processor/Tools

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
blur_radiusINT21–20
blur_iterationsINT61–20
blend_opacityFLOAT0.500.45–0.55
input_blackINT1170–255
input_whiteINT1370–255
gammaFLOAT1.000–2
show_histogramBOOLEANfalse

Outputs (2)

NameTypeDescription
imageIMAGE
HPF SettingsDICT