Nodes/comfyui-easyapi-nodes/Load Image From Url (As Mask)
ComfyUI Node

Load Image From Url (As Mask)

Fetch a mask image from a link instead of painting one

By lldacing·Created 3 years ago·Updated 8 months ago· 96
Load Image From Url (As Mask)
    • masks
    urls
    channelred

    Same idea as this pack's LoadImageFromURL, aimed at masks: give it one or more links and it fetches each one and extracts a channel as a MASK, no local file involved anywhere. Reach for it whenever a mask already exists somewhere else - a segmentation result from an earlier API call, a mask sitting in object storage, an alpha-channel PNG a client uploaded to their own CDN - and fetching it is easier than re-deriving it inside the graph.

    How it works

    urls takes one link per line, the same convention as its image counterpart. Each fetched image gets one channel pulled out as its mask, controlled by channel.

    The inputs and outputs that matter

    • urls (STRING, multiline) - one URL per line.
    • channel (enum: red, green, blue, alpha; default red) - worth noticing this defaults differently from the local-path version of this node, which has no stated default. Check how the source actually encoded its mask before assuming the default channel is the right one for your image.
    • masks (MASK) - a list output, one mask per line in urls.

    How to install it

    Via ComfyUI Manager: search comfyui-easyapi-nodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lldacing/comfyui-easyapi-nodes.git
    cd comfyui-easyapi-nodes
    pip install -r requirements.txt
    

    Restart ComfyUI. No models involved - just outbound network access.

    Common issues & troubleshooting

    Same network caveats as LoadImageFromURL. Everything has to actually be reachable from wherever ComfyUI runs; some hosts refuse hotlinked requests without a browser referer; and one bad link in a multi-line list will typically fail the whole fetch rather than skipping past it quietly. Validate a batch of externally-supplied URLs before loading them all at once.

    A mask that looks inverted or wrong is very often a channel mismatch, not a fetch problem. Before assuming the source URL or image is bad, try switching channel - a mask baked into the blue channel read as red will look like noise, not like "no mask."

    It's easy to reach for this node when you actually want LoadImageFromURL. If the thing you're fetching is a genuine photo and you just need its alpha channel or a rough silhouette, that's fine here - but if what you actually need is the full-color image and a mask together, LoadImageFromURL already returns both images and masks from the same fetch, so you don't need this node at all in that case.

    CategoryEasyApi/Image

    Inputs (2)

    NameTypeDefaultDescription
    urlsSTRING
    channelCOMBOred4 options: red, green, blue, alpha

    Outputs (1)

    NameTypeDescription
    masksMASK