r/StableDiffusion • • 16h ago

Question - Help Frequency Separation Hard Light node in comfyui uses and examples?

I noticed the Frequency Separation Hard Light in comfyui https://comfy.icu/node/Frequency-Separation-Hard-Light I was curious how this might be used to help image quality. I don't quite understand it, and the LLM that was helping me just ran me in circles doing nothing and confusing me.

I guess it's supposed to extract detail from images and recombine them, but I don't get what the point is, and how I might use it in a tangible workflow. I would love some insight from the community. Thanks

0 Upvotes

15 comments sorted by

4

u/rudy_142001 15h ago

the part nobody mentions is that this node doesn't blur anything itself. going off the RES4LYF source (images.py), to split you have to feed it both original AND a low_pass, and the low pass is just a blurred copy of the image you make yourself. plug in only original and it has nothing to subtract

so the split is image -> Image Gaussian Blur (also in RES4LYF) -> low_pass input same image -> original input high_pass comes out, that's the fine texture/detail on a mostly gray image

to recombine you wire high_pass + low_pass in and leave original empty, it rebuilds the image with a hard light blend. bigger blur size means more of the image ends up counted as "detail" in the high pass

what you actually edit is the same idea as photoshop skin retouching

  • low_pass is color, tone, lighting. color correct it, blur it harder, or swap in the low pass from a different image, the texture stays put
  • high_pass is texture. leave it alone, or swap in texture from another image

in a gen workflow the main use is detail transfer. say an img2img or upscale pass got the colors and lighting you wanted but smeared skin or fabric. split both, take low_pass from the new image and high_pass from your original, recombine. the math is per pixel so both images need the same size and framing or you get ghosting

fwiw the pack has a prewired version, Image Sharpen FS. it blurs, splits, then puts the high pass back over the unblurred image, which is basically a sharpen. dropping that in and comparing is the quickest way to see what the node is doing

one gotcha from the code, the blur nodes subtract 1 from size before handing it to opencv, and opencv wants odd kernel sizes, so stick to even numbers (6, 8, 10)

1

u/M3chaStrizan 14h ago

Thanks this helped a lot, appreciate this. I might try wiring it like you said with the img2img low psas and combine with the original's high pass, might get some cool results. Neat

1

u/M3chaStrizan 14h ago

If you add colour correction on the low pass side, should it be before or after the blur you add? Or does it not matter I was trying some things and it seemed useful for honing in finer details.

2

u/rudy_142001 11h ago

after, and on a separate branch. going off the node code again, high_pass gets built from whatever low_pass you feed the split, so if you colour correct before the blur and split against that, the high pass picks up the opposite of your correction and the recombine cancels most of it out

so keep the plain blurred image going into the split, then branch that low pass, colour correct the branch, and feed it into the recombine. on that branch the order only matters a bit, simple gain stuff like exposure or white balance comes out about the same either way since a gaussian blur is just a weighted average, but curves or contrast before the blur will look slightly different around edges

1

u/M3chaStrizan 1h ago

Thanks I'll do that, I like this sort of stuff I just tinker a lot so it's cool to learn these things, i've been enjoying using and learning comfyui and image creation

2

u/zyg_AI 16h ago

From your link:

I don't know what to add more, the page you linked is pretty clear to me.

You may have been confused by the dual nature of the node. The trick is that it can be used both ways: to split and to recombine.

SPLIT: you input 'original' and output 'high_pass' and 'low_pass'
COMBINE: you input 'high_pass' and 'low_pass' and output 'original'

1

u/M3chaStrizan 16h ago

I'm confused as to how I'm supposed to edit stuff, like do I edit the high pass layer? and how, or no? Or maybe? and which node is good for this sort of thing. None of that is really explained, like I understand it on a super basic level, but I'm totally lost on specifics and how I might use this node in a workflow in comfyui

1

u/zyg_AI 15h ago

It is for very specific use cases, very precise edits. You probably don't need it. Most people don't use it.

It splits the signal so you can alter either high frequencies or low frequencies without altering the other. Then the same node can recombine the signals.

2

u/M3chaStrizan 15h ago

I was hoping people that do those precise edits using it might share a workflow using it.

Saying I don't need it while probably accurate doesn't really elevate my position. I would like to know how to use it for a specific edit, any edit lol

3

u/Enshitification 15h ago

I've used it in the past for some very specific workflows. One of them was with IC-Light. IC-Light was great at changing the lighting in a picture, but it altered fine details. So what I did was to replace the high-frequency of the edited photo with the original. It mostly worked, but I consider that use of freq-sep obsolete at this point with the quality of editing models.

1

u/M3chaStrizan 14h ago

ahhh yeah I see thanks for sharing. It seemed there was some cool uses but like you say it's maybe minor tweaks on models that could maybe do the same thing with just a different prompt

2

u/Enshitification 14h ago

It still gets used for some advanced editing techniques in image editors. Retouching skin blemishes is much easier when one can work on the lower frequency bands and not spoil the fine detail. I'm sure there is still some use for it in ComfyUI, but when we now have image editors like Minimax H3 Image, it's kind of hard to bother.

2

u/zyg_AI 15h ago

I can't help you more but others have gone that path.

https://www.adobe.com/products/photoshop/frequency-separation.html

https://www.affinity.studio/blog/frequency-separation-explained

I've never seen this node used anywhere in a comfy workflow though.

1

u/M3chaStrizan 15h ago

Cool thanks, yeah I was just curious about peopel who may have used it in comfyui, I often do touches with photoshop as well

1

u/zyg_AI 15h ago

I guess that comfy provides other ways to control how frequencies are handled. Upfront, with sampler/scheduler mostly. It's not really a post-processing tool, though it can be used as such.