Nodes/ComfyUI-productfix/Detail transfer mode:add (middlek)
ComfyUI Node

Detail transfer mode:add (middlek)

Transplant fine detail from your original photo onto the regenerated one

By MiddleKD·Created 2 years ago·Updated about a year ago· 21
Detail transfer mode:add (middlek)
  • target
  • source
  • mask
  • IMAGE
blur1.00
blend_ratio1.000

Relight a product photo with IC-Light and the result looks great - right up until you zoom into the label and the letters have turned to soup. The fix is a classic photo-retoucher's trick called frequency separation, and this node is that trick in graph form. It's the pack's "detail transfer" and it's probably the most broadly useful node in here.

How it works

The idea is simple: split an image into low-frequency (color, shading, broad structure) and high-frequency (text edges, texture, pores) parts, then mix and match. DetailTransferAdd does it with a Gaussian blur:

high-pass detail of source = source − blur(source)
low-pass base of target    = blur(target)
out = detail + base

So you get the fine detail of your source (the original product photo, with crisp lettering) laid over the broad structure of your target (the relit, regenerated image with nice lighting). Then blend_ratio controls how much of that composite replaces the target, and an optional mask confines the whole thing to a region. It's the same frequency-separation workflow the IC-Light community converged on to stop relighting from wrecking skin and labels - except it's one node instead of a blur/merge tangle.

Inputs that matter

  • target - the image whose structure you keep. Usually your regenerated/relit output.
  • source - the image whose fine detail you want. The original product photo.
  • blur - sigma for the Gaussian blur, default 1.0. Higher = more aggressive separation, and the "detail" band gets broader. For tight text, keep it low-ish.
  • blend_ratio - default 1.0, and the interesting range is bigger than you think: it goes from -10 to 10. At 1.0 you get a straight transplant. Push past 1.0 to overdrive the detail (sharpening-ish), or go negative to reverse it. Play with it; the sweet spot for text is usually 0.8–1.2.
  • mask - optional. Restricts transfer to, say, the OCR text mask from GetTextMask. This is the move: relight everything, transplant crisp lettering back only where the text is.

The output

A single IMAGE, same size and batch as the target. Chain it into the VAE decode or feed it to upscaling - it's just an image.

The "Add" in the name is a hint: this is the "mode:add" variant of the pack's detail-transfer idea. The latent-space sibling is DetailTransferLatentAdd, which does the same math mid-pipeline on LATENT tensors instead. For 95% of people the image-domain version is the one to reach for - you only need the latent version if you're compositing during sampling.

Install

Comes with the pack. ComfyUI Manager search "ComfyUI-productfix", or:

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

Then restart. No extra models needed for this node alone; easyocr installs as part of the pack but only activates when you use GetTextMask.

Common issues

  • Result looks plasticky or over-sharp - blur too low or blend_ratio too high. Back blend_ratio toward 0.7.
  • Detail smears into the background - you skipped the mask. Feed it one.
  • Source and target sizes differ - handled; the node resizes source to target, so mismatched inputs won't crash, they'll just blend at target resolution.

One honest caveat: this is a tiny, low-traffic pack from a single Korean developer, and there's basically no community lore to lean on. But the mechanism here is textbook frequency separation, and that's a technique you can reason about yourself - which makes this the pack node that's easiest to trust.

Categoryproductfix

Inputs (5)

NameTypeDefaultDescription
targetIMAGE
sourceIMAGE
blurFLOAT1.000.1–100
blend_ratioFLOAT1.000-10–10
maskoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE