LoadImageFromURL_PixelML
Paste a URL, get an image and a mask — without staging files into your input folder
- IMAGE
- MASK
LoadImageFromURL_PixelML is the node you reach for when the reference image you need is on the internet and you'd rather not babysit a download into ComfyUI/input/. Paste a URL into the url field, run the graph, and it fetches the image into a temp file, loads it, and hands you a proper IMAGE tensor plus a MASK - ready to wire into a VAE Encode, a ControlNet preprocessor, or anything else that eats images.
It's part of the PixelML ComfyUI Nodes pack, and it's the one node in the pack that does actual file I/O. The rest of the pack fusses over variables and types; this one gets its hands dirty with HTTP.
How it works
The flow, straight from the source:
- Download. The URL is fetched to a temporary file via a
requests-based helper, streamed in chunks with a progress bar. Auth headers aren't sent, so private or token-gated URLs will fail - it's for public images. - Open and normalize. PIL opens the file, applies EXIF transposition (so camera photos aren't sideways), and converts to your chosen color mode.
- Frame handling. Multi-frame images (animated GIFs, multi-page files) are iterated into a batch - every frame becomes a row in the output tensor. One frame, one image.
- Tensor + mask. The image becomes a
float32tensor scaled to 0–1. If the source has an alpha channel, theMASKoutput is1 - alpha- meaning fully transparent pixels are mask value1, exactly like core ComfyUI's LoadImage. No alpha channel means an empty 64×64 mask.
Two real-world quirks to expect. First, it re-downloads on every run - there's no cache, so repeated runs against a big image burn bandwidth and add seconds each time. Second, the node prints debug lines like Old image mode: RGB to your console on every load; harmless, but it will clutter the log if you run it often.
The inputs that matter
- url (STRING) - the direct image URL. Defaults to ComfyUI's example.png on GitHub. HTTPS works; hotlinked preview URLs from Civitai or similar generally do too, as long as they don't require a token.
- return_image_mode (enum, default
"RGB") - the color mode of the output:RGB,RGBA,BGR,BGRA,L(grayscale), or1(1-bit). The interesting ones areBGR/BGRA- PIL has no native BGR, so the node swaps channels itself. Reach for those if downstream code expects OpenCV-style channel order.
The outputs
- IMAGE - the batch tensor, shape
(frames, height, width, channels), values 0–1. - MASK - the alpha-derived mask,
1 - alpha, or a blank 64×64 mask when there's no transparency.
Install
Search "PixelML ComfyUI Nodes" in ComfyUI Manager, install, restart - or:
cd ComfyUI/custom_nodes
git clone https://github.com/PixelML/ComfyUI-PixelML-CustomNodes
Then restart. The pack's requirements.txt pins diffusers==0.24.0 and lists boto3/httpx/httpx-sse, but this node only needs PIL, numpy, torch, and requests - all ComfyUI staples. If the pinned diffusers downgrade breaks other nodes in your setup, skip the requirements file; the URL loader doesn't use it.
Where people get burned: a URL that 404s or redirects to a login page fails the run, a giant image makes every run slow thanks to the no-cache download, and gated-host links just won't load. Keep it to public, direct image URLs and it behaves. If you need offline repeatability, the file's already on disk - save it once and use the core LoadImage instead.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| url | STRING | https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/input/example.png | — |
| return_image_modeopt | COMBO | RGB | 6 options: RGB, RGBA, BGR, BGRA, L, 1 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |