Nodes/ComfyUI-ResolutionTools/Align Resolution to Grid
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.

By dreevelle·Created 16 days ago·Updated 15 days ago· 5
Align Resolution to Grid
    • width
    • height
    • changed
    • label
    width1920
    height1080
    alignment16
    moderound
    Categoryutilities

    Inputs (4)

    NameTypeDefaultDescription
    widthINT19201–16384
    heightINT10801–16384
    alignmentINT161–256Pixel 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.
    modeCOMBOroundround: nearest multiple. up: never shrink (may add letterbox). down: never grow (may crop framing).

    Outputs (4)

    NameTypeDescription
    widthINT
    heightINT
    changedBOOLEANTrue if either dimension was off the grid.
    labelSTRING