Image Loader (Path or URL)
Path, URL, or whole folder
- IMAGE
- MASK
- STRING
Stock ComfyUI gives you a file picker, and that's it. The Image Loader (Path or URL) from this pack throws the door open: one input that accepts three different things - a local file path, a full URL, or a whole directory - and returns the image(s) as a proper IMAGE tensor with a mask, exactly like a normal loader.
If you've ever been mid-workflow, found a reference image on the web, and cursed having to download it into ComfyUI/input/ by hand, this node is aimed at you. Paste the URL and keep going.
How it works
The node looks at your input and picks a path:
- Starts with
http://orhttps://- it fetches it withrequests(90-second timeout) and loads the downloaded bytes as an image. - A relative path - it resolves it against ComfyUI's input directory, so
my_folder/img.pngbehaves like the built-in Load Image. - An absolute path - used as-is.
- A directory - here's the fun one. It scans the folder for
.png,.jpg,.jpeg,.gif,.bmp,.webp, sorts them alphabetically, and loads the whole batch into oneIMAGEtensor with matching masks and names.
Every image goes through the same pipeline as ComfyUI's own loader: RGB, 0–1 float tensor shaped [B, H, W, C], and alpha channels pulled out into a MASK. A folder of reference images becomes a ready-to-iterate batch in one node, no manual wiring.
The inputs that matter
Just one: image_path_or_url. A string, not multiline, defaulting to empty. That's the whole input surface - which is exactly why people reach for it.
Outputs: IMAGE (the tensor), MASK (alpha as mask), and STRING (the filename - or, for a directory batch, the list of filenames). Feed it into img2img, a batch loop, an IP-Adapter-style reference path, whatever your graph needs.
Installing it
Part of the comfyui_image_embeddings pack by baijunty. In ComfyUI Manager, search "image_embeddings" and install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/baijunty/comfyui_image_embeddings
The pack's only declared dependency is imagehash; everything else this node uses (requests, PIL, torch) ships with ComfyUI.
Where people get burned
URL loading is deliberately uncached - the node returns "changed" every time, so a URL input re-downloads the image on every queue run. That's correct if the URL content might change, and annoying if you're iterating on a big folder of web images; expect the network latency each run, and don't point it at a slow host (90-second timeout, then it errors).
Also watch the directory mode: it loads everything in the folder matching those extensions, in filename order. Drop a stray file in and it silently joins the batch. And the whole folder gets concatenated into one tensor, which means mixed-size images in the folder will error out - a tensor batch has to share one resolution. Keep batch folders to like-sized images, or this node will stop the queue.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_path_or_url | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| STRING | STRING | — |