Image Make Square
Pad a photo to 1:1 without stretching or cropping it
- image
- IMAGE
You've got a photo that isn't square, and the next node in your chain wants it to be. Maybe it's a face-crop step, maybe it's a preprocessor that assumes a 1:1 frame, maybe you just don't want ComfyUI's default resize squashing a portrait into a fat oval. The lazy fixes are both bad: stretch it and everyone looks like they've been run over by a steamroller, center-crop it and you lose whatever was near the edges. Image Make Square does the third thing - it pads the short side out until width equals height, so the actual pixels of your image stay untouched and correctly proportioned.
This is the same idea as A1111's "Resize and fill" mode, and the author says as much in the README. It's a small, single-purpose node from a personal QoL pack (pants by pants007) - no dependencies, no models, just a bit of image math you'd otherwise be doing in an external editor before every run.
How it works
Take a non-square image. The node figures out which axis is shorter and pads that axis with extra pixels until the canvas is square, using whichever fill strategy you picked. There's no resampling of your actual content - it's pure padding, so nothing gets warped and nothing gets cut off. You just end up with more canvas than you started with, which is a trade worth knowing about: your output is now bigger than your input on one axis.
Inputs and outputs that matter
image- the image you want squared up.padding_mode- pick betweenreplicateandconstant. Replicate stretches the edge pixels outward, so the padding blends into whatever color/texture was already at the border - good when you don't want a hard seam. Constant fills the new area with a flat color instead.constant_fill- only matters inconstantmode. It's a single 0–255 value (0 = black, 255 = white, anything between is a shade of grey), not an RGB triplet, so you're choosing a brightness, not a specific color.
One output: IMAGE, the padded square version, ready to feed into whatever downstream node was fussy about aspect ratio in the first place - an upscaler, a face-detection step, a batch of same-size latents, whatever.
If your padding_mode and constant_fill naming rings a bell, that's because they're lifted straight from PyTorch's own F.pad terminology - replicate and constant are two of the four padding modes torch ships. It's a good sign the node is doing exactly what it says and nothing cleverer.
How to install it
Through ComfyUI Manager, search for "pants" or "comfy-pants" and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/pants007/comfy-pants.git
cd comfy-pants
pip install -r requirements.txt
One thing worth flagging: the pack's own README tells you to cd comfy_pants (underscore) after cloning, but git clone on that URL actually creates a folder called comfy-pants (hyphen) - the repo's real name. It's a typo in the docs, not a second folder you're missing. cd into whatever git actually created, then run the pip install. Restart ComfyUI afterward either way.
Common issues
There isn't much that goes wrong with this one once it's installed - it's a small, deterministic bit of math, not a model wrapper with a dozen failure modes. The real friction, as with most single-author custom node packs, is at install time: pip install -r requirements.txt runs against your existing ComfyUI Python environment with no isolation, so if this pack happens to want a library version that clashes with something you already have (a newer or older transformers, numpy, etc.), pip's resolver can quietly downgrade a package another node depends on. If something else breaks right after installing this pack, that's the first place to look - check what actually got changed with pip list before and after, rather than assuming the new node itself is at fault.
Beyond that: this is a genuinely obscure pack - barely any public discussion of it exists, which tracks with the author's own framing of it as "nodes I made for myself" rather than a community project. That's not a knock; it just means you're on your own for anything beyond what's in the two-line README, and there's no forum thread to lean on if you hit something odd. If padding looks wrong, the first thing to check is whether your image was already square going in - pad-to-square is a no-op on an image that's already 1:1, so if you expected new canvas and didn't get any, that's almost certainly why.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| padding_mode | COMBO | 2 options: replicate, constant | |
| constant_fill | INT | 00–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |