Nodes/comfyui-superside-nodes/Superside Scene Exclusion Mask (generic)
ComfyUI Node

Superside Scene Exclusion Mask (generic)

Enhance the Scene, Leave the Dimmer Switch and the Logo Alone

By Superside·Created about a month ago·Updated 3 days ago· 1
Superside Scene Exclusion Mask (generic)
  • image
  • mask
  • info
  • color_preview
api_key
exclude_peopletrue
exclude_prompts
opacity1.00
feather_percent0.0
contract_percent0.0
padding_percent0.0
selection_modemerge_all
max_masks6

Here's a failure mode you'll meet the first time you run a full-scene enhancement pass: the Z-Image inpaint happily re-renders the whole room, including the wall outlet, the brand logo on the appliance, and the person standing in the corner - and all of it comes back wrong. The fix isn't a better prompt, it's an exclusion mask: mask the things you want protected, enhance everything else, and composite the original back over the protected zones. Superside Scene Exclusion Mask builds exactly that mask, and it asks you for plain English instead of a brush.

How it works

You give it the image and it segments the things you want to protect using SAM 3 over fal.ai - the same open-vocabulary segmentation behind the pack's region selector. There are two ways to populate the exclusion set:

  • exclude_people (default ON) - adds "person" to the set, so people are never touched by the enhancer.
  • exclude_prompts - a multiline list, one target per line (commas work too). dimmer switch, wall outlet, brand logo - each gets its own SAM 3 call and is merged into one mask.

The merge is governed by selection_mode: merge_all (default) catches every instance - important when there are two switches, not one; largest keeps only the biggest; first the top-scored. max_masks (default 6) caps the per-target count.

Then come the edge controls, and these are worth reading because they're what separate a good mask from a usable one:

  • opacity (default 1.0) - how strongly targets are protected. 1.0 = fully preserve the original there; 0.5 = the composite blends 50% original / 50% enhanced, a partial protect.
  • feather_percent - soften the protected edge so the blend is gradual.
  • contract_percent - erode the mask inward before feathering, so the soft edge stays inside the target instead of bleeding a ring onto surrounding skin or wall.
  • padding_percent - grow the whole merged mask outward after the per-target settings.

Outputs

  • mask (MASK) - the exclusion mask, white where things are protected.
  • info (STRING) - JSON of what was segmented.
  • color_preview (IMAGE) - the mask as a viewable overlay, so you can check what got caught before you commit to a costly edit pass.

Installing it and what it costs

It's in the comfyui-superside-nodes pack - clone, pip install -r requirements.txt, restart, paste your api_key:

cd ComfyUI/custom_nodes
git clone https://github.com/Superside/comfyui-superside-nodes.git
cd comfyui-superside-nodes
pip install -r requirements.txt

The important cost detail: it's one fal call per target, plus the person call. List ten exclusion prompts and that's ten paid SAM 3 calls before you've even run the enhancer. Keep the list tight.

The workflow it feeds

Pair it with Grow Mask With Blur + Image Composite Masked, with source = original, destination = the enhanced image - the README's own recipe. The catch that trips people: the mask nodes downstream must preserve gray for partial opacity to survive to the composite; the pack's Grow Mask With Blur and Resize To Match both do, but a plain mask node that thresholds to binary will silently turn your 50% protect into 100%. And check the color_preview before spending on the edit - SAM 3's open-vocabulary boundaries can miss small or low-contrast targets, and a missed logo will get enhanced right along with the wall.

CategorySuperside

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
api_keySTRING
exclude_peopleoptBOOLEANtrueProtect people from the enhancement (adds 'person' to the exclusion set). Turn OFF to let the enhancer touch people too.
exclude_promptsoptSTRINGPlain-language targets to EXCLUDE (protect), one per line (commas also work). Each is segmented with SAM 3 and merged into the exclusion mask.
opacityoptFLOAT1.000–1How strongly the targets are protected. 1.0 = fully preserve the original there. 0.5 = partial (the composite blends 50% original / 50% enhanced).
feather_percentoptFLOAT0.00–25Soften the protected edge so the composite blends gradually instead of a hard line.
contract_percentoptFLOAT0.00–25Erode the mask inward before feathering, so the soft edge stays inside the target instead of bleeding onto surroundings. Set near/above feather.
padding_percentoptFLOAT0.00–50Grow the whole merged exclusion mask outward by this much (after per-target opacity/feather).
selection_modeoptCOMBOmerge_allPer target: merge_all catches every instance (e.g. two switches); largest keeps only the biggest; first keeps the top-scored.
max_masksoptINT61–32

Outputs (3)

NameTypeDescription
maskMASK
infoSTRING
color_previewIMAGE