LoadImageFromUrlOrPath
Load an image straight from a URL — no manual download step
- IMAGE
- MASK
Here's the gap this node fills: ComfyUI's built-in LoadImage only reads files that live in your ComfyUI/input folder. Want to use a reference image from the web? Normally that means a right-click → save-as detour, then hunting for the file in the file browser. LoadImageFromUrlOrPath takes the pain out of that: you paste a URL (or a local path), it fetches the image, and hands you the same IMAGE + MASK outputs core LoadImage does. It's one small node, one string input, no API key, no model downloads.
It shows up under the image category in the node menu, right next to the LoadImage you already know.
How it works
The whole pack is one file, roughly a hundred lines. The load function looks at your string: if it starts with http, it does a plain requests.get() and opens the downloaded bytes with PIL. Anything else gets opened as a local file path directly. Then the image goes through the same conversion core ComfyUI itself uses - exif-transpose, convert to RGB, scale to a 0–1 float tensor. Animated GIFs get loaded as a batch of frames, and if the image has an alpha channel, it becomes the mask (inverted, same convention as LoadImage: black is "keep", white is "mask out"). No alpha, no problem - you get a blank 64×64 mask, matching stock behavior.
The input and outputs that matter
There's exactly one input, so this is an easy read:
url_or_path- a multiline STRING. Paste the fullhttps://…URL, or a path likeC:\pics\ref.png. That's the entire configuration.
Outputs are two:
IMAGE- wire this into anything that eats an image: img2img, ControlNet preprocessors, upscalers,PreviewImage.MASK- only interesting if your source has transparency and you're doing inpainting or masking. Feed it into theSet Latent Noise Maskstyle of nodes.
The README's own example workflow is just the node feeding a PreviewImage, which tells you how low-friction this thing is meant to be.
Why you'd reach for it
The workflow-sharing culture is the honest reason. ComfyUI workflows are JSON, and people embed them in shared images. If your workflow pulls a reference image from the web, a URL baked into the workflow keeps it self-contained - no "oh, also you need this file in your input folder" footnote. It's also nice for quick tests when you're iterating on a reference-driven setup (ControlNet reference/lineart workflows lean on exactly this kind of input). For anything else, honestly? Saving the file to input/ and using core LoadImage is fine. This node is a convenience, not a revolution.
Installing it
Standard custom-node install, and it's a light one - no model files, and requests already ships with ComfyUI's bundled Python, so nothing extra to pip-install. Via ComfyUI Manager, search "load-image-from-url". Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/tsogzark/ComfyUI-load-image-from-url
Restart ComfyUI and it's there.
Where it bites
A few sharp edges, all from reading the source:
- Hotlink protection kills it. The code sends a bare
requests.get()with no headers and no auth. Image hosts that check for browser user agents or logged-in sessions will return a 403, and you'll get a raw Python traceback in the console, not a friendly error. - No timeout. A dead or hanging host can stall your queue, because the download blocks the backend.
- It re-downloads every run. There's no cache, so a big remote image is fetched every time you hit queue.
- It's a tiny node in a tiny pack - ~9 impressions on its page at the time of writing. Don't expect much community documentation beyond this.
Keep the URLs you feed it on permissive hosts (like the i.postimg.cc one in the README) and it'll quietly do the job.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| url_or_path | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |