Nodes/ComfyUI-RMBG/Load Image Advanced (RMBG) 🖼️
ComfyUI Node Runs on cloud

Load Image Advanced (RMBG) 🖼️

Load, resize, and pull metadata in one node

By 1038lab·Created 2 years ago·Updated 12 days ago· 2,057
Load Image Advanced (RMBG) 🖼️
    • IMAGE
    • MASK
    • MASK_IMAGE
    • WIDTH
    • HEIGHT
    • METADATA
    image_path_or_URL
    image
    mask_channelalpha
    upscale_methodlanczos
    megapixels0.00
    scale_by1.00
    resize_modelongest_side
    size0

    The loaded-up version of the RMBG loader. Same trick as the Basic node - load from a local path or a URL, not just ComfyUI's input folder - but it resizes on the way in, lets you choose which channel becomes the mask, and hands back metadata. If you're loading an image and immediately resizing it anyway, this collapses two nodes into one.

    The point of a loader with resize built in is that you set your working resolution at the door. No separate resize node, no forgetting to scale a reference and wondering why your latents are the wrong size. It's a small thing that removes a small recurring annoyance, which is the whole personality of this pack.

    How it works

    It loads your source, then applies whatever resize rule you set, then outputs the image, a mask, a visual of that mask, the final dimensions, and a metadata string. The resize is the interesting part: instead of only "scale to X by Y," it offers modes that keyframe off one dimension so aspect ratio stays intact.

    The inputs that matter

    • image_path_or_URL - a local path or http(s):// URL. The reason to use this loader. Leave it empty to use the image dropdown of already-uploaded files instead.
    • resize_mode + size - the resize logic. longest_side / shortest_side / width / height decide which dimension your size value pins, and the other scales to keep the aspect ratio. Pinning the longest side to 1024 is the usual "fit within a budget" move.
    • scale_by and megapixels - alternative ways to resize: a straight multiplier, or a target megapixel count. Use one approach; leave the others at their no-op defaults.
    • mask_channel (default alpha) - which channel of the loaded image becomes the MASK output: alpha, red, green, or blue. Alpha for normal transparent PNGs; the color channels for when your mask was baked into a specific channel upstream.
    • upscale_method (default lanczos) - the resampler. Lanczos is sharp; bilinear/area are softer.

    Outputs: IMAGE, MASK, MASK_IMAGE (the mask as a viewable image), WIDTH, HEIGHT, and METADATA (a string of the image's info). Wire WIDTH/HEIGHT into your latent sizing so the graph adapts to whatever you loaded.

    How to install it

    • ComfyUI Manager: search Comfyui-RMBG, install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/1038lab/ComfyUI-RMBG, then pip install -r requirements.txt, and restart.

    No model download - it's a loader.

    Common issues

    The most common surprise is the mask coming out empty or wrong - that's mask_channel. If your PNG has no alpha channel and you leave it on alpha, you get a blank mask; switch to whichever channel actually holds your mask, or accept there isn't one. For URL loads, the usual caveats apply: the link has to serve a real image to a machine that can reach it, and anything behind a login won't work - download it and use a local path. If you don't need resize or metadata, the Load Image Basic node is the lighter option.

    Category🧪AILab/🖼️IMAGE

    Inputs (8)

    NameTypeDefaultDescription
    image_path_or_URLSTRING
    imageCOMBO2 options: , example.png
    mask_channelCOMBOalpha4 options: alpha, red, green, blue
    upscale_methodCOMBOlanczos5 options: nearest-exact, bilinear, area, bicubic, lanczos
    megapixelsFLOAT0.000–16
    scale_byFLOAT1.000.01–8
    resize_modeCOMBOlongest_side4 options: longest_side, shortest_side, width, height
    sizeINT00–16384

    Outputs (6)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    MASK_IMAGEIMAGE
    WIDTHINT
    HEIGHTINT
    METADATASTRING