LoadImageMask_motorway_edition
Load an image straight as a mask — pick your channel
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
LoadImageMask_motorway_edition is the "load as a mask instead of a picture" node. It reads an image file from your input folder and hands it to the Motorway pipe as a MASK - picking which channel of the image becomes the mask: alpha, red, green, or blue.
When would you load an image as a mask? The classic cases: you painted a mask in an editor and saved it as a PNG (red channel = "keep this", black = "don't"), you have a transparency layer and want its alpha as the mask directly, or you're using a channel from a rendered normal/depth image as a masking signal. Masks are how ComfyUI knows what to inpaint, what to keep, and where a ControlNet condition should bite - so a node that converts a saved image into a mask is a small but essential bridge between your pixel editing and your pipeline.
In a Motorway workflow this matters even more, because masks travel by key: load the mask once, and every downstream node that wants to inpaint reads MASK out of the pipe. No second wire to drag around.
The wrapper
image- file dropdown from yourinputfolder. Upload via the usual widget.channel- enum:alpha,red,green,blue. Which channel to use as the mask. If your mask image is grayscale, any of R/G/B gives you the same thing; usealphawhen the transparency carries the mask.OUTPUT_MASK_key(defaultMASK) - where the mask lands in the pipe.MOTORWAY 🚌💨- marked optional in the schema, but connect it anyway: the wrapper still needs a pipe to write the mask into, and without one the node errors unhelpfully.
Output port is the pipe; pull the MASK key out with a Motorway AxB ramp to feed a regular node.
Installing
Part of the Motorway pack:
cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway
# restart ComfyUI
Or ComfyUI Manager → search ComfyUI_agilly1989_motorway → Install. No models, no extra pip dependencies.
Gotchas
- Start the graph with a
MotorwayStartnode so there's a pipe. - Keys are exact strings - if the downstream reader expects
MASKand you renamed the output key, you'll getKey: 'MASK' doesn't exist in motorway. channelmatters. A mask you painted as white-on-black gives opposite results from black-on-white, and choosing red vs. alpha on a PNG with transparency can silently flip your mask. Check the node's preview if in doubt.- Beta pack: "IF THINGS BREAK ITS BECAUSE I BROKE IT" is literally the README; generated clones have been dropped from some releases. Missing node after install = version/beta, not you.
Loading as a mask isn't glamorous, but it's the difference between a clean inpaint workflow and fighting your channels.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| channel | COMBO | 4 options: alpha, red, green, blue | |
| OUTPUT_MASK_key | STRING | MASK | — |
| MOTORWAY 🚌💨opt | MOTORWAY 🚌💨 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |