Nodes/comfyui_gr85/Image Sizer All
ComfyUI Node

Image Sizer All

Set a pixel budget, get dimensions that respect it

By veighnsche·Created 2 years ago·Updated 8 months ago· 1
Image Sizer All
    • width
    • height
    pixel_amount1048576
    width1
    height1
    orientation
    tolerance16

    The other two GR85 resolution nodes start from a preset resolution bucket; this one starts from a raw pixel budget instead. That default value - 1048576 - isn't arbitrary, it's exactly 1024×1024, the standard one-megapixel budget SDXL and Flux both target. If you want to hold that budget fixed while freely varying aspect ratio, Image Sizer All is built for that.

    Per the README, it takes a pixel budget and aspect-ratio components and returns new dimensions matching that pixel count and orientation, adjusted to a tolerance. In field terms: pixel_amount (default 1048576, minimum 64) is your total-pixel target - the node solves for a width and height whose product lands near that number. width and height (both default 1, up to 4096) act as the aspect-ratio components here rather than final dimensions - think of them as a ratio like 16 and 9 rather than actual output pixels; the node uses their proportion, not their literal values, combined with pixel_amount to compute the real output size. orientation (original / landscape / portrait) lets you flip that ratio without re-entering it swapped. tolerance (default 16, range 1–128) is the rounding grid the final width and height get snapped to.

    Output is width and height, both INT.

    Installing it. Search "comfyui_gr85" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/veighnsche/comfyui_gr85
    

    Restart ComfyUI. No model downloads, no extra dependencies.

    Why you'd reach for this over the other two GR85 sizers. GR85_ImageDimensionResizer and GR85_ImageSizer both work from preset resolution buckets or a starting resolution; this one is the version where the constraint you actually care about is total pixel count - useful if you're trying different aspect ratios but want every generation to cost roughly the same amount of GPU compute and VRAM, since that scales with total pixels far more than with any particular width/height combination.

    Common issues. Because width/height here represent a ratio and not a literal size, it's easy to instinctively type your desired final resolution into them and get confused when the output doesn't match - remember they're proportional inputs, pixel_amount is what actually sets the scale. And the same architecture note applies as with the sibling sizer nodes: if you're targeting Flux specifically, set tolerance to 64 rather than the default 16, since Flux wants both dimensions divisible by 64 for a clean result.

    This is the node to reach for once you've settled on a compute budget and just want to explore ratios within it - batch-testing a set of aspect ratios at a fixed megapixel count, for instance, so you can compare compositions without one run costing noticeably more GPU time than another.

    CategoryGR85/Latent

    Inputs (5)

    NameTypeDefaultDescription
    pixel_amountINT104857664–18446744073709550000
    widthINT11–4096
    heightINT11–4096
    orientationCOMBO3 options: original, landscape, portrait
    toleranceINT161–128

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT