ComfyUI Node

MaskClamp

A labeled anchor for the fiddliest wire in an inpaint graph

By Nourepide·Created 3 years ago·Updated 2 years ago· 295
MaskClamp
  • mask
  • MASK

MaskClamp takes a MASK in and returns the same MASK out. No thresholding, no range limiting, no dilation - the name oversells it. It's a pass-through node, and masks are exactly the kind of value that needs one.

Why masks specifically

Masks are the wire people lose. They're small tensors, they have no inherent label, and a busy workflow can hold half a dozen of them: the inpaint region, the face mask for a detailer, the background cut for compositing. Confuse one with another and you silently regenerate the wrong area of the image. MaskClamp gives a mask wire a named, physical place in the graph - title it "keep", title it "repaint" - so you stop guessing which mask is which when you're editing the workflow a week later.

It also gives you a clean branch point: feed one mask into a conditioning-with-mask, a SetLatentNoiseMask, and a blur node from a single spot instead of three awkward taps off the mask generator. Same idea as a reroute, but for a type primitives can't carry, in a pack that's otherwise busy doing image work.

How it works

The whole implementation is def node(self, mask): return (mask,). The same object flows out unchanged - no copy, no processing, no cost beyond one node executing. It's one of 13 pass-through clamps in Allor's "clamp" family, covering MODEL, VAE, LATENT, IMAGE, CONDITIONING and friends, so the pattern generalizes to every heavy type in your graph.

Input: mask (MASK, required). Output: MASK. That's the entire interface.

Installing Allor

MaskClamp lives in the Allor Plugin, Nourepide's ~90-node image-processing pack. Install via ComfyUI Manager (search "Allor") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor

Restart ComfyUI. First run creates a config.json in the pack folder; the bundled install.sh / install.bat install requirements into your venv or embedded Python. Dependencies (rembg, onnx, plus onnxruntime via rembg) serve the pack's segmentation nodes - this pass-through doesn't touch them.

Common issues

The pack's known pain point is updating. Its history was rebased to strip images, the README warns this can break auto-updates, and users report Allor nodes silently disappearing after an update. A fresh re-clone is the reliable fix; "update_frequency": "never" in config.json sidesteps it.

Categoryclamp

Inputs (1)

NameTypeDefaultDescription
maskMASK

Outputs (1)

NameTypeDescription
MASKMASK