ComfyUI Node

GD BBox Detect

Text-prompt person detection that actually feeds SDPose

By user2318·Created 4 months ago·Updated about a month ago· 56
GD BBox Detect
  • gd_model
  • image
  • bboxes
  • preview_images
  • preview_info
promptperson .
threshold0.30
modepass_all
strategylargest
index0
regionall
batch_size4
preview_count5

GroundingDINO is genuinely good at one thing: "find the thing I just described in words" - and for pose work, that's "find the person." GD BBox Detect wraps that into a single node that detects, filters, and hands you clean bounding boxes plus a visual preview. It's the middle link of the pack's pose chain: GD_ModelLoader → this → the official SDPose processor.

The node exists because raw detector output is messy. A video frame often has three "person" boxes, and the official SDPoseOODProcessor wants the person. So detection is only half the story - the rest is the mode/strategy filtering that decides which box survives:

  • pass_all - keep everything the detector found. For a single-subject clip this is often fine.
  • by_area - keep the largest or smallest box per frame (strategy: largest/smallest/highest_score). Right for "the main character is always the biggest person on screen."
  • by_position - keep only boxes in a region (left_half, right_half, center_third, top_half, bottom_half). Good when your subject is predictably on one side.
  • track - pick the biggest person on the first frame, then follow that same subject across frames. The one to use when your main character isn't always the biggest.
  • by_index - pick the Nth detected box. The author warns it's unstable across frames, so this is really for single-frame debugging.

The inputs that matter

  • gd_model - from GD_ModelLoader. Required.
  • image - your frame batch.
  • prompt - default "person ." (note the trailing period; GroundingDINO wants full stop-delimited phrases). You can get fancy: "man in red shirt", "person wearing glasses".
  • threshold - confidence cutoff, default 0.3. Lower catches more with more false positives; raise it if you're tracking a stray "person" that isn't one.
  • batch_size - frames per inference batch. The tooltip has real VRAM guidance: 4GB→1, 6GB→2, 8GB→4 (default), 12GB+→8-16. This is a GPU memory dial first, a speed dial second.
  • preview_count - how many frames get previewed. Doesn't affect filtering.

Outputs: bboxes (a BOUNDING_BOX list for SDPoseOODProcessor), preview_images (frames with boxes drawn, so you can eyeball whether detection worked), and preview_info (a string summary). The preview outputs are the sanity check that saves you from piping garbage into a 20-minute pose pass.

Install

Part of user2318/ComfyUI-CustomNodeKit. ComfyUI Manager: search "CustomNodeKit". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt

Make sure groundingdino-py and transformers are installed (the pack's install.py attempts it automatically). The GroundingDINO weights auto-download on first use via GD_ModelLoader - about 700MB for SwinT.

The gotcha

Watch the preview before you commit. The three silent failure modes are all visible in preview_images: a threshold too high gives you no boxes at all (output degrades to empty), a prompt that's too clever returns boxes for the wrong thing, and a multi-person clip with by_area + largest will happily track the wrong person when the main character is small in frame. When a pose animation looks like it's following the background dancer, this node - not SDPose - is where the mistake lives. Check the preview once, and track mode will save you the repeat.

CategorySDPose/GD

Inputs (10)

NameTypeDefaultDescription
gd_modelGD_MODEL
imageIMAGE
promptSTRINGperson .
thresholdFLOAT0.300–1置信度阈值。越高越精确但可能漏检;越低检测越多但可能有误检。Confidence threshold. Higher values are more accurate but may miss detections; lower values detect more but may include false positives.
modeCOMBOpass_allpass_all=保留全部 | by_area=按面积选最大/最小 | by_position=按区域选 | track=跨帧追踪 | by_index=按索引选。pass_all=keep all | by_area=select largest/smallest by area | by_position=select by region | track=cross-frame tracking | by_index=select by index.
strategyCOMBOlargestlargest=面积最大的 | smallest=面积最小的 | highest_score=置信度最高的(仅by_area/by_position模式有效)。largest=largest area | smallest=smallest area | highest_score=highest confidence (only effective in by_area/by_position mode).
indexINT0-1–100by_index模式下选择第几个bbox(0=第一个,-1=最后一个)。注意:视频帧间索引可能不稳定。Select bbox by index in by_index mode (0=first, -1=last). Note: index may be unstable across video frames.
regionCOMBOallby_position模式下筛选区域:left_half=左半侧 | right_half=右半侧 | center_third=中间1/3 | top_half=上半 | bottom_half=下半。Filter region in by_position mode: left_half | right_half | center_third | top_half | bottom_half.
batch_sizeINT41–64每批处理的帧数。减小以节省显存:4GB显存→1, 6GB→2, 8GB→4(默认), 12GB+→8~16。Frames per batch. Reduce to save VRAM: 4GB→1, 6GB→2, 8GB→4(default), 12GB+→8~16.
preview_countINT51–20预览帧数。自动选首帧+bbox最多帧+末帧+等间隔补足,不影响实际筛选结果。Preview frame count. Auto-selects first frame + frames with most bboxes + last frame + evenly spaced fill, does not affect actual filtering results.

Outputs (3)

NameTypeDescription
bboxesBOUNDING_BOX
preview_imagesIMAGE
preview_infoSTRING