Nodes/BaiduMeux_Comfy Tools/Meux Image Loader
ComfyUI Node

Meux Image Loader

The Load Image node that also fetches from a URL

By fchangjun·Created about a year ago·Updated 5 months ago· 4
Meux Image Loader
    • image
    • mask
    source_typelocal
    image
    image_url
    filename_hint
    persist_to_inputtrue
    overwrite_existingfalse
    download_timeout10.00
    max_download_mb20.00
    verify_ssltrue

    ComfyUI's built-in Load Image is fine until the image you need lives on a server instead of your input folder. That's the whole gap MeuxImageLoader (from the BaiduMeux ComfyTools pack) exists to close: it mirrors the stock loader's local behavior and adds one toggle that switches it to "download this URL at runtime." Nothing else about the pack matters for this node - if all you want is URL loading, this is the one you reach for.

    How it works

    The node is a near-drop-in copy of ComfyUI's Load Image - same input-directory listing, same upload button, same EXIF orientation handling - plus a requests-based downloader bolted on. Set source_type to local and you get the familiar file dropdown. Set it to url, and the image field goes dead while image_url takes over.

    The URL path is the part worth understanding. It streams the download (so a slow server doesn't eat your RAM), enforces a size cap, and - the useful bit - caches what it grabs. With persist_to_input on (the default), downloaded files land in ComfyUI/input/meux_downloads and get a filename built from a hash of the URL plus your filename_hint. That changed in v1.7.1: older versions dropped downloads straight into input/, which got messy fast. Now each URL keeps its own cache entry, and you can flip overwrite_existing if you ever want to re-pull it. Same URL twice means one download, which matters if you're looping.

    The inputs that matter

    Most of these you can leave alone, and the defaults are sensibly conservative:

    • source_type - local or url. The one switch that decides everything.
    • image / image_url - the file dropdown or the URL, depending on source_type. In URL mode the node validates that you actually typed an http:// or https:// address.
    • persist_to_input - keep it on unless you're testing; caching is the feature.
    • download_timeout (10s) and max_download_mb (20MB) - bump the timeout for slow hosts, bump the size cap if you're loading big PNGs.
    • verify_ssl - flip to off only for self-signed or dodgy certs.

    Outputs are image (IMAGE) and mask (MASK). The mask is derived for free: alpha channel if the file has one, grayscale if it's a luminance image, and a zeros mask if it's plain RGB. Handy for feeding straight into mask-based pipelines, but don't expect a mask from an opaque JPEG.

    Installing it

    The pack is small and clones like any custom node:

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

    Then restart ComfyUI. ComfyUI Manager can also do this - search for "Baidu Meux ComfyTools" and hit install.

    Troubleshooting

    Two things bite people. First, the requirements file installs the whole pack's dependencies - transformers, torchvision, realesrgan, scipy - even though this node only needs requests, numpy and Pillow. That's the classic custom-node problem: no dependency isolation, so an old torchvision from this install can quietly fight with another pack's. If you're on a strict environment, a venv for ComfyUI (and a reinstall when it misbehaves) is the standard fix.

    Second, a size-cap failure throws "图片超过限制" - the message is in Chinese and the value it quotes is in MB. If you hit it, raise max_download_mb rather than assuming the URL is broken. And if a URL download fails outright, check verify_ssl before anything else; corporate proxies with MITM certs are the usual suspect.

    Categoryimage

    Inputs (9)

    NameTypeDefaultDescription
    source_typeCOMBOlocal2 options: local, url
    imageCOMBO1 options: example.png
    image_urloptSTRING
    filename_hintoptSTRING
    persist_to_inputoptBOOLEANtrue
    overwrite_existingoptBOOLEANfalse
    download_timeoutoptFLOAT10.001–120
    max_download_mboptFLOAT20.001–200
    verify_ssloptBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    maskMASK