comfyui-ihor-resize

A ComfyUI custom node that resizes images and masks together and returns the output dimensions.

Features

  • Three resize modes
    • resize — stretch to an explicit width × height
    • longest side — scale so the longest edge equals the target, preserving aspect ratio
    • smallest side — scale so the shortest edge equals the target, preserving aspect ratio
  • AI upscaling — connect any UPSCALE_MODEL to use a neural upscaler before the interpolation step
  • Multiple interpolation methods — nearest-exact, bilinear, area, bicubic, lanczos
  • Mask resize — the mask is resized to match the output image automatically
  • In-node preview — toggle a live image preview directly inside the node

Inputs

Name Type Description
image IMAGE Source image
mask MASK (optional) Source mask — resized to match the output
upscale_model UPSCALE_MODEL (optional) Neural upscale model used when enlarging
upscale_method combo Interpolation method
resize_mode combo resize / longest side / smallest side
target_side INT Target pixels for side-based modes
width INT Target width for resize mode
height INT Target height for resize mode
show_preview BOOLEAN Show image preview inside the node

Outputs

Name Type Description
image IMAGE Resized image
mask MASK Resized mask
height INT Output height in pixels
width INT Output width in pixels

Installation

cd ComfyUI/custom_nodes
git clone https://github.com/ihorpankin/comfyui-ihor-resize.git

Then restart ComfyUI. The node appears under image/transform as Ihor Resize.

S
Description
No description provided
Readme
30 KiB
Languages
Python 81.3%
JavaScript 18.7%