Nodes/AUN ComfyUI Nodes/Load & Resize Image
ComfyUI Node

Load & Resize Image

Load a file and size it to your model's happy place

By loz2754·Created 8 months ago·Updated a day ago· 5
Load & Resize Image
    • IMAGE
    • MASK
    • filename
    • cleaned filename
    • width
    • height
    image
    resizefalse
    use_framepack_bucketfalse
    base_resolution640
    width512
    height512
    methodkeep proportion
    crop_positioncenter
    interpolationlanczos
    max_num_words0

    Stock ComfyUI's Load Image has one job: load a file. AUNImageLoadResize loads the file and resizes it to whatever your model actually wants, in one step - which sounds like a small thing until you've done the load-then-resize-then-load-again dance for the hundredth time. It's the pack's img2img workhorse.

    The image input is the standard upload/select widget. Then a big boolean - resize (default off) - switches the resizing machinery on. When it's on, you pick a method from four strategies: stretch (squash to exact width/height, aspect ratio be damned), keep proportion (fit within the box, preserving ratio - the default), fill / crop (scale to cover then crop to the box, with crop_position anchoring the crop to center, left, right, top, or bottom), and pad (fit inside with letterbox padding). interpolation offers the usual six filters (nearest, bilinear, bicubic, area, nearest-exact, lanczos), and lanczos is the default because it's the safe quality choice for downscales.

    The FramePack feature is what makes this node stand out. Flip use_framepack_bucket on and the node ignores your literal width/height and instead snaps to the nearest FramePack bucket - the same aspect-ratio bins the FramePack video workflow uses (960x416 up through 768x512, 512x768 and the like) - scaled to base_resolution. Set base_resolution to 640 and you get the original FramePack sizing; raise it to scale everything up proportionally. That's a huge time-saver if you're prepping frames for a FramePack or Hunyuan-based video workflow where bucket-respecting sizes are the difference between smooth generation and wasted VRAM, and it's a good way to make img2img inputs land on a "nice" resolution even when you're not doing video.

    The outputs cover both worlds. IMAGE and MASK (the alpha mask, resized along with the image) go to your sampler or encoder. filename and cleaned filename give you the original file's name (and a word-limited, symbol-cleaned version via max_num_words - set 0 for no limit) for filenames or prompts. And width/height report the actual output dimensions as INTs, which is the honest number to put in a filename when the resize math did something non-obvious.

    Install with the pack: ComfyUI Manager (search "AUN") or cd ComfyUI/custom_nodes && git clone https://github.com/loz2754/AUN-ComfyUI-Nodes, then restart. The pack's requirements pull in opencv-python-headless for the image work; if you cloned manually and see ModuleNotFoundError: cv2, pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt. No models to download. If your image already lives in the graph, skip the loading and use the sibling AUNImageResize - same strategies, no file I/O.

    CategoryAUN Nodes/Image

    Inputs (10)

    NameTypeDefaultDescription
    imageCOMBOSelect image file from input directory or upload new image.
    resizeBOOLEANfalseEnable automatic resizing to specified dimensions. Maintains aspect ratio.
    use_framepack_bucketBOOLEANfalseIf enabled (with resize), choose nearest FramePack bucket based on aspect ratio and base resolution.
    base_resolutionINT640320–2048Base resolution for bucket scaling. 640 matches original; higher scales proportionally.
    widthINT5120–2048Target width for resizing (8-pixel increments). Only used if resize is enabled.
    heightINT5120–2048Target height for resizing (8-pixel increments). Only used if resize is enabled.
    methodCOMBOkeep proportionResize strategy: stretch to exact size, keep aspect ratio, fill then crop, or pad to fit.
    crop_positionCOMBOcenterWhen using fill / crop, choose which edge or center anchors the crop window.
    interpolationCOMBOlanczosInterpolation filter used during resizing.
    max_num_wordsINT00–32Maximum number of words to keep for both filename outputs. Set to 0 for no limit.

    Outputs (6)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    filenameSTRING
    cleaned filenameSTRING
    widthINT
    heightINT