Nodes/ComfyUI/LatentOperationSharpen
ComfyUI Node Runs on cloud

LatentOperationSharpen

Build the sharpen filter, not the sharpened image

By Comfy-Org·Created 4 years ago·Updated 7 minutes ago· 129,953
LatentOperationSharpen
    • LATENT_OPERATION
    sharpen_radius9
    sigma1.0
    alpha0.10

    LatentOperationSharpen doesn't sharpen anything - it builds a sharpen operation. The output is a LATENT_OPERATION, a packaged filter function you then hand to LatentApplyOperation (apply once, pre-sampling) or LatentApplyOperationCFG (apply every denoising step). It's the parameter-definition half of ComfyUI's experimental latent-operations system, and today it's the only operation node in that family - which means if you're going to use these nodes at all, you're using this one.

    Three parameters define the filter, all marked advanced:

    • sharpen_radius (default 9, range 1–31) - the kernel size of the sharpen. Bigger radius spreads the effect over a wider neighborhood of the latent.
    • sigma (default 1.0, 0.1–10) - the Gaussian blur width the unsharp-mask math is built on. This controls how "local" the detail detection is.
    • alpha (default 0.1, 0–5) - how strongly the sharpening is applied. 0 is a no-op; this is your volume knob.

    Mechanically, it constructs an unsharp-mask-style kernel - a Gaussian built from radius and sigma, scaled by alpha, with the center adjusted so the kernel sums to a sharpen rather than a blur - and packages it as a callable that operates on a latent. It even normalizes each latent by its per-sample luminance before filtering, so the sharpen strength doesn't blow up depending on how bright the input is.

    The tuning loop that will annoy you

    Because the output is an operation and the operation runs in latent space, you can't see what you've built. There's no preview on this node, and the effect only shows up after you decode the latents it touched. Tuning becomes a decode-and-check loop: adjust alpha, run, decode, squint, repeat. That's the cost of the whole experimental design, and it's the main reason people bounce off these nodes. The sane approach: fix radius and sigma first, then sweep alpha from small to large, and remember that if you're feeding it into the CFG variant, a tiny alpha goes a long way because the filter compounds every step.

    Honest verdict

    This is an experimental node for latent-space tinkerers, not a daily driver. The realistic use is mild sharpen-on-source in a detail-pass workflow - and even then, the pixel-space equivalent (sharpen the decoded image, or sharpen before encode) is usually easier to reason about. Where this node wins is when you specifically want sharpening folded into generation, either as a one-shot latent pre-filter or as per-step guidance shaping. If neither of those describes you, you can skip it; it ships with ComfyUI core and will be there when curiosity strikes.

    Categorymodel/latent/advanced/operations

    Inputs (3)

    NameTypeDefaultDescription
    sharpen_radiusINT91–31
    sigmaFLOAT1.00.1–10
    alphaFLOAT0.100–5

    Outputs (1)

    NameTypeDescription
    LATENT_OPERATIONLATENT_OPERATION