Nodes/ComfyUI-Koolook/Easy Resize (Koolook)
ComfyUI Node

Easy Resize (Koolook)

Easy Resize snaps your image to the grid

By malkuthro·Created 11 months ago·Updated about 24 hours ago· 8
Easy Resize (Koolook)
  • image
  • mask
  • IMAGE
  • composed_IMAGE
  • MASK
  • inverted_MASK
  • width
  • height
  • COLOR_PANEL
  • original_width
  • original_height
  • original_aspect_ratio
base_onWidth
base_size512
aspect_ratio16:9
divisible_by32
upscale_methodnearest-exact
keep_proportionstretch
crop_positioncenter
pad_color_modeBlack
panel_color_modeBlack
devicecpu
pad_color0, 0, 0
panel_color0, 0, 0
invert_composed_MASKfalse

Every video model has a resolution fetish. Wan wants multiples of 64. AnimateDiff wants a 16:9 ratio. LTX wants to know the width before it will even say hello. Easy Resize (Koolook) is the node that does the arithmetic and the resizing so you don't have to hold it in your head: pick a target aspect ratio, a base size, and a divisibility requirement, and it produces an image that's actually loadable by whatever you're feeding.

It's the EasyResize you may have seen in older workflows, renamed with the _Koolook suffix because the bare name collided with ComfyUI-EasyFilePaths. The node itself is the same code - this is the canonical ID going forward.

How it works

Give it an image, and it does a three-step dance: compute the target dimensions from base_on + base_size + aspect_ratio, snap the result to a multiple of divisible_by, then resize with upscale_method. The default divisible_by of 32 matches the 8x latent downscale most models use (64 for many video VAEs - bump it if you're feeding Wan). It's a pure geometry and resample node, the "more pixels, not more detail" kind of upscaling in the KB's taxonomy - it won't invent detail, it just gets the framing right.

The interesting part is keep_proportion. stretch fills the target exactly (fast, but distorts). letterbox / pillarbox preserve proportions and add bars, with crop_position controlling where the image sits and pad_color_mode + pad_color controlling bar color. If you're feeding video frames to a model that demands 16:9, letterboxing beats squashing every time.

There's a device toggle (cpu/cuda) for where the resize runs. Defaults to cpu, which is fine for small images and keeps VRAM free; set cuda if you're processing big batches and want it fast.

The mask path

Connect an optional mask and the node gets genuinely clever: it resizes the mask the same way, and gives you a composed_IMAGE (masked image over a solid panel), the MASK, an inverted_MASK, and a COLOR_PANEL (the background color as a full image). invert_composed_MASK flips which side of the mask shows the image versus the panel. This is the "cutout for a background-removal workflow" setup - mask in, clean subject over a solid color out, ready for compositing.

The size outputs are the sleeper feature: width, height, plus original_width, original_height, and original_aspect_ratio. Wire those into nodes that want to know the geometry without re-inspecting the image.

The inputs a beginner actually sets

Three: base_size (how big), aspect_ratio (what shape, e.g. 16:9), and divisible_by (what the model needs). Everything else has a sensible default. Set base_on to Height if your height is the constraint rather than width.

Install

Part of ComfyUI-Koolook. Manager → Install Custom Nodes → Git URL:

https://github.com/malkuthro/ComfyUI-Koolook.git

Or:

cd ComfyUI/custom_nodes
git clone https://github.com/malkuthro/ComfyUI-Koolook.git

Restart and it's under Koolook/Image. No models, no extra deps. One house rule: install the pack once. A Manager install at custom_nodes/koolook/ plus a git clone copy at custom_nodes/ComfyUI-Koolook/ loads both and the workflow store starts silently corrupting on every boot - delete one.

Common issues

  • Stretched or squashed image - keep_proportion is on stretch. Switch to letterbox/pillarbox if you care about the subject not being deformed.
  • "Image rejected by the model" errors - divisible_by doesn't match the model's requirement. Wan needs 64; check your model's docs.
  • Blurry when downscaling - nearest-exact is the default and it's right for masks but harsh on photos. For real images, switch upscale_method to lanczos or bicubic.
CategoryKoolook/Image

Inputs (15)

NameTypeDefaultDescription
imageIMAGE
base_onCOMBOWidthChoose which target dimension is driven by base_size; the other is computed from aspect_ratio.
base_sizeINT5121–16384Target width or height before snapping to divisible_by.
aspect_ratioSTRING16:9Target ratio as W:H, e.g. 16:9, 1:1, or 9:16.
divisible_byINT321–128Snap final width and height to a multiple; use the model's latent/grid requirement.
upscale_methodCOMBOnearest-exactComfyUI resize filter used for the image and mask.
keep_proportionCOMBOstretchstretch fills the target exactly; letterbox/pillarbox preserve proportions and add bars.
crop_positionCOMBOcenterPlacement of the preserved image when bars are added. Top/bottom affect letterbox; left/right affect pillarbox.
pad_color_modeCOMBOBlackColor for letterbox/pillarbox bars. Custom reads pad_color.
panel_color_modeCOMBOBlackColor for COLOR_PANEL and masked composed_IMAGE background. Custom reads panel_color.
deviceCOMBOcpuDevice used for resize/composite tensors.
maskoptMASK
pad_coloroptSTRING0, 0, 0Custom RGB bar color in 0..1 floats, e.g. 0, 0, 0 or 1, 0.5, 0.
panel_coloroptSTRING0, 0, 0Custom RGB color for COLOR_PANEL and mask composition background.
invert_composed_MASKoptBOOLEANfalseFlip which side of the resized mask shows IMAGE vs COLOR_PANEL in composed_IMAGE.

Outputs (10)

NameTypeDescription
IMAGEIMAGE
composed_IMAGEIMAGE
MASKMASK
inverted_MASKMASK
widthINT
heightINT
COLOR_PANELIMAGE
original_widthINT
original_heightINT
original_aspect_ratioSTRING