Nodes/ComfyUI-Image-Tools/SingleImageUrlLoader
ComfyUI Node

SingleImageUrlLoader

Pull an image from a URL straight into the graph

By knuknX·Created 3 years ago·Updated 2 years ago· 3
SingleImageUrlLoader
    • IMAGE
    url

    If your reference image lives on the internet rather than your disk, ComfyUI's built-in loader can't help you - you'd download the file, copy it into input/, then find it in a dropdown. SingleImageUrlLoader skips all of that: paste a URL, and the image lands in your graph as a normal IMAGE tensor. Same idea as its sibling SingleImagePathLoader, but over HTTP instead of the filesystem.

    From the ComfyUI-Image-Tools pack, this is a tiny node with one job, and it does it without ceremony. It's the "grab that file from the remote server" move when your reference comes from an API, a teammate's link, or a CDN.

    How it works

    Three steps under the hood: requests.get(url) fetches the bytes, cv2.imdecode decodes them into an image, and the BGR→RGB flip turns it into a ComfyUI IMAGE tensor. Notably it decodes with IMREAD_COLOR, which forces a plain 3-channel RGB result - so unlike the path loader, an RGBA PNG fetched over HTTP arrives flattened, alpha dropped. You always get 3 channels here.

    Inputs and outputs

    • url (STRING) - the only input. A full HTTP(S) URL pointing at an image, e.g. https://example.com/refs/product.png.
    • Output: IMAGE - one tensor, same as any loader, ready for a VAE Encode, ControlNet preprocessor, or img2img pass.

    That's the whole surface. No headers, no auth, no timeout setting, no batching.

    Install

    It ships in a pack, so install the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/knuknX/ComfyUI-Image-Tools
    

    Restart ComfyUI afterwards, or install Image Tools via ComfyUI Manager. This node needs nothing beyond the requests library, which is already in any standard install.

    Where people get burned

    • No timeout, no error handling. A dead or slow endpoint makes the node (and your whole queue) hang waiting for requests.get to give up. A 404 or a URL that returns HTML instead of an image makes imdecode return None and the node crash with a traceback. The only diagnosis is the console output.
    • No User-Agent header. A surprising share of hosts - CDNs, hotlink-protected galleries, some API servers - refuse bare requests with no identifying header and answer with a 403 or an empty body. If a URL that works in your browser fails here, that's usually why.
    • Trust what you fetch. This node will happily hit whatever URL you type and decode whatever comes back. Like any node that reaches out to the network, only feed it URLs you control or trust - the ecosystem has a history of exactly this kind of arbitrary-code-execution surface being abused, so it's worth being deliberate about it.

    It's a one-shot fetch, not a poller and not a batch tool - for a whole folder of references, BatchImagePathLoader is the sibling to reach for. But for "I have a link, give me the image," this is the whole answer.

    CategoryTools

    Inputs (1)

    NameTypeDefaultDescription
    urlSTRING

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE