Nodes/ComfyUI-FairLab/Load Image From URL
ComfyUI Node

Load Image From URL

Grab a remote image without saving it first

By yanhuifair·Created 2 years ago·Updated 3 months ago· 2
Load Image From URL
    • image
    • mask
    • name
    url
    channelsRGB

    Copy a URL, paste it into a node, get the image. Load Image From URL downloads a remote image and converts it straight into ComfyUI IMAGE data - no saving to input/, no file management, no round trip through your browser. For anything that starts from a web-hosted image - a reference from a sharing site, a frame from a link, art you found online - this collapses the whole "download, save, reload" ritual into one wire.

    The node itself is dead simple to operate:

    Inputs and outputs

    • url (STRING) in - the direct image URL.
    • channels (RGB / RGBA) - target channel layout; default RGB.
    • image (IMAGE) out - the decoded image.
    • mask (MASK) out - here's the honest gotcha: per the source, the mask output currently returns the same tensor as the image. Don't wire it into an inpainting step expecting an alpha-derived mask; treat it as a placeholder.
    • name (STRING) out - the filename derived from the URL.

    How it works

    It fetches the URL with the requests library (yes, the pack's dependency list is real here), decodes it through PIL, and converts to a tensor. It does not cache to disk - each run re-fetches. That's a feature when the URL content changes (live webcam-ish sources), and a liability when the remote is slow or flaky: every run pays the network cost, and an unreachable URL fails the workflow.

    Where it fits

    Reference-image pipelines where the source lives on the web, automation that pulls from an API or a signed URL, and any "I have a link" workflow. Pair it with a save node if you want the downloaded copy persisted.

    Install

    FairLab, one pack: ComfyUI Manager (search ComfyUI-FairLab) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yanhuifair/ComfyUI-FairLab.git
    cd ComfyUI-FairLab
    pip install -r requirements.txt
    

    This is one of the few FairLab nodes that genuinely needs a listed dependency - requests - which the pack's requirements.txt installs for you. Restart, then look under Fair/image.

    Gotchas

    • Needs outbound network from the server. In a sandboxed or offline ComfyUI this node fails immediately.
    • Some hosts block non-browser user agents or hotlinking. A URL that opens fine in your browser can still 403 here.
    • Re-fetching every run means workflows that should be deterministic aren't - if the remote image changes, your inputs change. For stable reference work, download once and use the directory loader instead.
    • The mask output being a copy of the image is a real quirk of this pack's current implementation - check it again after an update, because it's the kind of thing that gets fixed.
    CategoryFair/image

    Inputs (2)

    NameTypeDefaultDescription
    urlSTRING
    channelsCOMBORGB2 options: RGB, RGBA

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    nameSTRING