ComfyUI Node
Person Data Filter
Split PERSON_DATA into a filtered and a remaining set. source: all_detected = every person the selector found (works without reference images); matched_refs = only the reference-matched slots. gate: gender (female/male) via SAM3 'woman'/'man' grounding with InsightFace fallback — or any free SAM3 text prompt, which overrides the gender widget when non-empty. rank: sort_by (area / horizontal / vertical / depth / index) where ascending = smallest, leftmost, topmost, farthest, first. cut: top_n keeps the first N, nth keeps exactly the N-th. Both outputs are re-indexed as fresh reference slots — feed either one directly into a PersonDetailer.
Person Data Filter
- person_data
- images
- sam3_model
- filtered
- remaining
- filtered_masks
- remaining_masks
- preview
- filtered_count
- remaining_count
- report
◄sourceall_detected►
◄genderany►
◄sort_byarea►
◄orderdescending►
◄modetop_n►
◄count1►
◄sam3_prompt►
◄sam3_threshold0.30►
◄min_overlap0.15►
◄det_size640►
◄invertfalse►
CategoryFVM Tools/Face
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| person_data | PERSON_DATA | PERSON_DATA from Person Selector SAM3 / Multi / Data Refiner | |
| source | COMBO | all_detected | all_detected: every person the selector found (per_face_masks). Works even with no reference image connected. matched_refs: only the slots that matched a reference image. |
| gender | COMBO | any | Content gate. 'any' disables it. Ignored when sam3_prompt is filled. |
| sort_by | COMBO | area | Ranking criterion: area - body mask pixel count horizontal - body centroid X vertical - body centroid Y depth - needs depth_map on the selector index - original detection / slot order |
| order | COMBO | descending | ascending = smallest / leftmost / topmost / farthest first. descending = largest / rightmost / bottommost / nearest first. |
| mode | COMBO | top_n | top_n: keep the first `count` after sorting (0 = keep all). nth: keep exactly the `count`-th one (1-based). |
| count | INT | 10–32 | top_n: how many persons to keep (0 = all that pass the gate). nth: which one to keep, 1-based. |
| sam3_prompt | STRING | Free SAM3 text prompt, e.g. 'woman in red dress', 'child', 'person with backpack'. When non-empty it REPLACES the gender criterion. Empty = the gender widget applies. | |
| sam3_threshold | FLOAT | 0.300.05–1 | SAM3 grounding confidence threshold for the gate. |
| min_overlap | FLOAT | 0.150.01–1 | Minimum fraction of a grounded mask that must fall inside a person's body mask before that person counts as a hit. |
| imagesopt | IMAGE | The image(s) the person_data was built from. Needed for the gender / free-text gate and the preview. | |
| sam3_modelopt | SAM3_MODEL_CONFIG | SAM3 model from LoadSAM3Model. Needed for the free-text gate and SAM3-based gender. | |
| det_sizeopt | COMBO | 640 | Face detection resolution for the InsightFace gender fallback. |
| invertopt | BOOLEAN | false | Swap the two outputs — filtered becomes remaining and vice versa. |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| filtered | PERSON_DATA | — |
| remaining | PERSON_DATA | — |
| filtered_masks | MASK | — |
| remaining_masks | MASK | — |
| preview | IMAGE | — |
| filtered_count | INT | — |
| remaining_count | INT | — |
| report | STRING | — |