Nodes/comfyui-sequential-batcher/📏 ResTool 16x (SDXL)
ComfyUI Node

📏 ResTool 16x (SDXL)

SDXL aspect ratios without the stretchy-body lottery

By Meisoftcoltd·Created 7 months ago·Updated 18 days ago· 3
📏 ResTool 16x (SDXL)
    • width
    • height
    • debug_info
    • log
    aspect_ratio
    base_resolution1024

    SDXL is picky about resolution in a way SD1.5 never was. It was trained at 1024x1024 on a specific set of aspect ratios, and the community's top answer to "why do my SDXL images have stretched bodies" is literally: you're generating at a resolution the model wasn't trained on. ResTool16x exists to take that particular failure off the table for you.

    It's the SDXL member of the pack's ResTool family, and the family's whole job is to answer "which exact width × height should I use" without you doing the math in your head. The 16x in the name is the divisibility constraint - everything it outputs snaps to a multiple of 16 - and its floor matches the 1024x1024 area SDXL was trained at.

    How it works

    Same three-step machine as its siblings. It derives the other dimension from your aspect ratio and longest side, then checks the pixel total against the training floor: if you asked for something smaller than 1,048,576 pixels (a full megapixel - the area of 1024x1024), it scales the canvas up proportionally until you're above it. Finally it rounds both dimensions to the nearest multiple of 16. The result is a canvas that's both rule-compliant and never below the model's native training area - which is precisely the "floor protection" the pack advertises as the Megapixel Shield.

    One thing worth saying: the tool returns safe resolutions, not the exact trained buckets. SDXL's native ratios (1024x1024, 1152x896, 1216x832, 1344x768, 1536x640) are all still valid targets; this node's job is to keep you out of the danger zone, and for non-standard ratios like 21:9 it'll produce something clean that the model tolerates far better than a raw hand-typed number.

    Inputs and outputs

    Two inputs:

    • aspect_ratio - 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, 3:2, or 2:3.
    • base_resolution (INT, default 1024) - the longest side.

    Outputs: width, height (into EmptyLatentImage), plus debug_info (WxH (Div 16)) and a log for troubleshooting.

    Installing it

    It's bundled in comfyui-sequential-batcher:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Meisoftcoltd/comfyui-sequential-batcher
    

    or ComfyUI Manager, search "comfyui-sequential-batcher", restart. No downloads - it's arithmetic.

    Common issues

    Don't mistake the floor for a ceiling. SDXL happily generates at 1536x640-ish and beyond - this node only intervenes when you fall below the floor, so a request for 21:9 at 512 will get scaled up, while 21:9 at 2048 passes straight through. That's the behavior you want; the only real gotcha is expecting it to "fix" an oversized canvas, which isn't its job. If you see stretched subjects anyway, you're probably feeding it a wrong aspect ratio or running a resolution the model genuinely never saw.

    Category🔁 Sequential Batcher/Tools

    Inputs (2)

    NameTypeDefaultDescription
    aspect_ratioCOMBO8 options: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, +2
    base_resolutionINT1024128–8192

    Outputs (4)

    NameTypeDescription
    widthINT
    heightINT
    debug_infoSTRING
    logSTRING