ComfyUI Node
Align Resolution to Grid
Snap width/height to a multiple of the model's patch grid, e.g. 1920x1080 -> 1920x1088 for Krea 2. Unaligned dimensions get circular-padded in the DiT and band along the bottom/right edge.
Align Resolution to Grid
- width
- height
- changed
- label
◄width1920►
◄height1080►
◄alignment16►
◄moderound►
Categoryutilities
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 19201–16384 | — |
| height | INT | 10801–16384 | — |
| alignment | INT | 161–256 | Pixel grid both axes must land on = VAE spatial downscale x DiT patch size. 16: Krea 2 / Flux / SD3 / Qwen-Image / Wan. 32: MiniMax H3. 64: SDXL / SD1.5, and universally safe. Getting this wrong causes a band of artifacts along the bottom/right edge. |
| mode | COMBO | round | round: nearest multiple. up: never shrink (may add letterbox). down: never grow (may crop framing). |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| changed | BOOLEAN | True if either dimension was off the grid. |
| label | STRING | — |