Nodes/comfyui_andalusi/Andalusi Image Loader
ComfyUI Node

Andalusi Image Loader

Load images straight from a URL (and grab the alpha as a mask)

By AndalusiLLC·Created 7 months ago·Updated 7 months ago· 0
Andalusi Image Loader
    • IMAGE
    • MASK
    image
    url

    This is ComfyUI's built-in Load Image node with one genuinely useful trick bolted on: an optional url field that pulls the image from the web instead of your input folder. Everything else - the dropdown, the IMAGE + MASK outputs, the EXIF handling - is the stock behavior, reimplemented rather than reinvented. If you've ever found a reference online and wished you could skip "download it, drag it into ComfyUI/input, hunt for it in the dropdown," this is the shortcut.

    Where it earns its keep is reference-chasing. Wire the IMAGE output into an img2img, a ControlNet preprocessor, or an IPAdapter reference node and you've got a pipeline that pulls a fresh reference every run without a single file cluttering your input folder. That folder is where every other ComfyUI loader reads from, and it's a genuinely annoying thing to keep tidy.

    How it works

    For local files it behaves exactly like Load Image: the dropdown lists image files in the input/ directory, and you can upload straight from the widget. The url field is the difference. If it starts with http or https, the node does a plain requests.get into memory and opens the result with Pillow; otherwise it reads the file path from the dropdown.

    From there the pipeline is stock. EXIF orientation is fixed, frames are normalized to RGB, and the alpha channel comes out as a MASK. One thing worth knowing: the mask is inverted - it's 1 − alpha - which is ComfyUI's convention, so transparent pixels arrive as white. That's the same "white = the region to modify" semantics the inpainting nodes use, which means a cutout PNG with a transparent background feeds straight into masked img2img. No alpha at all? You get a placeholder 64×64 black mask.

    Multi-frame files are handled too: GIFs and animated WebP come out as a batch, as long as frames share a size (mismatched frames are dropped), and MPO stops after the first frame.

    The inputs that matter

    • image - the dropdown of files in your input directory. Always filled in, even when you're using a URL, because it's the fallback.
    • url - optional text field. Leave it empty to load locally.

    Outputs: IMAGE and MASK.

    Where people get burned

    • The URL has to start with http/https. A URL like www.example.com/img.png without the scheme silently falls back to whatever is selected in the dropdown - no error, just the wrong image. If the wrong thing loads, check the URL prefix first.
    • It caches on the URL, not the content. The node's change-detection hashes the URL string, so if the remote image changes, ComfyUI won't re-run and you'll keep getting the stale version until you edit the URL or clear the cache. Fine for static references, wrong tool for anything live.
    • No timeout, no headers. requests.get runs bare. A dead server can hang your queue for a while, and hotlink-protected sites or ones that need auth headers will fail with an HTTP error at runtime - validation only checks that the URL starts with http, not that it's reachable.
    • The mask is inverted alpha, on purpose. Don't be surprised that transparent areas come out white; that's the Comfy convention and it's what inpainting expects.

    Installation

    This is a tiny pack - three nodes total, including the two canvas nodes. No requirements.txt, no model downloads, nothing beyond what ComfyUI already bundles (requests, Pillow, numpy, torch). That's rare for a custom node and worth appreciating.

    cd ComfyUI/custom_nodes
    git clone https://github.com/AndalusiLLC/comfyui_andalusi.git
    

    Then restart ComfyUI. Or in ComfyUI Manager: Install Custom Nodes → search for "Andalusi."

    One honest caveat: this is a personal utility pack by Kornesh Kanan (Kobaisy) with essentially no community presence. The code is small and readable, which is the upside of a 3-file repo - skim it if you like, since custom nodes run as arbitrary Python. Just don't expect frequent updates or fast issue responses.

    Troubleshooting

    • Node missing from the menu - restart ComfyUI after cloning, and make sure the folder is custom_nodes/comfyui_andalusi.
    • URL load fails - check it's a direct image link (ends in .png/.jpg/etc., or at least serves raw image bytes), not a gallery page.
    • Mask comes out all black - the image simply has no alpha channel. That's expected, not a bug.
    Categoryimage

    Inputs (2)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    urloptSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK