ComfyUI Node

Mask (Improved)

Mask (Improved) — keep your inpaint masks flowing in order

By augment-lib·Created 6 months ago·Updated 6 months ago· 2
Mask (Improved)
  • value
  • trigger
  • value
  • json
  • trigger

AugmentWaitMask - "Mask (Improved)" in the menu - is the trigger-aware passthrough for the MASK type in Augment's Flow Control family. Masks are where inpainting and compositing get fiddly: they're small, they're easy to miss, and they're exactly the kind of input ComfyUI's cache decides "hasn't changed" while your inpaint region quietly stops updating. If you've ever edited a mask and watched the inpaint paint the same spot anyway, you know the pain this node targets.

This is also the flavor you'll want in a multi-stage masking pipeline - Augment's own pack has logo masks, bounding boxes, and crop tools all spitting out masks, and threading them through a Wait node keeps those stages honest about running in order.

How it works

Straight from the source: it doesn't actually wait. execute passes the mask straight through and emits a trigger token. The sequencing comes from the pack's executor override - on import, Augment patches ComfyUI's execution internals so any node that takes or emits a TRIGGER type always re-runs and is never skipped by the output cache. Wire trigger outputs into the next stage's trigger input and your mask pipeline runs in the order you drew it, every run, with no silent cache short-circuits.

So: a "make sure this mask reaches this stage, in this order" node. That's the whole job, and it's a real one.

The inputs and outputs

  • value (MASK, required) - the mask to carry. Comes in on the wire; no widget.
  • trigger (optional) - the sequencing input from a previous stage.
  • Outputs value (MASK), json (AUGMENT_JSON), trigger (TRIGGER) - the mask passes through unchanged, the trigger continues the chain, and json carries a structured dump (type and value as a string) for Augment's JSON Extract / JSON Viewer.

Nothing to configure - pure ordering and re-execution.

How to install

Augment isn't on the ComfyUI registry yet, so it's a manual clone. The folder name is the thing that reliably bites:

cd ComfyUI/custom_nodes
git clone https://github.com/augment-lib/augment-ComfyUI augment
cd augment
pip install -r requirements.txt

The clone target must be augment - the pack imports everything as custom_nodes.augment.py.*, so the default folder name breaks all node loading. Restart ComfyUI afterward; nodes appear under Augment.

Dependencies are light (opencv-python, numpy, torch, Pillow, requests) and already present from running ComfyUI. No model files, no API key - the paid API only applies to the pack's vector nodes.

Common issues

  • Inpaint ignoring your edited mask - cache behavior. Thread the mask through this node and sequence the triggers so the inpaint stage re-runs.
  • Node missing after install - folder name. Rename to augment, restart.
  • Graph re-runs more than before - by design. Trigger nodes always re-execute, so use Wait nodes where ordering genuinely matters.
CategoryAugment/Utils

Inputs (2)

NameTypeDefaultDescription
valueMASK
triggeroptTRIGGER

Outputs (3)

NameTypeDescription
valueMASK
jsonAUGMENT_JSON
triggerTRIGGER