Square Maker
Getting textures square without stretching them into lies
- image
- image
Every texture pipeline eventually meets a square requirement: an AI model wants 1024×1024, a cube map wants square faces, a game engine wants a power-of-two tile. Square Maker turns any rectangle into a square, and the important decision it makes you confront is how - because crop and stretch are very different lies, and one of them is usually fine.
How it works
The method input is the fork in the road:
crop(default) - keeps the aspect ratio and cuts away the excess. No distortion, ever. You lose pixels, but what survives is geometrically true. This is the one to use for textures where stretching would be visible - brick, tile, anything with a regular pattern.scale- stretches the shorter dimension to match, so everything survives but the aspect ratio is a lie. Sometimes that's exactly what you want (a noise texture, an AO map, something patternless), and it's the only way to keep all content.
square_size picks the target: shortest_edge (the natural crop size - no downscaling happens, you just trim the long edge), longest_edge (upscales the short dimension, good for scaling-based squares), or custom with your own custom_size (64–8192, in steps of 64).
For crops, crop_position gives you nine alignment points - center is the default, but top_center is your friend for portraits and bottom_center for ground-heavy shots. scaling_method (bicubic, bilinear, lanczos, nearest) matters when upscaling is involved; default lanczos is fine.
The honest take
For textures, the golden rule is crop + shortest_edge: you keep maximum resolution and no distortion. Scale is the emergency exit for "I must keep every pixel." If you're squaring for an AI model, crop + custom at 1024 is the standard move - and the pack's own docs chain Square Maker into Smart Texture Resizer to snap the result to a GPU-friendly multiple afterward.
Installing it
Part of amtarr/ComfyUI-TextureAlchemy. ComfyUI Manager → search "Texture Alchemy", or:
cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy
Restart, then right-click → Add Node → Texture Alchemist → Texture. No extra dependencies, no models.
Where people get burned
Scale is the trap for anything with recognizable geometry - stretch a 1920×1080 brick wall to square and the bricks go oval, and your renderer will faithfully reproduce that lie. If you ever look at a squared texture and think "something's off," check that method isn't scale. Also, custom sizes are multiples of 64 by construction, which is convenient but means you can't hit arbitrary sizes like 1100. Console banner each run is just the pack's style.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| method | COMBO | crop | crop (maintain aspect, remove edges) or scale (stretch to square) |
| square_size | COMBO | shortest_edge | Base square size on shortest edge, longest edge, or custom size |
| custom_size | INT | 102464–8192 | Custom square size (only used when square_size=custom) |
| crop_position | COMBO | center | Where to crop from (only used when method=crop) |
| scaling_method | COMBO | lanczos | Resampling algorithm for quality |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |