AV ComfyUI Manual
46 / 64
Files
46
MASK CHAIN

Florence2 → SAM2 → grow → blur

Segmentation finds people and related classes, turns bbox / points into a SAM2 mask, expands the edge and softens it before crop and composite.

CONFIRMEDNodes 550, 114, 115, 144 and 146 form a continuous chain
MASK PIPELINE

Detection, refinement and a softened edge

780Resize1920 × 1920
550Florence2detect classes
114Coordinatesbbox → points
115SAM2multi-BBOX · objects ON
144Grow+5 px
146Blur10 · auto
420Cropperson region
figure retained background excluded feathered edge
01 · DETECTION

Florence2 searches for more than “person”

Node 550 runs caption_to_phrase_grounding at size 1024. The saved class list contains people, human, face, hand, feet, shoe, leg, bag, backpack, pet, dog, cat, gun, animal.

The broad list can help capture figure details and carried objects, but it can also pull an unrelated nearby object into the mask.

02 · MASK

Edge-processing sequence

NodeOperationCurrent value / output
550Florence2RunDetection result + data
114Florence2toCoordinatesCoordinates for SAM2
115Sam2SegmentationMask output
144GrowMask5 px, tapered = true
146MaskBlur+10, auto
420easy imageCropFromMaskPerson-region crop
500 → 499MaskToImage → Separate Mask ComponentsIndependent components for inpaint
03 · CONFIRMED RUNTIME

One canvas + individual_objects = ON produces the full group mask

A runtime check on 2026-09-07 confirmed the full Florence2 → BBOX → SAM2 route on a 1280 × 720 test image containing six people. Florence2 and SAM2 must receive the same image: coordinates computed on another size or frame produce displaced or false masks.

In the installed ComfyUI-segment-anything-2 version, BBOX indices 0,1,2,3,4,5 produced the full group mask only with individual_objects = ON. With OFF, the node returned one silhouette even though Florence2 showed boxes for all people.

CONFIRMED

Six-person mask

The test produced a combined foreground mask for all six people and a correct inverted protect mask.

NOT CONFIRMED

Final scene composite

The test confirms detection/segmentation but does not yet prove the cutout through positioning, selector and final output.

CheckConfirmed valueFailure symptom
Image contractFlorence2 image = SAM2 image = 1280 × 720Mask lands on a building, corner or empty area
Florence generationnum_beams 3 · do_sample OFFUnstable boxes and changing indices
BBOX selectionindex 0,1,2,3,4,5Only one object or the wrong object is selected
SAM2 multi-objectindividual_objects ONOFF leaves only one silhouette
Mask cleanupThreshold 0.30 in the testThreshold is refined against clothing/limb edges
04 · VISUAL QA

What counts as a usable mask

  • The white silhouette covers the whole figure, including feet and small objects that must remain.
  • There are no large holes inside the body or isolated islands far from the figure.
  • The edge does not cut off arms, feet or headwear.
  • Grow 5 and blur 10 do not create an obvious halo against a high-contrast background.
CONFIRMED

No active InvertMask

No separate explicit InvertMask node is present in this branch.

NOT CONFIRMED

Hidden inversion

Internal polarity behavior of third-party nodes cannot be established from the workflow JSON alone.