ComfyUI Node
Align Image π
Snaps an image's width and height to a clean multiple of a number you choose β 8, 16, 32, whatever the model wants. Qwen image models, VAEs, and many samplers behave best on cleanly divisible sizes. Resize rescales to the nearest multiple, crop center-crops down, pad replicate-pads the edges up; the new size comes out as INTs for wiring into latent nodes.
Align Image π
- image
- image
- width
- height
- offset_x
- offset_y
βmultiple16βΊ
βmoderesizeβΊ
βcrop_positioncenterβΊ
βpad_positioncenterβΊ
βpad_fillreplicateβΊ
βpad_color#000000βΊ
Categoryπ AusBoss/Image
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | BHWC image batch to align. | |
| multiple | INT | 161β1024 | Width and height come out divisible by this. 16 or 32 suits most diffusion models; latent-space nodes usually want at least 8. |
| mode | COMBO | resize | How to reach the multiple. resize rescales to the NEAREST multiple (slight stretch, keeps every pixel's content). crop center-crops DOWN to the next multiple (no distortion, trims edges). pad replicate-pads UP to the next multiple (no distortion, adds edges). A side smaller than one multiple always grows to exactly one. |
| crop_positionopt | COMBO | center | Crop mode only: which part of the frame survives. center trims both edges evenly; top, bottom, left, or right pin that edge and trim the opposite one. Ignored by resize and pad. |
| pad_positionopt | COMBO | center | Pad mode only: where the image sits on the grown canvas β the new pixels land on the opposite side. center splits them evenly. |
| pad_fillopt | COMBO | replicate | Pad mode only: what fills the new area. replicate stretches the edge pixels out; color uses pad_color as a solid. |
| pad_coloropt | STRING | #000000 | Solid fill for pad_fill: color. Hex, R,G,B numbers, or a CSS color name. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The aligned batch; both sides are multiples of the chosen number. |
| width | INT | Aligned width in pixels. |
| height | INT | Aligned height in pixels. |
| offset_x | INT | Where the original's left edge sits in the output: positive after padding, negative after cropping, 0 after a resize β wire into a crop to un-align after sampling. |
| offset_y | INT | Where the original's top edge sits in the output: positive after padding, negative after cropping, 0 after a resize. |