Easy Resize (Koolook)
Easy Resize snaps your image to the grid
- image
- mask
- IMAGE
- composed_IMAGE
- MASK
- inverted_MASK
- width
- height
- COLOR_PANEL
- original_width
- original_height
- original_aspect_ratio
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_proportionis onstretch. Switch to letterbox/pillarbox if you care about the subject not being deformed. - "Image rejected by the model" errors -
divisible_bydoesn't match the model's requirement. Wan needs 64; check your model's docs. - Blurry when downscaling -
nearest-exactis the default and it's right for masks but harsh on photos. For real images, switchupscale_methodto lanczos or bicubic.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| base_on | COMBO | Width | Choose which target dimension is driven by base_size; the other is computed from aspect_ratio. |
| base_size | INT | 5121–16384 | Target width or height before snapping to divisible_by. |
| aspect_ratio | STRING | 16:9 | Target ratio as W:H, e.g. 16:9, 1:1, or 9:16. |
| divisible_by | INT | 321–128 | Snap final width and height to a multiple; use the model's latent/grid requirement. |
| upscale_method | COMBO | nearest-exact | ComfyUI resize filter used for the image and mask. |
| keep_proportion | COMBO | stretch | stretch fills the target exactly; letterbox/pillarbox preserve proportions and add bars. |
| crop_position | COMBO | center | Placement of the preserved image when bars are added. Top/bottom affect letterbox; left/right affect pillarbox. |
| pad_color_mode | COMBO | Black | Color for letterbox/pillarbox bars. Custom reads pad_color. |
| panel_color_mode | COMBO | Black | Color for COLOR_PANEL and masked composed_IMAGE background. Custom reads panel_color. |
| device | COMBO | cpu | Device used for resize/composite tensors. |
| maskopt | MASK | — | |
| pad_coloropt | STRING | 0, 0, 0 | Custom RGB bar color in 0..1 floats, e.g. 0, 0, 0 or 1, 0.5, 0. |
| panel_coloropt | STRING | 0, 0, 0 | Custom RGB color for COLOR_PANEL and mask composition background. |
| invert_composed_MASKopt | BOOLEAN | false | Flip which side of the resized mask shows IMAGE vs COLOR_PANEL in composed_IMAGE. |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| composed_IMAGE | IMAGE | — |
| MASK | MASK | — |
| inverted_MASK | MASK | — |
| width | INT | — |
| height | INT | — |
| COLOR_PANEL | IMAGE | — |
| original_width | INT | — |
| original_height | INT | — |
| original_aspect_ratio | STRING | — |