LiamLoadImage
A LoadImage that reads a URL, for when your images live in OSS
- IMAGE
- MASK
LiamLoadImage is a LoadImage that also accepts a URL. That's the whole trick, and for a surprising number of people it's the missing piece.
Here's the situation it solves. ComfyUI's API expects any image you feed a workflow to already be sitting in your input folder - you upload it with /upload/image (or drop it into the folder) and then reference it by filename. That works fine when you're clicking around the UI. It's annoying when you're driving ComfyUI programmatically from a backend and the images you need to process are living in object storage. The author of this pack puts it plainly in the README: when you use the API, your images are stored in OSS (Alibaba's object storage, the default for a lot of Chinese cloud stacks), and ComfyUI's default LoadImage only knows about the input folder. LiamLoadImage lets you hand the workflow a URL directly.
How it works
The source is short enough to read in one sitting. It lists the files in your input directory to build the image dropdown, then in load_image checks the url field: if it's non-empty and starts with http, it fetches the image with requests.get() and opens it from memory. Otherwise it falls back to opening whatever you picked in the image widget, exactly like stock LoadImage. From there it does the standard conversion - exif_transpose, RGB, normalized to float 0–1, batch dimension added - and pushes out an IMAGE and a MASK.
The inputs that matter
- url - a
STRING, default empty. Paste anhttp(s)://link to an image and it wins over the dropdown. - image - the usual file dropdown with an upload widget, listing everything in your
inputfolder.
Outputs are IMAGE and MASK, so it drops into any pipeline that already uses a stock LoadImage: wire IMAGE into whatever sampling or img2img node you were using. The mask is the alpha channel inverted (transparent = 1), which matches stock LoadImage behavior.
Install
No dependencies beyond requests, which ComfyUI already ships, and no model downloads:
cd ComfyUI/custom_nodes
git clone https://github.com/ai-liam/comfyui_liam_util
Then restart ComfyUI. Or search "LiamUtil" in ComfyUI Manager and let it handle the clone. There's an example workflow image in the repo (out.jpeg) you can drag straight into the canvas.
Where people get burned
- The
httpcheck is literal. A bare domain likeexample.com/img.pngdoesn't start withhttp, so it silently falls through to the file branch and errors. Always include the scheme. - No timeout, no auth.
requests.get()has neither, so a hanging URL stalls your queue, and a private OSS bucket that needs signed credentials will just 403. Generate a presigned URL if you need to. - Opaque images get a 64×64 mask. With no alpha channel the code emits a tiny zero-mask that doesn't match the image dimensions - same quirk as stock LoadImage, but a trap if you wire
MASKinto a composite expecting real geometry.
It's a one-trick node, and for UI users it's redundant with what ComfyUI already gives you. But if your images arrive by URL, it's the load node you'll actually reach for.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| url | STRING | — | |
| image | COMBO | 1 options: example.png |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |