Load Image Advanced (RMBG) 🖼️
Load, resize, and pull metadata in one node
- IMAGE
- MASK
- MASK_IMAGE
- WIDTH
- HEIGHT
- METADATA
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 orhttp(s)://URL. The reason to use this loader. Leave it empty to use theimagedropdown of already-uploaded files instead.resize_mode+size- the resize logic.longest_side/shortest_side/width/heightdecide which dimension yoursizevalue 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_byandmegapixels- 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(defaultalpha) - which channel of the loaded image becomes the MASK output:alpha,red,green, orblue. Alpha for normal transparent PNGs; the color channels for when your mask was baked into a specific channel upstream.upscale_method(defaultlanczos) - 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, thenpip 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image_path_or_URL | STRING | — | |
| image | COMBO | 2 options: , example.png | |
| mask_channel | COMBO | alpha | 4 options: alpha, red, green, blue |
| upscale_method | COMBO | lanczos | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
| megapixels | FLOAT | 0.000–16 | — |
| scale_by | FLOAT | 1.000.01–8 | — |
| resize_mode | COMBO | longest_side | 4 options: longest_side, shortest_side, width, height |
| size | INT | 00–16384 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| MASK_IMAGE | IMAGE | — |
| WIDTH | INT | — |
| HEIGHT | INT | — |
| METADATA | STRING | — |