Nodes/ComfyUI-YogurtNodes/H/L Frequency Detail Restore Threshold (Yogurt Nodes)
ComfyUI Node

H/L Frequency Detail Restore Threshold (Yogurt Nodes)

Put detail back into soft upscales — a frequency-split restore with knobs

By yogurt7771·Created 2 years ago·Updated 9 days ago· 1
H/L Frequency Detail Restore Threshold (Yogurt Nodes)
  • image
  • detail_image
  • mask
  • image
keep_high_freq64
erase_low_freq32
mask_blur16
high_threshold0.000
low_threshold0.000

Every upscale loses something. The model fills in the big shapes and smears the fine texture, and suddenly hair looks like soft plastic. H/L Frequency Detail Restore Threshold is the "put it back" node - it takes a soft image, takes a version of it that still has detail, and re-injects the high-frequency detail while you control how aggressively, and where.

The name is a mouthful, but the intent is simple: it's modeled on LayerStyle's H/L Frequency Detail Restore, which is a Photoshop-style trick for exactly this. You feed it a base image and a detail_image (usually a sharper or higher-res version of the same subject), and it merges them so you keep the composition of the base but the crispness of the detail source.

How it works

It's classic frequency separation, done in tensors. The detail_image gets Gaussian-blurred by keep_high_freq pixels, and the difference between the sharp and blurred versions becomes the high-frequency delta - the edges, the grain, the skin texture. That delta is then added back onto the base image with a "linear light" style blend: low + high_delta. Net effect: your base image keeps its colors and structure, but regains the detail that was in the detail image.

The "Threshold" part is what makes this one different from a plain blend. high_threshold and low_threshold (0–1) gate the delta maps, so you only restore detail where the difference is strong enough to matter - useful when your detail image is noisy and you don't want the grain added everywhere. There's also an optional mask input to restrict the whole operation to a region (a face, a specific object), and mask_blur feathers that region's edge so you don't get a hard line.

Inputs that matter

  • image - the base, the one you want to keep the look of.
  • detail_image - where the texture comes from. Same subject, sharper, ideally aligned.
  • keep_high_freq (default 64) - the blur radius used to separate detail from tone. Bigger = only the very finest detail comes through.
  • erase_low_freq (default 32) - if nonzero, the base's own low frequencies get replaced by the detail image's, which also normalizes color/lighting differences between the two.
  • high_threshold / low_threshold - the gates. Start at 0 (no gating) and raise until the noise goes away but the texture stays.

Output: a single image.

Install

One clone, shared by the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt

Or via ComfyUI Manager - search "YogurtNodes", install, restart. It lives under Yogurt Nodes / Image. Dependencies are numpy/pillow; nothing GPU-heavy.

Troubleshooting

This node is fiddly, and the fiddliness is the point:

  • "It did nothing." With both thresholds at 0 and erase_low_freq off, you're adding raw high-frequency delta from the detail image - if that detail image has no more detail than the base, there's nothing to add. Feed it a genuinely sharper source.
  • "Everything looks noisey/grainy." That's the high-frequency delta leaking in. Raise high_threshold to gate weak differences, and/or bump keep_high_freq so only the finest detail survives the separation.
  • Batch mismatch. The node iterates the two inputs as batches, repeating the last frame when lengths differ. If you see duplicated output across frames, your detail batch is shorter than your base - pad it.
  • Edge lines around the masked area. mask_blur is your friend. At 0 the region boundary is knife-sharp; blur it and the restore fades in naturally.

Honestly, if all you want is a quick global sharpen, a plain Unsharp Mask node is easier and faster. Reach for this one when you're restoring detail into an upscaled image from a source that has it - or when you need region-restricted frequency work that no single-filter node can do.

CategoryYogurtNodes/Image

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
detail_imageIMAGE
keep_high_freqINT640–1023
erase_low_freqINT320–1023
mask_blurINT160–1023
high_thresholdFLOAT0.0000–1
low_thresholdFLOAT0.0000–1
maskoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE