Nodes/Deno Custom Nodes/(Deno) Resize Box
ComfyUI Node

(Deno) Resize Box

Pick a resolution once, wire it everywhere, stop doing the math

By Deno2026·Created 5 months ago·Updated about 20 hours ago· 157
(Deno) Resize Box
  • image
  • image
  • width
  • height
modePreset Ratio
ratio_preset16:9
megapixels1.00
width1024
height1024
divisible_by32
resize_methodCenter Crop (Fill)
interpolationlanczos
crop_x0.50
crop_y0.50
crop_zoom1.00

Every serious ComfyUI workflow eventually becomes a pile of width/height widgets that all need to agree, and when you change the target resolution you get to hunt down every one of them. (Deno) Resize Box is the pack's answer: one node where you define the size once - by preset ratio, by megapixels, or by hand - and it hands you clean width and height integers to wire into your latent, sampler, and empty-latent nodes, plus an optional resized image if you feed one in. Change one node, and every downstream consumer updates.

How it works

Three modes:

  • Preset Ratio (default) - pick ratio_preset (16:9 default, 13 presets total) and a megapixels target (1.0 default). The node computes the actual width/height from those two numbers.
  • Manual Input - you type width and height directly (both 1024 default).
  • Keep Input Ratio - derive the size from the connected input image.

divisible_by (default 32) rounds the result to a model-safe multiple - the single most common source of "my latent is the wrong shape" errors, handled here instead of by you doing mental arithmetic. There's a live ratio/size preview right in the node, so you see what you're about to get.

The image path is worth knowing: if you connect an image, the node resizes it with resize_method (Center Crop (Fill) or Fit) and interpolation (lanczos default) and outputs it. If you don't connect one, it still works - it creates a blank image at the chosen size. So the node doubles as a plain resize box and a pure resolution calculator, depending on whether image is connected.

Inputs and outputs

  • mode, ratio_preset, megapixels, width, height, divisible_by, resize_method, interpolation.
  • Optional image - resize it, or leave empty for the blank-image fallback.
  • Outputs: image, width, height.

Install and the honest take

cd ComfyUI/custom_nodes
git clone https://github.com/Deno2026/comfyui-deno-custom-nodes.git
# restart ComfyUI

No dependencies. This is a genuinely thin utility node, and that's fine - it's the kind of node you install the pack for without thinking about it.

The thing to keep straight: width and height are plain integers, so this node shines when your workflow routes those integers around (empty latents, text encoders, upscalers that take explicit sizes). If your workflow instead relies on a single "resolution preset" that also drives other things - aspect, megapixel budget, filename - you'll still want a settings node for that. Where people do get bitten: forgetting that divisible_by applies in all modes, so a "manual" 1000×1000 becomes 992×992 or similar - check the preview before wiring it into something that demanded an exact multiple and then silently did its own rounding.

CategoryDeno/Image

Inputs (12)

NameTypeDefaultDescription
modeCOMBOPreset RatioChoose how the output size is decided: preset ratio, manual width/height, or the input image ratio.
ratio_presetCOMBO16:9Target aspect ratio used in Preset Ratio mode.
megapixelsFLOAT1.000.01–10Target total image size in megapixels for automatic sizing modes.
widthINT102464–8192Manual or fallback output width in pixels.
heightINT102464–8192Manual or fallback output height in pixels.
divisible_byCOMBO32Round the final size to a model-safe multiple such as 16 or 32.
resize_methodCOMBOCenter Crop (Fill)Choose center crop, draggable crop-position, or fit/letterbox behavior when resizing an input image.
interpolationCOMBOlanczosResize filter. Lanczos is the default quality choice.
imageoptIMAGEOptional source image. If empty, the node creates a blank image at the selected size.
crop_xoptFLOAT0.500–1Saved horizontal crop position. Drag inside the Resize Box preview to change it.
crop_yoptFLOAT0.500–1Saved vertical crop position. Drag inside the Resize Box preview to change it.
crop_zoomoptFLOAT1.001–32Saved crop zoom. Drag any crop corner while keeping the output aspect ratio locked.

Outputs (3)

NameTypeDescription
imageIMAGEResized image, or a blank image if no input image was connected.
widthINTFinal output width in pixels.
heightINTFinal output height in pixels.