Nodes/ComfyUI-BrainDead/BD Mask Batch Index
ComfyUI Node

BD Mask Batch Index

Extract one mask by 0-based index from a mask batch (N,H,W). Bridges SAM3 per_prompt_masks → single-mask inputs on BD_PackChannels, BD_RemoveBackground, etc. Negative indices count from the end.

By BizaNator·Created 7 months ago·Updated 16 days ago· 14
BD Mask Batch Index
  • masks
  • mask
  • info
index0
invertfalse
Category🧠BrainDead/Segmentation

Inputs (3)

NameTypeDefaultDescription
masksMASKMask batch (N,H,W) — e.g. per_prompt_masks from BD_SAM3MultiPrompt.
indexINT0-64–640-based index of the mask to extract. Negative counts from end. Clamped to [0, N-1] if out of range.
invertoptBOOLEANfalseInvert the selected mask before output.

Outputs (2)

NameTypeDescription
maskMASKSingle (1,H,W) mask at the selected index.
infoSTRING'index/total' — e.g. '2/5' confirms which mask was selected.