HD SmoothEdge
ComfyUI Node Guide
- masks
- MASK
If you've ever pasted a processed crop back into a photo and gotten a visible hard edge where the two pieces meet, you already know exactly why a node like this exists. Feathering a mask's edge before you composite with it is one of the oldest tricks in inpainting - Ultimate SD Upscale has its own mask_blur for the same reason, and the standard advice for masked edits generally lands in the 4-12px range for a subtle blend. HD SmoothEdge is this pack's own version of that same idea, dedicated to just that one job.
What it does. It takes a MASK input and returns a smoothed MASK output - no image involved, just the mask geometry. Two parameters shape the result: sigma (default 1.5, range 0-12) and gamma (default 20, no declared range in the schema - just a plain int). sigma is a strong tell on its own: that's the standard name for a Gaussian blur's standard deviation, and the 0-12 range lines up neatly with the 4-12px feathering window that's the normal ballpark for mask edges elsewhere in this ecosystem. Push it toward 0 for a near-hard edge, push it up toward the top of the range for a wide, soft transition.
gamma is the honest gap here. The schema gives it a type and a default and nothing else - no min, no max, no tooltip. Given the name and the context (blurring a binary mask tends to leave you with soft gray edges that need re-contrasting back toward black-and-white, or the opposite - deliberately keeping some of that softness), a reasonable guess is that it's a secondary shaping control on top of the blur: something that pulls the smoothed edge back toward sharp, or tunes how gradual the falloff reads after the Gaussian pass. That's a guess, though, not a documented fact, and with no min/max in the schema to anchor expectations, the fastest way to actually learn what it does is to leave sigma fixed, sweep gamma through a few values, and look at the output mask directly.
Where it fits. In the context of this pack, this is the node you'd reach for right before a paste-back step - after HD-GetMaskArea hands you a crop mask and Combine-HDMasks or Cover-HDMasks help you position it, running the result through HD SmoothEdge before compositing is what keeps the seam from being visible. It's the same instinct behind the community's "composite after inpainting, and feather while you're at it" convention - a hard mask boundary reads as an obvious paste no matter how good the content inside it looks.
Installing it. Same steps as the rest of hd_node: search "hd-nodes-comfyui" or "HD Nodes" in ComfyUI Manager, or clone it directly - cd ComfyUI/custom_nodes && git clone https://github.com/xiaoxiaodesha/hd_node - then restart. This node does pure mask math and has nothing to do with face detection, but the pack's insightface requirement isn't scoped to just the node that needs it; if that import fails at startup, the whole pack - including this one - can disappear from your node search rather than just the one face-related node. The HD-FaceIndex article in this series covers that install in full.
Troubleshooting. The main failure mode worth naming: too little smoothing (sigma near 0) and you've done nothing useful - the paste-back seam will still show. Too much, and a small mask can blur away to almost nothing, especially on a tight crop like a face region where there isn't much margin to soften into before you eat into the content you actually wanted to keep. If your composited result looks like the mask vanished rather than softened, that's the direction to check first. Past that, there's no community troubleshooting thread to lean on for this specific node - it's small, personal-use, and undocumented beyond its own parameter names, so treat the above as informed inference rather than a verified failure catalogue.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — | |
| sigma | FLOAT | 1.50–12 | — |
| gamma | INT | 20 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |