Load Image Mask from URL
A mask straight from a URL image, channel by channel
- MASK
Load Image Mask from URL is the sibling of the pack's Load Image from URL node, but it skips straight to the part you usually actually want: a mask. You give it a URL and pick a color channel, and it returns a MASK tensor built from that channel. It's the online version of the classic "use the alpha channel of an image as an inpaint mask" trick, minus the step of saving the file and dragging it in.
It lands in the DoubTech/Image category, same as its sibling. The default URL is the pack author's QR-code test image from doubttech.ai, so treat the field as a placeholder.
The two inputs
image- a URL string. Same fetching engine as DTLoadImage, including support fordata:URLs if you want to pass base64 without a network trip.channel- a dropdown with four choices:alpha,red,green,blue. The node converts the image to RGBA if needed, extracts the channel you picked, and normalizes it to a 0–1 mask tensor.
One quirk worth internalizing: the alpha channel comes out inverted (transparent = 1, opaque = 0), because that's the convention for inpaint masks - the masked area is where generation happens. RGB channels come out as-is. If you pick a channel that doesn't exist after conversion, you get a blank 64×64 mask instead of an error.
The single output is MASK, which feeds straight into core nodes: SetLatentNoiseMask before a KSampler for inpainting, MaskToImage if you need it as an image, or any of the compositing/masking utilities in Impact Pack.
How it works
Fetch → EXIF-transpose → convert to RGBA → pull the channel → normalize. It's a thin wrapper around stock masking logic, so there's no magic to learn. Like its sibling, it refetches the URL on every run (the node always reports changed), so it's not the node to put inside a hot loop.
Install
Same as the whole pack. ComfyUI Manager → search "DTAIComfyLoaders" (title "Comfy UI Online Loaders"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/yolanother/DTAIComfyLoaders
Restart after. Only dependency is requests.
Where people get burned
- Alpha inversion surprises people. If your mask looks backwards, remember alpha is inverted by design; flip it with a mask invert node if you wanted the opposite.
- Fragile links. Plain GET with no browser headers - hotlinks and bot-protected URLs can return HTML instead of pixels, and the node will happily try to mask an HTML page. Test the URL in a browser first.
- No file caching. Every queue re-downloads, so a slow host means a slow run.
- The default QR image again. Replace the default URL; queueing it unedited gives you a mask of DoubTech's QR code.
Reach for this when you want to do URL-driven inpainting or masked compositing without touching your input folder. For local images, the stock LoadImage + mask chain is still the straightforward path.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | STRING | https://www.doubtech.ai/img/doubtech.ai-qrcode.png | — |
| channel | COMBO | 4 options: alpha, red, green, blue |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |