Nodes/ComfyUI_LoadImageFromHttpURL/Load Image from HTTP URL
ComfyUI Node

Load Image from HTTP URL

Paste a URL, get an image tensor — no upload step required

By jerrywap·Created about a year ago·Updated about a year ago· 3
Load Image from HTTP URL
    • IMAGE
    image_urlhttps://placehold.co/600x400/EEE/31343C

    Load Image from HTTP URL is the smallest useful idea in ComfyUI: you give it a URL, it downloads the image, and hands you a normal IMAGE tensor. No file picker, no drag-and-drop, no "the image has to live on the same machine as the workflow." That one trick matters a lot more than the node's size, because it's what lets you treat ComfyUI as an API instead of a desktop app.

    It's a genuinely tiny single-purpose pack from jerrywap - one class, one input, one output. Not much to learn, and that's the appeal. If you're building anything where an image arrives as a URL - a web app that calls ComfyUI, a webhook, a JSON payload from a client, cloud storage, even a placeholder service you're testing with - this is the node that closes the gap between "I have a link" and "I have a tensor."

    How it actually works

    The whole thing is about twenty lines, which is worth knowing because it tells you exactly what it will and won't do. It calls requests.get(image_url, stream=True), hands the response stream to Pillow's Image.open(...), converts to RGB, then does the standard ComfyUI dance: numpy array → float32 / 255.0torch.from_numpy(...)unsqueeze(0). What comes out is a [1, H, W, 3] tensor in the exact shape every other loader produces, so it plugs into anything that accepts an image - VAE encode, ControlNet preprocessors, an img2img chain, whatever you already have wired to LoadImage.

    The catch hides in the error path. If anything fails - bad URL, DNS error, a 404, a timeout, content that isn't an image - the node doesn't error out. It prints Failed to load image from URL to the console and returns a solid black 512×512 tensor. Graceful in one sense, dangerous in another: a broken link looks like a successful run that generated a black frame, and you'll only notice when the output comes out wrong.

    The inputs and outputs that matter

    There's exactly one input:

    • image_url (STRING) - the HTTP/HTTPS address of the image. The default is a placehold.co demo URL, so the first thing you'll do is type a real one.

    And one output: IMAGE, the ready-to-wire tensor. That's the whole schema. No batch support, no auth headers, no retries - one URL in, one image out.

    Installing it

    ComfyUI Manager handles it - search for Load Image from HTTP URL or ComfyUI_LoadImageFromHttpURL and install, then restart or hit Reload Custom Nodes. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jerrywap/ComfyUI_LoadImageFromHttpURL
    

    The code itself only needs requests, Pillow, numpy, and torch - and you already have all of those if ComfyUI is running. One real gotcha: the requirements.txt also lists opencv-python, which the node never imports. It's dead weight, but if you install via the install.sh script or pip you'll pull it anyway, so skip the script and let the packages you've got ride. No model files, no weights - this thing is pure plumbing.

    Where people get burned

    The black-image fallback is issue number one, hands down. There's no way to tell a real failure from a genuinely black source image, so a flaky URL will silently poison a downstream workflow. If you rely on this in an automation, wrap it in something that checks the result.

    Worth flagging too: this node runs unauthenticated HTTP against whatever URL you give it, and if your ComfyUI is exposed as an API - the exact use case this node was built for - that API is open by default (the community learned that lesson the hard way with the LLM Vision malware scare). Feed it only URLs you trust, and don't point an unauthenticated instance at the public internet. Slow endpoints can also hang it, since no timeout is set. Small node, honest limits - once you know them, it's a genuinely handy little bridge.

    Categoryjerrywap/loaders

    Inputs (1)

    NameTypeDefaultDescription
    image_urlSTRINGhttps://placehold.co/600x400/EEE/31343C

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE