TS Model Resize
Stop Googling \"832×480 or 1280×720?\" — Pick the Model and Let the Node Do the Maths
- image
- image
- width
- height
- mask
The size is not a preference, it's a constraint
Every model has resolutions it was trained on, and going off them is the oldest self-inflicted wound in this hobby. SD 1.5 at 512, SDXL inside its bucket list, Wan at 480p or 720p and nothing else. Do it wrong and you get the classic package: a 16:9 render with a stretched face, a portrait where everyone has two chins, or tiling patterns because the model decided your 1920×1080 request is just more canvas to repeat itself on.
The old fix was a spreadsheet and an ImageScale node. The modern fix is admitting the sizes belong to the model, and letting a node own the table.
TS Model Resize is that: you pick the model, it picks the size. Feed it 1920×1080 with Wan 720p selected and you get 1280×720. Feed it a phone shot and you get 720×1280.
Two kinds of preset, and you can tell them apart
Some models ship a fixed list of sizes. Wan 2.1/2.2 14B has 1280×720 and, on the 480p preset, 832×480. Wan 2.2 TI2V 5B is 1280×704. Qwen Image has its official ratio table, which gives seven usable sizes once portrait twins are generated - its square 1328×1328 doesn't need flipping. SDXL gets the eleven buckets from the paper, labelled "SDXL / Illustrious / Pony" because they're all the same frame. With these, the bucket whose aspect ratio is nearest wins, compared in log space so 2:1 and 1:2 are equally far from square - which is how your eye judges it.
Others take any aspect at a pixel budget on a grid. FLUX gets 1 MP or the 2 MP preset in steps of 16, LTX-2/2.5 a 720p area in steps of 32, HunyuanVideo 1.5 an area in steps of 16. Here the picture keeps its own shape: a 16:9 frame under the LTX preset lands on 1280×704, and only a handful of pixels get trimmed to the grid. This is the mode that matches how 2026 models behave - a megapixel band with soft degradation instead of hard bucket walls.
One detail worth knowing: Qwen Image's 4:3 is 1472×1104. Plenty of community nodes say 1472×1140. One of those came from the model's own aspect_ratios table, the other didn't.
What you actually set
model is the whole point - pick the thing you're about to sample with. fit decides how the picture gets to the target: crop fills the frame and trims the overflow with no distortion, pad keeps the whole picture and adds bars, stretch distorts to fit exactly. Crop is the sane default; stretch ruins faces and you should basically never reach for it.
anchor sets which part survives the crop - center or any of the four edges. On a tall phone photo cropped for a landscape bucket, top is the difference between a portrait and a chin. It positions the picture when padding too. pad_color only matters for pad, and includes edge, which replicates the border pixels outward instead of painting black bars - far easier on the model than a hard black line.
Four outputs, two of which people ignore and shouldn't. image is the resized batch (frame by frame, alpha channel along, transparent on the bars). width and height are plain INTs, for latent nodes that want numbers rather than a tensor. And mask is 1 on the picture, 0 on the padding - wire that into an outpaint and you fill the bars instead of shipping them.
Installing
ComfyUI Manager → search Timesaver → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/AlexYez/comfyui-timesaver
cd comfyui-timesaver
python -m pip install -r requirements.txt
Restart fully, not just the browser tab. The node needs nothing exotic - torch and bicubic interpolation - but the pack's core requirements aren't small (transformers>=5.2.0, openai-whisper, opencv-python-headless), so don't install it on a lean environment you care about.
Where people get burned
A one-bucket preset makes everything that shape. Wan 720p has a single size, so a 4:3 photo doesn't get a 4:3 bucket - it gets cropped to 16:9, sides and all. If that's unacceptable, switch fit to pad and mean it.
Choosing the wrong Wan. The 14B and the TI2V 5B do not take the same resolution: 1280×720 versus 1280×704. Sixteen pixels matters to a video model. Pick the preset matching the checkpoint you actually loaded.
Reaching for it when you know your numbers. If you want 1024×1536 specifically, this isn't your node - the pack has a plain TS Image Resize for explicit sizes, megapixels, scale factors and divisible_by. Model Resize is for when the model's own table is the authority.
Leaving the mask unconnected. Padding without wiring the mask into an outpaint gets you a nicely framed image with two black bars you'll crop in Photoshop anyway - the exact trip you installed a node to avoid.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Any size, any orientation; a batch is resized frame by frame. | |
| model | COMBO | Wan 2.1 / 2.2 14B — 720p | The model the picture is meant for. Its own resolutions are used, in the orientation of the picture. |
| fit | COMBO | crop | crop: fill the frame and trim what sticks out (nothing is distorted). pad: show the whole picture and add bars. stretch: distort to the exact size. |
| anchor | COMBO | center | Which part is kept when cropping (or where the picture sits when padding). top keeps faces in tall shots. |
| pad_color | COMBO | black | Bars for 'pad'. edge repeats the border pixels. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The picture at the model's resolution. |
| width | INT | — |
| height | INT | — |
| mask | MASK | 1 on the picture, 0 on the bars added by 'pad' (all 1 otherwise). |