ComfyUI Node

Load Image URL

Load an Image Straight From a URL (Alpha Becomes a Mask)

By sammykumar·Created 5 months ago·Updated 5 months ago· 0
Load Image URL
    • IMAGE
    • MASK
    image_url

    Sooner or later every workflow needs an image that isn't on your disk. A reference pose, a ControlNet input, a character sheet someone sent you as a link. Core ComfyUI's Load Image only reads local files, so the old-school move is to save the URL to your input folder by hand, then load it. Load Image URL from Sam Kumar's ImageGen-Toolkit-Dev-Utils pack kills that step: paste the URL, get an IMAGE tensor and a MASK - and it mirrors core Load Image's behavior closely enough that it's a near drop-in.

    How it works

    Same defensive pattern as the pack's video loader. The URL is validated first - blank, malformed, or non-HTTP(S) input is rejected before anything touches the network. Then the file downloads and caches under ComfyUI's temp directory (imagegen-toolkit-dev-utils/image-url-cache), keyed by the SHA-256 hash of the URL. IS_CHANGED returns that hash, so the same URL is a cache hit on re-runs instead of a fresh download every time.

    Decoding is handled by Pillow, and this is where it behaves like core Load Image rather than a quick-and-dirty fetcher. It applies EXIF transposition, converts to RGB, and - the part that matters - pulls the alpha channel out as a mask. MASK is 1 - alpha, so transparent areas become mask 1, exactly matching core Load Image's convention for compositing and inpainting. An image with no alpha gets the same empty 64×64 mask core uses. It also runs through node_helpers.pillow when available, so you inherit the same PIL-sandboxing path the core node uses.

    Inputs and outputs

    Honestly, the input list is one thing:

    • image_url - a plain string widget. Must be an absolute http/https URL. That's it. No sizing, no format picker, nothing to fiddle with.

    Outputs:

    • IMAGE - the image as a float tensor in 0–1 range. Animated GIFs, WebP, and MPO files decode into a batched tensor (one frame per image in the batch), again mirroring core Load Image.
    • MASK - the alpha-derived mask described above, ready to wire into a mask or inpainting node.

    That makes it handy for img2img and ControlNet from a remote reference, character-consistency setups where you keep a face or outfit image hosted somewhere, and any workflow where the alpha channel is doing real work (a transparent PNG feeding straight into an inpainting or compositing path).

    Installing it

    Search ImageGen Toolkit Dev Utils in ComfyUI Manager, install, restart. The README is explicit that Manager (or the ComfyUI Registry) is the supported path - a raw git clone is the development flow and you'd be on the hook for npm install && npm run build and installing the Python deps (imageio[ffmpeg] and Pillow, which live in pyproject.toml rather than a requirements.txt). Also note the README's insistence on a current frontend (1.24.4 at the time of writing) - the pack ships frontend bits, so if anything looks off, update that first.

    Common issues

    • Non-http URLs get rejected. Local paths, file://, and blank input fail at validation, on purpose.
    • 403 errors from certain hosts. The node sends a User-Agent header, but hotlink-protected hosts and some CDNs (Discord's, notably) will still refuse the request. If a specific URL always fails, test it in a browser first - if the browser can't get it either, the node can't.
    • Re-download after a restart. The cache sits in the temp directory, so a cleared temp folder means fetching again. Same deal as every other URL-cache node.
    • No resizing. Unlike the pack's video node, this one loads full resolution. A 10,000-px image gets loaded at 10,000 px, so keep an eye on RAM if you're pulling giant files.
    CategoryImageGen Toolkit Dev Utils/Image

    Inputs (1)

    NameTypeDefaultDescription
    image_urlSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK