ComfyUI Node

Image Resize

Resize an image to an exact width and height

By jamesWalker55·Created 3 years ago·Updated about a year ago· 217
Image Resize
  • image
  • IMAGE
height512
width512
interpolation_mode

JWImageResize scales an image to the exact width and height you type in, and lets you pick the interpolation used to get there. No aspect-ratio protection, no "keep proportions" - you say 768×512, you get 768×512, stretched or squashed if that doesn't match the original shape. That bluntness is a feature when you know the dimensions you want.

You'll use it constantly in the plumbing between stages: getting a loaded image to the resolution your model expects, matching two images to the same size before a mix or a comparison, or preparing a ControlNet input. It's one of the most-reached-for nodes in this pack because resizing is a chore that comes up in nearly every non-trivial workflow. The pack is full of small tools like this - nothing that generates an image, everything that gets an image ready for the node that does.

How it works

It takes the image tensor and resamples it to your target dimensions using the interpolation mode you choose. Because width and height are independent, the aspect ratio is whatever your two numbers imply - if they don't match the source, the image distorts. If you want to keep proportions, use one of the sibling nodes (JWImageResizeByLongerSide / JWImageResizeByShorterSide) that resize one dimension and let the other follow.

The inputs and outputs that matter

  • image (IMAGE) - the image (or batch) to resize.
  • height and width (INT, both default 512) - the exact target size in pixels. You can type them, or wire them from another node to drive the size dynamically - feeding a computed INT into these is a common trick.
  • interpolation_mode (enum: bicubic / bilinear / nearest / nearest exact) - how pixels are sampled. bicubic is the smooth, general-purpose default for photos. bilinear is a touch softer and faster. nearest / nearest exact keep hard edges with no blending - right for pixel art, masks, or anything you don't want smoothed.
  • Output: IMAGE - the resized image.

How to install it

Part of jamesWalker55/comfyui-various, a pack of small utility nodes.

  • ComfyUI Manager: search "Various ComfyUI Nodes by Type", install, restart. Node came in red with a downloaded workflow? Install Missing Custom Nodes.
  • Manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/jamesWalker55/comfyui-various
    
    Restart afterward. No models, no dependencies.

Under the jamesWalker55 category after restart.

Common issues

  • My image looks stretched. That's the design - this node does exact dimensions, not proportional scaling. If the target shape differs from the source, it distorts. Use a by-longer-side / by-shorter-side node to preserve aspect ratio, then crop to your exact box if needed.
  • Blurry results after upscaling. A plain resize just interpolates pixels - it doesn't add detail, so pushing an image much larger looks soft. For real upscaling you want a model-based upscaler (ESRGAN-family, or a latent upscale + resample pass); this node is for fitting to a size, not inventing detail.
  • Dimensions off by a pixel or not divisible by 8. Diffusion models like sizes divisible by 8 (often 64). Type clean multiples, or if you're computing them, round to a valid multiple before wiring them in.
  • Node is red / missing. The pack isn't installed. Install via Manager or clone the repo, then restart.

Reach for JWImageResize when you know the exact box you need. When you only care about one dimension and want the other to follow, its by-side cousins are the better call.

CategoryjamesWalker55

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
heightINT5120–99999
widthINT5120–99999
interpolation_modeCOMBO4 options: bicubic, bilinear, nearest, nearest exact

Outputs (1)

NameTypeDescription
IMAGEIMAGE