ImageScaleShort PM
Scale the Short Side, Keep Your Aspect Ratio — and Dodge the 32px Trap
- image
- IMAGE
Every portrait workflow starts with the same problem: your input photo is 4032x3024, and everything downstream wants something smaller and friendlier. PM_ImageScaleShort is Portrait-Maker's answer - resize so that the shorter side of the image lands on a length you pick, and let the longer side follow along. Aspect ratio stays intact, nothing gets squished, and you get a workable image in one step.
Why "short side" instead of a plain resize?
Because faces and photos come in every orientation. A 3000x4000 portrait photo has a short side of 3000; a wide 4000x2250 landscape shot has a short side of 2250. If you typed an exact 512x512 target you'd destroy one of them. Scaling on the short side is the polite way to bring a whole batch of differently-shaped photos down to a common working size - the standard trick from the original EasyPhoto pipeline, which this pack is porting.
Under the hood it's LANCZOS resampling: it computes the ratio of your short side to the requested size, then scales both dimensions by that ratio. One useful side effect: if your image's short side is already smaller than the size you asked for, it upscales. So it's a normalize-to-working-size node, not strictly a downscaler.
The inputs
Three inputs, one output (an IMAGE):
- image - the photo to scale.
- size - desired length for the short side, 0–2048, default 512.
- crop_face - boolean, default off.
Here's the part worth reading twice, because the name lies. crop_face doesn't crop any face. Look at the source: when enabled, it snaps the resulting width and height down to the nearest multiple of 32. The README says it plainly: "Ensure the resulting width and height are multiples of 32." That matters because the GAN-based nodes in this pack (makeup transfer, face matting) are picky about dimensions divisible by 32 - feed one a 517px-wide image and you can get silent misbehavior or errors. So if you're scaling up for a model-heavy step, flip crop_face on. If you're just making a preview or feeding the merge/other utility nodes, leave it off - the exact resize keeps things clean.
Install and gotchas
This node ships in the ComfyUI-Portrait-Maker pack. Install via ComfyUI Manager (search "Portrait-Maker") or:
cd ComfyUI/custom_nodes
git clone https://github.com/THtianhao/ComfyUI-Portrait-Maker.git
then restart ComfyUI. Heads-up on first launch: the pack auto-installs heavy deps (tensorflow, insightface, modelscope, a pinned diffusers==0.18.2 - that pin is aggressive and can conflict with other packs' newer diffusers) and starts downloading a stack of models with no hash verification. ImageScaleShort itself is pure image math and doesn't need any of that, but you can't install it alone.
The one genuine trap here: this node doesn't resize to an exact target - it resizes to a target short side. If your next node insists on an exact width and height (say, a face crop box), chain this with PM_ImageResizeTarget or crop to the box yourself. And remember everything in this pack lives under the misspelled protrait/ category - that's the pack, not your search being broken.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size | INT | 5120–2048 | — |
| crop_face | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |