ComfyUI Node

Rescale Node

Cap an image's size without breaking its proportions

By ShinChven·Created about a year ago·Updated 7 months ago· 3
Rescale Node
    • new width
    • new height
    • original width
    • original height
    • limit
    • formatted
    width512
    height512
    limit2048

    Third node from the same small pack, and it runs the opposite direction from Aspect Ratio: instead of starting with a shape and filling in pixels, you start with a size you already have - usually a loaded image - and tell it "don't let either side get bigger than this." It scales down proportionally to fit.

    How it works

    Feed it a width, height, and a limit, and it computes new dimensions that keep the original aspect ratio while capping the longer side at that limit - the classic "this photo is huge, shrink it before it hits anything expensive" move. The README frames the node as keeping the result divisible by "a specified factor," which reads like it's baked into the math rather than exposed as a setting: there's no separate factor input here, just width, height, and limit, so whatever rounding happens, happens under the hood.

    The inputs and outputs that matter

    • width, height (INT, default 512, range 8–16384, step 8) - the size you're starting from. In practice this is usually piped in from a node reading an actual loaded image, not typed by hand.
    • limit (INT, default 2048, range 8–16384, step 8) - the ceiling on the longer dimension.

    Outputs: new width / new height are the capped, proportional result - this is what you actually resize the image to. original width / original height and limit pass their inputs straight through for reference, and formatted is a string version, likely for a label rather than for math.

    Where this earns its spot

    The usual trigger is loading a photo someone handed you at some enormous native size and running it straight into a ControlNet preprocessor, an upscaler, or an img2img pass before you've thought about it - and then wondering why the run is slow or VRAM-starved. GPUs punish you hard once you're not comfortably inside VRAM; there's no gentle degradation, it just gets much worse. Rescale Node is the guard you drop right after loading: cap the long side to something sane for your card - 2048, or lower if you're tight - while keeping the image's proportions intact so nothing comes out squashed.

    How to install it

    Same pack as Width & Height and Aspect Ratio - installing once gets you all three. Via ComfyUI Manager: search "ShinChven's Custom Nodes Package". By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ShinChven/sc-comfy-nodes
    

    Restart. No extra dependencies, no model files - it's pure arithmetic, like its siblings.

    Common issues & troubleshooting

    Nothing's shrinking. Check that limit is actually smaller than the larger of your two input dimensions - if the image is already under the cap, there's nothing to scale down to.

    Node shows missing in someone else's workflow. "Rescale" isn't a unique name - WAS Node Suite, Impact Pack, and a handful of upscaling packs all have something similarly named. Confirm Manager resolved this instance to ShinChven's pack, not a lookalike.

    The output size doesn't match what you expected from limit exactly. Given the README's mention of divisibility rounding, treat limit as the target ceiling, not a guaranteed exact output - check the actual new width / new height values rather than assuming they land precisely on it.

    This is a small, low-traffic pack with no real community discussion around it - if you hit a genuine bug, a GitHub issue on the repo is going to get you further than searching for one.

    CategoryImage Dimensions

    Inputs (3)

    NameTypeDefaultDescription
    widthINT5128–16384
    heightINT5128–16384
    limitINT20488–16384

    Outputs (6)

    NameTypeDescription
    new widthINT
    new heightINT
    original widthINT
    original heightINT
    limitINT
    formattedSTRING