Nodes/SP-Nodes/SP_HiresGen_Sharpen
ComfyUI Node

SP_HiresGen_Sharpen

An unsharp-mask pass for when SP_HiresGen comes out soft

By bananasss00·Created 2 years ago·Updated 10 days ago· 20
SP_HiresGen_Sharpen
    • sharpen_cfg
    sharpen_radius1
    sigma0.20
    alpha0.20

    Multi-pass hi-res generation has a known side effect: run an image through enough low-denoise iterations and it tends to soften, especially once the denoise ramp (SP_HiresGen_Dynamic's end_denoise) has eased all the way down to a light touch-up pass. SP_HiresGen_Sharpen is the optional counter for that - an unsharp-mask-style filter you wire into SP_HiresGen to punch detail back in after the fact, rather than fighting softness by cranking denoise back up and risking composition drift instead.

    How it works

    This is a classic unsharp mask, expressed in the three parameters that technique always comes down to. sharpen_radius (1-31) sets how wide an area the filter samples around each pixel to decide what counts as "detail" versus "smooth region" - small radius sharpens fine texture, larger radius affects broader edges. sigma (0.1-10) controls the blur that gets subtracted from the original to find that detail in the first place - this is the "unsharp" part of unsharp masking: blur the image, subtract the blur from the original, and what's left over is the detail signal. alpha (0-5) is the strength - how much of that extracted detail gets added back on top of the image, with 0 doing nothing and higher values pushing harder, at the usual cost of ringing/haloing artifacts if you push too far.

    It's a small, cheap post-process - nothing here reruns the model or touches VAE, it's operating directly on the finished pixels.

    Inputs and outputs that matter

    • sharpen_radius (default 1, up to 31) - how wide the detail-detection kernel is; start low and widen only if fine texture still looks flat.
    • sigma (default 0.2, 0.1-10) - the blur radius behind the mask; higher values pull in coarser detail.
    • alpha (default 0.2, 0-5) - sharpening strength; the one you'll actually reach for first.
    • Output: sharpen_cfg, wired into SP_HiresGen's optional sharpen_cfg_opt input.

    How to install it

    Comes with the rest of the pack. Through ComfyUI Manager: search "SP-Nodes," install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bananasss00/ComfyUI-SP-Nodes
    

    Restart ComfyUI afterward. No model to download, no extra dependency - this is a pixel-space filter, not something that touches your checkpoint or VAE.

    Common issues & troubleshooting

    Nothing visibly changes. This node's output only does anything if it's actually wired into SP_HiresGen's sharpen_cfg_opt - it's an optional input, so it's easy to build the config and forget to connect it.

    Haloing or crunchy edges around high-contrast areas. That's alpha pushed too high for the image - back it down toward the 0.1-0.3 range and check again before touching the other two parameters.

    Sharpening looks like it's amplifying noise rather than detail. Lower sigma slightly so the mask is picking up finer structure instead of the coarser blur band that's catching noise along with real detail; a small sharpen_radius also helps keep the effect localized.

    CategorySP-Nodes/HiresGen

    Inputs (3)

    NameTypeDefaultDescription
    sharpen_radiusINT11–31
    sigmaFLOAT0.200.1–10
    alphaFLOAT0.200–5

    Outputs (1)

    NameTypeDescription
    sharpen_cfgSP_HiresGen_Sharpen