Combine HDMasks
ComfyUI Node Guide
- mask1
- mask2
- MASK
This one's a plumbing node, not a headline feature - it doesn't get a mention in the hd_node README's four-item summary, which tracks with what it is: a small helper that exists to support the pack's real work, not to be the star of a workflow. If you've used Impact Pack's detector nodes or the newer Inpaint Crop and Stitch pattern, you already know the shape of the problem this kind of node solves: once you start cropping regions, processing them, and pasting results back, you end up juggling several masks that all need to agree with each other, and something has to merge them.
What it does. Combine HDMasks takes two masks - mask1 and mask2 - plus an index that only ever takes the value 0 or 1, and returns one merged MASK. The schema doesn't spell out the exact merge operation, and there's no README section covering this node specifically, so here's the honest read: with a binary switch rather than a blend-strength float, the most likely behavior is that index decides precedence - which mask wins where the two overlap - rather than the node doing a proper weighted blend. It's also entirely possible it's simpler than that and index just selects which of the two masks passes through. Either way, the safest thing to do before you build a workflow around it is a thirty-second test: feed it two masks that only partially overlap, flip index between 0 and 1, and look at what comes out. That tells you more than guessing from the node's name ever will.
Where it fits. In the context of the rest of this pack, this reads like supporting infrastructure for the crop-process-paste-back loop the other HD nodes imply - you get a mask from HD-GetMaskArea, maybe another from somewhere else in your graph, and you need one combined mask before you composite anything back. That's the same job Impact Pack and the Inpaint Crop/Stitch pattern solve with more polished, documented nodes; this is the author's own smaller, rougher version of it, built for a specific pipeline rather than for general reuse.
The one input worth understanding before you wire this up. index is the only control you actually set, and its whole valid range is 0 or 1 - there's no in-between. If your use case needs a genuine weighted blend between two masks (say, 70% of one and 30% of the other), this isn't that node; it looks like a binary decision, not a mixer.
Installing it. Same as every node in this pack: search "hd-nodes-comfyui" or "HD Nodes" in ComfyUI Manager, or clone it manually with cd ComfyUI/custom_nodes && git clone https://github.com/xiaoxiaodesha/hd_node, then restart ComfyUI. This particular node has nothing to do with face detection, but the pack as a whole needs insightface installed in the same Python environment regardless of which node you actually want - the README's install instruction isn't scoped per-node, and if that import fails at load time it can knock every HD node out of your node search at once, this one included. The HD-FaceIndex article in this series has the full story on that dependency if you need it.
Troubleshooting. There's genuinely not much community signal to draw on here - this is an obscure, personal-use utility node with no discussion anywhere, and the README doesn't cover it, so I'm not going to invent failure modes for it. The one real gotcha is the ambiguity above: if your merged mask isn't doing what you expected, don't assume you found a bug - test both index values in isolation first, because the node's actual behavior is simpler (and more binary) than "combine" might suggest.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mask1 | MASK | — | |
| mask2 | MASK | — | |
| index | INT | 00–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |