Load Image Advanced
Load an image and its alpha mask in one shot — blur and strength built in
- IMAGE
- MASK
Core ComfyUI's LoadImage gives you an image. If you then need its alpha channel as a mask, you're chaining Image to Mask after it and hoping nothing resizes in between. This node cuts that out: it loads an image and hands you both the RGB tensor and a clean mask, with feathering and intensity control that core doesn't give you for free. If you do inpainting, outpainting, or any mask-fed workflow, you'll hit why that matters almost immediately.
How it works
ImageLoaderAdvanced pulls a file from your ComfyUI/input folder (same picker as the core loader), and for every frame it converts to RGB, then builds the mask from the alpha channel when mask_mode is alpha. That mask is multiplied by mask_strength, and if mask_blur is above zero it gets a Gaussian blur via OpenCV - the standard trick for softening mask edges so your inpaint region doesn't have a hard line. Set mask_mode to none and you get a solid white mask instead, which is what you want when you're feeding a loader into something that demands a MASK input but you don't actually have one.
A few details it handles that the core loader ignores: EXIF orientation is applied, 16-bit "I" mode images get normalized, and multi-frame files (GIFs, sequences) come back as a proper batch - with the exception of MPO, which the author deliberately keeps as a single frame. It also hashes the file (sha256) to decide when to re-run, so your graph re-executes when you replace the PNG in the input folder, which core ComfyUI gets wrong often enough to annoy people.
The inputs that matter
- mask_mode -
alpha(default) reads the image's alpha channel;noneoutputs a full-white mask. - mask_strength - scales mask values 0–1. Dial this down to 0.5 and the mask becomes half-opaque everywhere, handy when you want a softer inpaint than a binary mask gives.
- mask_blur - feather width, 0–10. A few pixels here is the difference between "mask edge" and "mask seam."
Outputs are IMAGE and MASK, both in standard 0–1 float format, so they plug straight into InpaintModelConditioning, VAEEncodeForInpaint, or any compositor.
Installing it
This ships with the ComfyUI-YCNodes pack. Easiest path is ComfyUI Manager - hit "Install Custom Nodes," search ComfyUI-YCNodes, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/ComfyUI-YCNodes
Restart ComfyUI after the clone. The pack's requirements.txt asks for torch, numpy, pillow, opencv-python, and scipy - ComfyUI already ships the first three, and the node only needs opencv-python (imported as cv2) for the blur. If you get a ModuleNotFoundError: cv2 in the console, pip install opencv-python fixes it.
Gotchas
The pack's __init__.py loads every file in its py/ folder and skips any node that fails to import, so a bad install shows up as "node not registered" rather than a hard crash - check the console for [ComfyUI-YCNodes] errors if it's missing from the menu. And remember: only the alpha channel feeds the mask here. A JPEG has no alpha, so it'll come out with mask_mode: alpha giving you a full-white mask that pretends to be useful. Use a PNG with real transparency, or switch mask_mode to none and stop pretending.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| mask_mode | COMBO | alpha | 2 options: none, alpha |
| mask_blur | FLOAT | 0.00–10 | — |
| mask_strength | FLOAT | 1.000–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |