Nodes/Steaked-nodes/Get image from URL (with referer)
ComfyUI Node

Get image from URL (with referer)

The node that sneaks past hotlink protection

By StealthNinja1O1·Created 11 months ago·Updated 5 months ago· 0
Get image from URL (with referer)
    • IMAGE
    ◄url►
    ◄use_referertrue►
    ◄custom_referer►

    You found the perfect reference image on Gelbooru. You copy the URL, drop a Load Image node, and ComfyUI shrugs - because you can't paste a URL into a loader that expects a local file. That's the gap this node exists for. It downloads an image from a URL and hands you a normal IMAGE tensor, and unlike most URL loaders it actually works on the sites that try to block you.

    The trick is the referer. A lot of booru-style hosts serve images only when the request looks like it came from their own site - open the file URL in a fresh tab and you get an empty page, but it loads fine when the page itself embeds it. GetImageFromURL gets around this by sending a Referer header. If use_referer is on (the default), it derives one from the URL you gave it - for https://gelbooru.com/index.php?page=post&s=view&id=123 it figures out the site is gelbooru.com and sends https://gelbooru.com/ as the referer. It also sends a normal Chrome User-Agent, so the request looks like a browser, not a scraper.

    The inputs that matter

    • url - paste the direct image link here. This needs to be the image file itself (something ending in .jpg/.png), not the page URL, for most sources.
    • use_referer - leave it on. This is the whole point of the node.
    • custom_referer - optional. If the automatic referer doesn't work, you can type the exact referer the host expects.

    The single output is IMAGE, ready to wire into anything. Handy detail: if you leave the URL empty, it returns a tiny black 64×64 placeholder instead of crashing, which keeps your workflow running while you're still filling things in. There's a 30-second timeout on the download, so a dead link fails fast rather than hanging your queue.

    When you'd actually use it

    This is a workflow-comfort node more than a production tool. The obvious use is pulling reference images into a graph without manually saving files to ComfyUI/input first - build an img2img or ControlNet workflow that starts from a URL and you can re-run it on any image by editing one text box. It's also handy for batch pipelines where images live on a server. The tradeoff is the usual one for anything fetching from the internet: if the host dies, rate-limits you, or changes its referer policy, the node starts failing and you're back to saving files locally. It won't defeat serious anti-bot measures - it's hotlink protection, not scraping.

    Worth noting: it declares itself an output node, so ComfyUI treats it as a terminal - you can preview its output directly.

    Install

    Part of Steaked-nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StealthNinja1O1/Steaked-nodes
    

    Restart ComfyUI, or grab it via ComfyUI Manager (search "Steaked-nodes"). No extra dependencies, no model downloads - just torch, numpy and Pillow, all already present.

    Common issues

    If an image fails to load, first check that the URL is the direct file link, not the gallery page. Next, try use_referer off - some sites serve files fine without a referer and get weird if you send one. If the automatic referer is wrong for an unusual host, set custom_referer manually. And remember the 30-second timeout: a large file on a slow host can fail on a flaky connection. When in doubt, paste the URL into a private browser window and see if it loads there - if it doesn't, no node is going to help.

    CategorySteaked

    Inputs (3)

    NameTypeDefaultDescription
    urlSTRING—
    use_refererBOOLEANtrue—
    custom_refereroptSTRING—

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE—