Nodes/ComfyUI-Image-Filters/Frequency Combine
ComfyUI Node

Frequency Combine

Stitch the detail layer back onto a new base

By spacepxl·Created 3 years ago·Updated 8 months ago· 293
Frequency Combine
  • high_frequency
  • low_frequency
  • IMAGE
mode
eps0.10

This is the back half of manual frequency separation: take a high-frequency detail layer and a low-frequency color/lighting layer, and fuse them into one finished image. The whole point of splitting an image apart in the first place is that you can now edit one layer without touching the other - and this node is where you cash that in.

The workflow this exists for

Say you ran a subject through a relighting model - IC-Light is the textbook example - and it nailed the new lighting but smeared the skin texture or shifted the color balance somewhere unpleasant. Instead of accepting that trade, the standard move is: run Frequency Separate on your original photo to pull out its high-frequency detail, run something similar on the relit output to get its low-frequency layer (or just use the relit image directly as your new low-frequency base), then combine the original's texture with the relit image's lighting here. You end up with the new lighting and the old detail - the best of both, instead of whatever compromise the model gave you.

It's not limited to relighting. Any time an img2img, inpaint, or restyle pass degrades fine texture you want to keep, this same original-detail-plus-new-color trick applies.

How it works

It's the mirror of Frequency Separate's math: subtract mode reconstructs the image as high_frequency + low_frequency; divide mode reconstructs it as high_frequency * low_frequency. Which one you pick has to match whichever mode you used on the separate side, or the reconstruction comes out wrong.

Inputs and outputs

  • high_frequency (IMAGE) - the detail layer, typically pulled from your original, undamaged image via Frequency Separate.
  • low_frequency (IMAGE) - the color/lighting layer, typically your new (relit, restyled, whatever) version.
  • mode - subtract or divide, matched to whatever separated the high-frequency layer in the first place.
  • eps (default 0.1, range 0.01–0.99) - the divide-mode safety floor, same role as in Frequency Separate.

Output is one IMAGE - the recombined result, ready for Save Image, further compositing, or another pass.

Installing it

ComfyUI Manager: search "ComfyUI-Image-Filters," install, restart. Manual install:

cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Image-Filters

Install requirements (pip install -r requirements.txt, or install.bat on Windows), restart ComfyUI. Everything in this pack is plain image-tensor math - no models to download, so it's a quick add to your setup.

Watch for opencv conflicts: this pack needs opencv-contrib-python, and if another node pack already installed a different cv2 variant, you can get import errors on startup. The author's import_error_install.bat wipes every opencv variant and reinstalls the correct one - run that if the console shows opencv-related import failures.

Where this goes wrong

Same mode-mismatch trap as Frequency Separate - subtract-and-combine-with-divide (or vice versa) produces a visibly broken image, usually blown-out or oddly dark, rather than a clean error. If your recombined image looks wrong in a way you can't explain, check that both nodes agree on mode first. Second: make sure the high_frequency and low_frequency images are the same resolution and genuinely correspond to the same underlying image - combining detail from one photo with color from a differently-composed one won't align, and you'll see ghosting or doubled edges where the structures don't match.

CategoryImage-Filters/image

Inputs (4)

NameTypeDefaultDescription
high_frequencyIMAGE
low_frequencyIMAGE
modeCOMBO2 options: subtract, divide
epsFLOAT0.100.01–0.99

Outputs (1)

NameTypeDescription
IMAGEIMAGE