😺NKD Frequency Separate
Split an image into soft base and fine detail — the relight rescue
- image
- mask
- high_frequency
- low_frequency
- high_frequency_masked
The reason relit faces look airbrushed isn't the model's fault - it's that relighting is a lighting change, and lighting lives in the low frequencies. When the relight replaces the whole image, the fine detail (pores, fabric weave, hair texture) goes with it. Frequency separation is the classic rescue: split the image into a soft low-frequency base and a fine high-frequency detail layer, keep the detail, and put it back over the relit result. 😺NKD Frequency Separate is the split half of that trick, and it's the node that makes "restore skin texture after a relight" a three-node pipeline instead of a Photoshop detour.
How it works - the knobs that actually matter
method- how the base is smoothed.Guided(the default) keeps edges clean without the halo Gaussian leaves;Rolling Guidanceerases texture by size while keeping shapes;Medianis for spot blemishes. For the relight job, Guided is where you want to start.radius- the detail scale. Larger = coarser base, meaning more goes into the detail layer. This is the "what counts as texture" dial: too big and the detail layer carries lighting too, too small and it's just noise.edge_threshold- how strongly edges are protected (Guided / Rolling Guidance). Lower = sharper edges kept.mode- how detail is encoded.Divide(the default) is a ratio, which makes it lighting-invariant - the property that makes detail transfer between differently-lit images come out clean instead of carrying the old lighting along.detail-Luminancekeeps the detail achromatic so a Divide recombine never touches color (the safe default for skin);RGBcarries chromatic detail too.linear- process in linear light (correct, default on). Turn off for classic gamma behavior.
The optional mask attenuates the detail layer outside the mask - "skin only, not the background."
The outputs
Three, and the naming tells you what's for what:
high_frequency- the full detail layer (intermediate).low_frequency- the soft base (feed this to the Combine as the target).high_frequency_masked- detail neutralised outside the mask; identical tohigh_frequencywhen no mask is connected.
In-node, the preview has a wipe slider (HF | LF) so you can see what each layer actually holds, and a 1:1 button crops the view at native resolution - a fitted view destroys the very high-frequency detail you're trying to judge. When the view is zoomed out, radius is scaled to the downscale and the hint shows the effective value, so the number in front of you matches what you're getting.
Install and gotchas
Install via ComfyUI Manager (search ComfyUI-NKD-Basic-Tools) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-NKD-Basic-Tools
Restart after. Pack dependencies are onnxruntime and huggingface_hub; neither is needed here. The trap is the round trip: mode and linear on this node must match the Combine on the way back, or the detail comes back wrong. And note this node is an output node that previews - it terminates its own branch, so the low_frequency you feed to the Combine comes out of this node's wiring, not the whole-image output.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| method | COMBO | Guided | How the base is smoothed. Guided keeps edges clean without the halo Gaussian leaves; Rolling Guidance erases texture by size while keeping shapes; Median is for spot blemishes. |
| radius | INT | 81–128 | Detail scale. Larger = coarser base, more goes into the detail layer. |
| edge_threshold | FLOAT | 0.100–1 | How strongly edges are protected (Guided / Rolling Guidance). Lower = sharper edges kept. |
| mode | COMBO | Divide | How detail is encoded. Divide (ratio) is lighting-invariant — best for transferring detail between differently-lit images. |
| detail | COMBO | Luminance | Luminance keeps detail achromatic so a Divide recombine never touches color. RGB carries the chromatic detail too. |
| linear | BOOLEAN | true | Process in linear light (correct). Turn off to work in gamma like classic Photoshop. |
| maskopt | MASK | Optional — attenuate the detail layer outside the mask. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| high_frequency | IMAGE | Full detail layer, whole image (intermediate). |
| low_frequency | IMAGE | Soft base (intermediate — feed Combine). |
| high_frequency_masked | IMAGE | Detail neutralised outside the mask (feathered by its values). Same as high_frequency when no mask is connected. |