ComfyUI Node
BFS Video Segment Picker (SAM 3)
BFS Video Segment Picker (SAM 3): pick who to replace in a video or in a set of keyframes.
BFS Video Segment Picker (SAM 3)
- image
- sam3_model
- sam3_clip
- normals
- hybrid_base
- pose_keypoint
- molmo_clip
- masks
- marked
- overlay
- report
- hybrid
◄conceptsperson, animal►
◄threshold0.40►
◄max_per_concept8►
◄min_area0.002►
◄mark_color#FF00FF►
◄mark_opacity0.30►
◄selection{}►
◄tracktrue►
◄normals_conventionnormal_directx►
◄mark_stylenormal map (needs normals)►
◄hybrid_grow0.08►
◄strip_frames16►
◄free_afterunload all models from the GPU►
◄pose_regionconvex hull►
◄pose_gray_opacity1.00►
CategoryBFS/Mask
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The frames: the Keyframe Planner's source_frames or a short clip (at most 32). | |
| sam3_model | MODEL | SAM 3.1: MODEL of a Load Checkpoint node with sam3.1_multiplex_fp16.safetensors. | |
| sam3_clip | CLIP | SAM 3.1: CLIP of the same Load Checkpoint node; turns the concepts and Find texts into SAM prompts. | |
| concepts | STRING | person, animal | What the automatic pass looks for, comma separated (one SAM 3 text prompt each), e.g. person, animal, car, chair. Empty = no automatic pass, only what you add. |
| threshold | FLOAT | 0.400.05–0.95 | SAM 3 detection score threshold: lower finds more (and more false hits). |
| max_per_concept | INT | 81–32 | Most objects one concept or text prompt can return. |
| min_area | FLOAT | 0.0020–0.5 | Automatic objects smaller than this share of the image are dropped. |
| mark_color | STRING | #FF00FF | Tint of the selection in the marked output (hex). |
| mark_opacity | FLOAT | 0.300–1 | How strongly the marked output tints the selection (0.3 = the Colored Mark default). |
| selection | STRING | {} | Set by the panel: the selection on each frame. |
| track | BOOLEAN | true | Frames without a selection take the nearest selected frame's mask, tracked with SAM 3. |
| normalsopt | IMAGE | Optional: MoGe normals of the same frames (Run MoGe Inference -> Render MoGe Geometry, a normal mode). With it the node also returns the normal-map hybrid guide. | |
| normals_conventionopt | COMBO | normal_directx | The Render MoGe Geometry output mode the normals come from. |
| hybrid_baseopt | IMAGE | Optional: the hybrid output of another Video Segment Picker, to add this subject on top (one picker per subject). | |
| pose_keypointopt | POSE_KEYPOINT | Optional: DWPose Estimator keypoints of the same frames (body + hands + face), for mark_style 'openpose + face'. | |
| molmo_clipopt | CLIP | Optional: Molmo2 as H3 encoder. It sees the whole video, finds the picked person again after camera cuts (describe -> track) and SAM 3.1 segments them there from Molmo's point. | |
| mark_styleopt | COMBO | normal map (needs normals) | How each subject is drawn in the hybrid output, always in its color: the normal map, the DWPose skeleton with the face, or texture-free alternatives that need no MoGe (flat, blur, pixelate, gray detail, edges). With a style that needs no normals, 'hybrid' works without the normals input. |
| hybrid_growopt | FLOAT | 0.080–0.5 | Margin around the subject in the hybrid guide, relative to its size (normal map: 0.04-0.12; openpose: 0.08-0.18 around the person's convex hull). |
| strip_framesopt | INT | 162–32 | How many frames the panel shows to pick on (SAM segments each one): fewer is faster. |
| free_afteropt | COMBO | unload all models from the GPU | After the node: free the GPU for the next nodes (H3). 'all models' also unloads H3 / the text encoder left from the last generation (they load again when needed). Clearing the caches also frees RAM, but the next run segments and tracks again. Before MoGe / DWPose / Molmo2 run (only on Propagate) every model is unloaded anyway, so a second run does not run out of memory. |
| pose_regionopt | COMBO | convex hull | openpose mark: the gray region around each subject. The convex hull (with hybrid_grow margin) hides the original body shape (the new one stays free); the outline follows the person (less background hidden, but the original silhouette shows). |
| pose_gray_opacityopt | FLOAT | 1.000–1 | openpose mark: how opaque the gray region is (1.0 = fully hidden). Lower lets the background show through, but also the original person (clothes, body), which the result may then copy. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| masks | MASK | One mask per frame: the person to replace. |
| marked | IMAGE | Every frame with the person tinted (mark_color, mark_opacity). |
| overlay | IMAGE | The strip frames with all objects found, numbered. |
| report | STRING | JSON per frame: picked by hand, tracked from frame N, or empty. |
| hybrid | IMAGE | With normals: the frames (or hybrid_base) with this subject drawn as its tinted normal map; else hybrid_base or the frames. |