Nodes/zsq_prompt/Image Detail Transfer
ComfyUI Node

Image Detail Transfer

Stealing Detail From One Image and Stamping It on Another

By windfancy·Created 2 years ago·Updated 5 months ago· 2
Image Detail Transfer
  • target
  • source
  • mask
  • image
modeadd
blur_sigma1.00
blend_factor1.000
image_outputPreview
save_prefixComfyUI

imageDetailTransfer is the node that rescues blurry upscales. You've got a target image whose colors and composition you like but whose edges are mush, and a source image with gorgeous crisp detail. This node takes the high-frequency detail from the source and stamps it onto the target. It's a small, focused trick, and it's genuinely the difference between "upscaled and soft" and "upscaled and crisp" for a lot of pipelines.

How it works

It's a frequency-separation trick, borrowed straight from ComfyUI-Easy-Use (this pack's README credits it). The node blurs both images with a Gaussian at blur_sigma, then combines them in the mode you pick. In the default add mode:

new = (source - blurred_source) + blurred_target

Read that as: "the source's fine detail, minus the source's broad tone, added on top of the target's broad tone." The blur size is what separates detail from tone, and blur_sigma (0.1–100) controls it - small sigma, only the tiniest texture transfers; larger sigma, bigger shapes come along too.

The other modes are classic Photoshop blend math - screen, overlay, soft_light, color_dodge, difference, divide, and friends - applied between the source and the blurred target. blend_factor (−10 to 10) then crossfades the final result with the original target: 1.0 is full effect, 0.0 is no change.

The inputs that matter

  • target - the image whose look you keep (usually your blurry upscale).
  • source - the image you're borrowing texture from.
  • mode - add for most detail-transfer work.
  • blur_sigma - the single knob you'll tune most.
  • blend_factor - how strong the whole thing is.
  • mask (optional) - restrict the effect to part of the frame, e.g. faces only.

The node auto-resizes target and mask to match the source, so mismatched sizes won't error out, and it runs on every image in the batch. Output is one image, with the usual image_output/save_prefix handling.

The classic workflow

The move people actually use: take your low-res original, upscale it (blurry), then use the low-res original as the source and the upscale as target. The low-res version has the sharpest edges you've got; the node transplants them onto the soft upscale, and the result looks sharper than either input. Detail transfer is also a known trick in the upscaling community precisely because plain interpolation never recovers the texture the model didn't draw.

Gotchas

Keep blur_sigma small (1–4) or you'll drag the source's broad lighting over the target and change the whole mood. And difference/divide modes are for experimentation, not day-to-day use - add is the workhorse.

Installing it

From the windfancy/zsq_prompt pack: search "zsq_prompt" in ComfyUI Manager and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/windfancy/zsq_prompt

Restart after either. The pack installs a heavy requirements list, but this node only leans on torch/Pillow, which ComfyUI already has. If Manager shows a "conflict" flag for zsq_prompt, that's the pack's generic class names colliding in the manager's index - ignore unless you're running the other pack too.

Verdict

A niche node with one killer use case. If you upscale and squint at soft edges, this is worth the five minutes to install.

CategoryZSQ/Image

Inputs (8)

NameTypeDefaultDescription
targetIMAGE
sourceIMAGE
modeCOMBOadd11 options: add, multiply, screen, overlay, soft_light, hard_light, +5
blur_sigmaFLOAT1.000.1–100
blend_factorFLOAT1.000-10–10
image_outputCOMBOPreview4 options: Hide, Preview, Save, Hide/Save
save_prefixSTRINGComfyUI
maskoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE