ComfyUI Node

Resampler | Jinc-Lanczos

Rotationally symmetric, and worth the wait

By wmpmiles·Created 2 years ago·Updated about a year ago· 5
Resampler | Jinc-Lanczos
    • resampler
    radius3

    Resampler | Jinc-Lanczos is the perfectionist's version of Lanczos. Regular Lanczos is separable - you filter horizontally, then vertically - which is fast but subtly anisotropic: diagonal edges get treated differently from horizontal and vertical ones. Jinc-Lanczos replaces the separable sinc with a rotationally symmetric kernel (a jinc window over a 2D Bessel-derived function), so the filter has no preferred direction. If you've ever seen faint directional artifacts or "stepped" diagonal lines in a big Lanczos upscale, this is the filter designed to not do that.

    It's the quality reference in this pack's resampling family, and the trade is blunt: it's a true 2D convolution instead of two 1D passes, so it's noticeably slower. On a big image that can be the difference between instant and "wait, is it frozen?" - it isn't frozen, it's just doing more math per output pixel.

    How it works

    Like Resampler | Lanczos, it takes one input, radius (integer, default 3), and the kernel is jinc(x) * lanczos_window(x). Same default of 3 lobes, same general behavior of "sharper than bilinear, some ringing on hard edges." The output is a resampler wire that you plug into Resample Image, Resample Mask, or Resample Latent.

    When to actually use it

    Honest answer: rarely, and that's fine. For most upscales the separable Lanczos is visually indistinguishable and much faster. Jinc-Lanczos earns its keep when:

    • You're upscaling something with lots of diagonal and curved lines - text at an angle, architecture, line art - where anisotropy shows up most.
    • You want a single "best" pass and you have the time budget. This is the filter you'd pick for a final render you're going to scrutinize, not for a batch of 500 thumbs.

    If you don't know whether you need it, you don't need it - use Resampler | Lanczos and move on. But if a Lanczos upscale is giving you subtle stepping on diagonals, swap this in and compare. The rest of the workflow doesn't change: same radius input, same resampler wire, same Resample nodes to consume it.

    Installing

    Part of comfyui-some-image-processing-stuff:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wmpmiles/comfyui-some-image-processing-stuff
    

    Restart, or install via ComfyUI Manager (search "Some Image Processing Stuff"). No models, no extra dependencies - just torch math. And the usual pack gotcha applies: the resampler output has to be wired into a Resample node; it doesn't do anything sitting alone on the canvas.

    Categoryresampling

    Inputs (1)

    NameTypeDefaultDescription
    radiusINT3

    Outputs (1)

    NameTypeDescription
    resamplerRESAMPLER