Nodes/ComfyUI-CoachBate/CoachBate H3 Segm Mask (YOLO)
ComfyUI Node

CoachBate H3 Segm Mask (YOLO)

Runs a YOLO segmentation model on the crops from H3 Subject Track + Crop and returns temporally smoothed masks for H3 Subject Stitch Back -> masks. Use with a segm detector (e.g. segm/CockAndBallYolo8x.pt) so the paste follows the real silhouette instead of a rectangle.

By CoachBate·Created 2 months ago·Updated a day ago· 0
CoachBate H3 Segm Mask (YOLO)
  • crops
  • transform
  • refined_crops
  • masks
  • report
◄model▾►
◄confidence0.30►
◄instancebest_overlap►
◄dilation0►
◄temporal_smooth5►
◄mask_sourceunion►
◄detect_scales1.0, 0.7, 0.5, 0.35, 0.25►
◄fallback_shapenone►
CategoryCoachBate/H3

Inputs (11)

NameTypeDefaultDescription
cropsIMAGEThe 'crops' output of H3 Subject Track + Crop - the INPUT crops, not the decoded result. The mask must describe where the subject is in the footage being replaced.
transformH3FACEXFORMFrom H3 Subject Track + Crop. Supplies the tracked rect per frame, used to pick the right instance and as the fallback mask on frames the model misses.
modelCOMBOA YOLO *segmentation* model from models/ultralytics/segm. A bbox-only model produces no masks and every frame falls back to the rect.
confidenceFLOAT0.300.05–0.95—
instanceCOMBObest_overlapWhich detection to keep when the model finds several in a crop. best_overlap: the one whose box overlaps the tracked rect most (the subject the tracker is following). union: all of them. largest: biggest mask area.
dilationINT00–128Grow the mask here, in canvas px. H3 Subject Stitch Back has its own mask_dilation that does the same thing, so leave this at 0 and use that one unless you need growth before temporal smoothing.
temporal_smoothINT51–31Frames of averaging across the mask stack. 1 disables it and the mask edge will shimmer.
mask_sourceCOMBOunionWhich crops the silhouette is traced from. input: the tracker's crops (FaceDetailer's rule - right when the subject keeps its shape). output: the refined crops H3 returned - the NEW silhouette, for a subject the model reshapes or enlarges; with input masking everything it added outside the old outline is cut off. union: both, so neither the old nor the new edge is left behind. output/union need refined_crops connected and fall back to input if it is not.
detect_scalesoptSTRING1.0, 0.7, 0.5, 0.35, 0.25Scales the crop is detected at, best score wins. A segm model trained on medium shots scores a subject filling half the crop near zero; the same crop at half size scores 0.7-0.8. Comma separated, 0.1-1.0.
fallback_shapeoptCOMBOnoneWhat to paste on frames the model finds no silhouette on (input or refined crop). none: nothing - those frames keep their original pixels, which is right when the subject is not actually there yet. ellipse / rect: the tracked box, for detectors that miss frames the subject IS in.
refined_cropsoptIMAGEThe decoded result of the H3 pass (VAEDecode output), same frame count as crops. Used by mask_source output / union.

Outputs (2)

NameTypeDescription
masksMASK—
reportSTRING—