Nodes/ComfyUI_agilly1989_motorway/GrowMask_motorway_edition
ComfyUI Node

GrowMask_motorway_edition

Grow or shrink a mask without dragging a single wire

By agilly1989Β·Created 2 years agoΒ·Updated about a year agoΒ· 7
GrowMask_motorway_edition
  • MOTORWAY πŸšŒπŸ’¨
  • MOTORWAY πŸšŒπŸ’¨
β—„INPUT_mask_keymaskβ–Ί
β—„expand0β–Ί
β—„tapered_cornerstrueβ–Ί
β—„OUTPUT_MASK_keyMASKβ–Ί

GrowMask is one of those quiet workhorse nodes you end up using in almost every inpainting and outpainting workflow. This version is that same node, wrapped so it gets its mask out of a MOTORWAY πŸšŒπŸ’¨ pipe instead of off a wire.

It ships in agilly1989/ComfyUI_agilly1989_motorway, a hobby "pipe" pack by agilly1989. The idea there is simple: you park values in a key-value object called a Motorway and pull them out again later, so big workflows stop looking like cable spaghetti. Every *_motorway_edition node in the pack is an auto-generated clone of a stock ComfyUI node that plugs into that pipe. GrowMask_motorway_edition lives under agilly1989 Nodes/Motorway-ed/mask.

What it does

The underlying GrowMask is exactly what the name says: it grows a mask by expand pixels when expand is positive, and shrinks it when negative. Negative values are the classic move for shrinking an inpaint mask so the model regenerates a slightly smaller region and leaves you clean edges to blend. tapered_corners (on by default) keeps corners from pinching inward when you shrink hard - turn it off if you want sharp, square corners.

In this wrapper the inputs and outputs that matter are:

  • INPUT_mask_key (default "mask") - the pipe key the mask is read from
  • expand (INT, βˆ’16384 to 16384) - pixels to grow (positive) or shrink (negative)
  • tapered_corners (BOOLEAN)
  • OUTPUT_MASK_key (default "MASK") - the key the result is stored under

The only visible output is the Motorway pipe itself. The grown mask isn't on a wire; it's sitting in the pipe under whatever you set OUTPUT_MASK_key to, ready for a later node that reads the same key.

How the wrapper works

Like every clone in this pack: it pops the Motorway, looks up the key in INPUT_mask_key, runs stock GrowMask with your widget values, stores the output under OUTPUT_MASK_key, and returns a cloned copy of the pipe. The clone step matters - it means the node doesn't mutate the pipe in place, so branches that came before it still see the original.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

Restart ComfyUI, or search "motorway" in ComfyUI Manager. No requirements.txt, no model downloads - it's pure Python.

Gotchas

The pack is loudly labelled BETA ("if things break it's because I broke it"). Two things to know: if you get a 'MotorwayClass' object has no attribute 'hash_' error, your key string doesn't match anything written into the pipe earlier - check case and spelling. And the motorway_edition clones come from the pack's "danger zone" folder, which the author disabled in the 1.1.7 hotfix; if you install today and this node isn't in your menu, that's why.

Categoryagilly1989 Nodes/Motorway-ed/mask

Inputs (5)

NameTypeDefaultDescription
MOTORWAY πŸšŒπŸ’¨MOTORWAY πŸšŒπŸ’¨β€”
INPUT_mask_keySTRINGmaskβ€”
expandINT0-16384–16384β€”
tapered_cornersBOOLEANtrueβ€”
OUTPUT_MASK_keySTRINGMASKβ€”

Outputs (1)

NameTypeDescription
MOTORWAY πŸšŒπŸ’¨MOTORWAY πŸšŒπŸ’¨β€”