Genius Scale & Crop
Hitting an exact resolution without stretching a pixel
- image
- max_dim_image
- final_image
Ever loaded a workflow and been told your image has to be exactly 480×864, or 864×480, or die? That's the everyday reality of image-to-video: Wan, LTX and friends are trained on fixed resolutions, and the loader won't take your 1024×1536 photo as-is. Getting there without distortion means scale the longest side, then crop the excess on the other. That's the whole job Genius Scale & Crop was built for - it's one node doing a two-step dance that ComfyUI usually makes you chain together by hand.
The honest framing up front: this is not an AI node, it needs no models, no API key, and it won't surprise you. It's a thin, well-thought wrapper around ComfyUI's built-in comfy.utils.common_upscale that collapses "proportional scale to max dimension, then center-crop to exact target" into a single box. If you already have a scale-then-crop chain you're happy with, this saves you nothing but tidiness. If you keep tripping over the math, it's genuinely nicer.
How it works
Two phases, both inside the one node. Phase one scales the input so its longest side equals max_dimension, keeping the aspect ratio exactly - no crop, no distortion. Your 1024×1536 portrait becomes 576×864. Phase two takes that intermediate and resizes/crops to exactly target_width × target_height, by default center-cropping the excess. The long dimension you set up in phase one survives untouched; only the short side loses pixels.
That's why you get two outputs. max_dim_image is the phase-one result - wire it to a preview node and you can see what the crop is about to throw away before you commit. final_image is the finished exact-resolution image, the one that plugs into your VAE/encoder or video node.
The inputs that matter
Beginners really only set four things:
max_dimension- the longest side of your target. For 480×864 that's 864.target_width/target_height- your exact final resolution. One of these should equalmax_dimension.crop-center(the sane default) ordisabled. Everything else - the two_methoddropdowns - pick the resample filter (lanczos for quality, area for downscaling, nearest-exact for pixel art) and you can safely ignore them.
The values snap to steps of 8, which keeps you aligned with the resolutions video models actually accept.
The trap worth knowing
Two ways to shoot yourself here. First, if you set crop to disabled with a target aspect ratio that doesn't match the source, the node does a direct resize - that means stretching. The whole point of this node is not stretching, so leave center on unless you really mean it.
Second, and subtler: max_dimension binds to the longest side of your source image, not your target. Feeding a landscape photo into a portrait 480×864 target means phase one makes the width 864, then phase two has to cut the width from 864 down to 480 - that's over a third of the frame gone, and center-crop may decapitate your subject. For the clean workflow the README describes, pick a source that shares your target's orientation. If you need to control where it crops, this node can't help you yet - version 1.0 is center-only; top/bottom/left/right are on the author's roadmap.
Installing it
It's on the Comfy Registry, so the easy route is ComfyUI Manager → search "Genius Nodes" and install. Manual is the usual:
cd ComfyUI/custom_nodes
git clone https://github.com/GeniusGQ/ComfyUI-Genius-Nodes.git
Then restart ComfyUI. There's no requirements.txt and no models to download - the pack's only dependency is ComfyUI itself, which is refreshing in a world of node packs that drag in a whole venv. You'll find the node under the Genius category. One license note for the careful: the pack's own license is restrictive - free to use commercially, but you can't copy or redistribute the code itself, so don't fork it into your own pack.
It's a small, focused tool from a small pack (one node so far). That's fine - sometimes the whole point is fewer nodes and less mental arithmetic, not more.
Common issues
- "My image looks squashed."
cropis ondisabled, or your target aspect ratio is far from the source's. Fix the first; re-pick the source for the second. - "The node won't accept my resolution." The sliders clamp to 64–8192 in steps of 8. If your target isn't a multiple of 8, you'll have to round.
- "It's not in my node list." It's new and tiny; check the ComfyUI log for import errors, and make sure Manager actually updated the registry.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| max_dimension | INT | 86464–8192 | — |
| max_dim_method | COMBO | 5 options: area, nearest-exact, bilinear, bicubic, lanczos | |
| target_width | INT | 48064–8192 | — |
| target_height | INT | 86464–8192 | — |
| scale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| crop | COMBO | 2 options: center, disabled |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| max_dim_image | IMAGE | — |
| final_image | IMAGE | — |