Nodes/GraftingRayman/GR Image Resize Methods
ComfyUI Node

GR Image Resize Methods

Resize with the interpolation filter that actually matters

By GraftingRayman·Created 2 years ago·Updated about a month ago· 76
GR Image Resize Methods
    • IMAGE
    • MASK
    image
    width
    height
    method

    Most resize nodes in ComfyUI just resize - they pick a filter for you and don't ask. This one exposes the actual interpolation method as a dropdown, which is a small thing until you're downscaling a detailed image and the default filter is quietly smearing your fine detail into mush. Six choices: NEAREST, BOX, BILINEAR, HAMMING, BICUBIC, LANCZOS. These are the classic PIL/Pillow resampling filters, and each one is a genuinely different trade-off, not a cosmetic label.

    NEAREST is the fastest and the crudest - no blending at all, just picks the closest source pixel. Fine for pixel art or masks where you want hard edges preserved, bad for anything you want smooth. BOX and HAMMING are solid, cheap choices specifically for downscaling. BILINEAR is the reasonable middle-ground default most tools reach for. BICUBIC gives sharper results at a bit more cost. LANCZOS is the highest-quality option here - best for preserving detail when downscaling a large image significantly, at the highest compute cost of the six.

    How it works

    Feed it an image and target width/height, and it resizes using whichever method you picked. That's the entire job - no cropping, no aspect-ratio locking, no fancy resolution presets. It's a lean, single-purpose node, which is exactly why it's worth having alongside a fancier resize node: sometimes you just need control over the filter without the rest of the machinery.

    The inputs and outputs that matter

    • width and height - target dimensions, in pixels.
    • method - the one input that makes this node worth using over a generic resize. Default to LANCZOS if quality matters and you can afford the extra time; drop to BILINEAR or BOX for speed on a batch job; use NEAREST only when you specifically want blocky, unblended pixels (masks, pixel art, debug previews).

    Outputs are IMAGE (the resized result) and MASK - a mask sized to match the new dimensions, which saves you wiring up a separate resize step if something downstream expects both.

    How to install it

    Search GraftingRayman in ComfyUI Manager, or clone it manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GraftingRayman/ComfyUI_GraftingRayman
    

    Restart ComfyUI afterward. Like every node in this pack, it needs OpenAI's CLIP installed as a separate step or the whole pack fails to import - for portable ComfyUI run .\python_embeded\python.exe -m pip install git+https://github.com/openai/CLIP.git from your ComfyUI folder; for a system Python install it's pip install git+https://github.com/openai/CLIP.git.

    Common issues & troubleshooting

    The pack doesn't load at all. This is almost always the missing CLIP dependency above, even for a node like this one that has nothing to do with CLIP itself - the whole pack shares one Python module, so one missing import takes everything down. Check your ComfyUI console log at startup and run the pip install if you see an import error from ComfyUI_GraftingRayman.

    Resize looks worse than you expected on a big downscale. Wrong filter for the job. NEAREST and BILINEAR will alias and lose detail on aggressive downscaling; switch to LANCZOS or BOX for that case specifically.

    Upscaling with LANCZOS looks soft or ringy. LANCZOS is tuned for downscaling; for a significant upscale, a dedicated AI upscaler will beat any of these six filters by a wide margin. Use this node's methods for modest resizes and pre/post-processing, not as a substitute for real upscaling.

    Output mask isn't what you expected. The mask output isn't derived from any alpha or segmentation - it's just sized to match your new width/height. If you need a meaningful mask (subject isolation, alpha-based), generate that separately and don't rely on this node to produce it.

    CategoryGraftingRayman/Images

    Inputs (4)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    widthINT
    heightINT
    methodCOMBO6 options: NEAREST, BOX, BILINEAR, HAMMING, BICUBIC, LANCZOS

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK