Nodes/ComfyUI_agilly1989_motorway/LoadImageMask_motorway_edition
ComfyUI Node

LoadImageMask_motorway_edition

Load an image straight as a mask — pick your channel

By agilly1989·Created 2 years ago·Updated about a year ago· 7
LoadImageMask_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
image
channel
OUTPUT_MASK_keyMASK

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 your input folder. 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; use alpha when the transparency carries the mask.
  • OUTPUT_MASK_key (default MASK) - 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 MotorwayStart node so there's a pipe.
  • Keys are exact strings - if the downstream reader expects MASK and you renamed the output key, you'll get Key: 'MASK' doesn't exist in motorway.
  • channel matters. 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.

Categoryagilly1989 Nodes/Motorway-ed/mask

Inputs (4)

NameTypeDefaultDescription
imageCOMBO1 options: example.png
channelCOMBO4 options: alpha, red, green, blue
OUTPUT_MASK_keySTRINGMASK
MOTORWAY 🚌💨optMOTORWAY 🚌💨

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨