ComfyUI Node

ImageSize Div

The five-second resolution helper that saves you from doing the math

By supElement·Created 9 months ago·Updated about 11 hours ago· 10
ImageSize Div
    • width
    • height
    DirectionHorizontal
    Length1920
    Short1080
    Div1

    ImageSize Div is the kind of node you don't appreciate until you've spent ten minutes hand-typing 1344×768 into an EmptyLatentImage because you're too lazy to figure out the right aspect ratio. You give it a long side, a short side, and a divisor, and it hands back clean width and height integers. That's the entire job, and it does it well.

    How it works

    Direction decides which side is which. With Horizontal (the default), Length becomes the width and Short becomes the height. With Vertical, they swap - Length is the height. The defaults are 1920×1080, so out of the box it's a 16:9 generator, which tells you the intended use: pick your aspect ratio by long/short side, don't think about orientation, and get a resolution that matches a 1080p or 4K frame.

    Then Div divides both numbers. Set it to 2 and 1920×1080 becomes 960×540. Why bother? Because diffusion models are picky about resolutions - they like sizes that are clean multiples of 8, 16, 64, or whatever the model's VAE wants - and a single Div knob is the fastest way to shrink a "nice" resolution down to something the model actually accepts without breaking the aspect ratio. It also gives you an easy way to drop resolution for a quick test pass before committing to the full render.

    What comes out

    Two outputs, both plain integers: width and height. That's it. They wire directly into any node that takes a width/height INT - EmptyLatentImage, the Element pack's own EmptyImageRGB, image scalers, video latent nodes, anywhere you'd otherwise be typing numbers by hand. Because they're just INTs you can also route them into an integer math node if you need to halve them again or snap them further.

    Installing it

    It ships in supElement/ComfyUI_Element_easy:

    cd ComfyUI/custom_nodes
    git clone https://github.com/supElement/ComfyUI_Element_easy.git
    

    Restart ComfyUI, or find it via ComfyUI Manager by searching ComfyUI_Element_easy. No models, no extra downloads - it's a pure math helper.

    Gotchas

    There are almost none, which is the point. One thing worth knowing: Div only divides, it doesn't snap to a specific multiple. If you need the result divisible by 8 or 16, pick a Length/Short pair and Div that already produce a clean result - the node won't round for you. And remember Div scales both dimensions, so if you wanted only the long side cut (for example, a 2:1 canvas), you'd set Length and Short directly instead of relying on the divisor.

    CategoryElement_easy

    Inputs (4)

    NameTypeDefaultDescription
    DirectionCOMBOHorizontal2 options: Horizontal, Vertical
    LengthINT192064–8192
    ShortINT108064–8192
    DivINT11–256

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT