Nodes/ComfyUI-Light-Tool/Light-Tool: Resize Image V2
ComfyUI Node

Light-Tool: Resize Image V2

Resize by one fixed side, keep the aspect ratio intact

By ihmily·Created 2 years ago·Updated 4 months ago· 20
Light-Tool: Resize Image V2
  • image
  • image
width512
height512
basewidth
resize_methodLANCZOS
modeRGB

Light-Tool: ResizeImageV2 answers one question: "I want the width to be exactly this, but keep the proportions." You tell it the target side, it scales the other side to match, and your aspect ratio survives intact. It's the "resize by one anchor dimension" node, and it's quietly one of the most useful of the pack's four resize variants.

The README labels it "Resize Image V2" and describes it as reducing by a fixed width or height, but it handles both directions - type a bigger width and it scales up just as happily.

How it works

The base input decides which side is the anchor. With base set to width, the node treats the width value as your target: it works out the percentage the width changed by and applies it to the height. With base set to height, the roles flip and height becomes the fixed dimension. Either way, one value drives everything, which is exactly what you want when you're matching one edge to a layout slot or a latent size while letting the other side fall where it lands.

For example: a 1024×768 image, base = width, width = 512 → the height scales by 0.5 too, giving 512×384. Set base = height, height = 384, and you'd get the same result from the other direction.

Under the hood it's a Pillow resize per image in the batch, with your choice of resize_method (default LANCZOS, then BICUBIC, BILINEAR, NEAREST) and mode (default RGB; use RGBA to keep transparency when resizing cutouts).

Inputs and output

  • image - the IMAGE tensor.
  • width, height - both default to 512. Only the one matched by base actually matters.
  • base - width or height, the anchor.
  • resize_method, mode - quality/format controls.

One image out, batch preserved.

Where you'll actually use it

The anchor-resize pattern shows up constantly in real workflows:

  • Fitting a reference into a fixed-width preview without hand-computing the height.
  • Matching the short side of an image to a latent dimension before VAE encode - set base to height, punch in 1024, done.
  • Building consistent thumbnail strips where every image must share a width.

Compared to the pack's other resizers: ResizeImage does exact width and height (breaking the ratio - different job), ResizeImageByRatio scales by a multiplier (great for "half size," useless when you have a concrete target), and ResizeImageByMaxSize only shrinks. V2 is the one for "this edge must be this many pixels."

Gotchas

Nothing exotic, but two things to keep in mind: the non-anchored side comes out whatever the ratio dictates, so don't assume it's a multiple of 8 - if a downstream VAE is fussy, round yourself or use the pack's Safe Image Crop. And the widget defaults of 512×512 can mislead you into thinking both fields matter; only the anchored one does. Set base deliberately and read the graph accordingly.

Standard install: ComfyUI Manager → search ComfyUI-Light-Tool, or clone into custom_nodes and pip install -r requirements.txt, then restart. No model files in this pack.

CategoryComfyUI-Light-Tool/image/Resize

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
widthINT5120–8192
heightINT5120–8192
baseCOMBOwidth2 options: width, height
resize_methodCOMBOLANCZOS4 options: LANCZOS, BICUBIC, NEAREST, BILINEAR
modeCOMBORGB3 options: RGB, RGBA, L

Outputs (1)

NameTypeDescription
imageIMAGE