Nodes/comfy_Pond_Nodes/🐳YOLOv11智能裁剪
ComfyUI Node

🐳YOLOv11智能裁剪

The newer detector with auto-download and real inference knobs

By Pondowner857·Created about a year ago·Updated 21 days ago· 45
🐳YOLOv11智能裁剪
  • image
  • 裁剪图像
  • 遮罩
  • 边界框
  • 检测信息
  • 检测数量
  • 平均置信度
model_nameyolo11n.pt (需下载)
deviceauto
confidence0.25
iou_threshold0.45
imgsz640
max_det300
class_filter全部
square_size100
object_margin1.5
vertical_offset0
horizontal_offset0
sort_by从左到右
crop_mode全部对象
object_index0
augmentfalse
agnostic_nmsfalse

YOLOv11 Smart Crop (🐳YOLOv11智能裁剪) is the crop node for the current generation of Ultralytics models. Same detect-and-crop job as the pack's v8 version, but aimed at YOLO11 weights (yolo11n/s/m/l/x), and with two real upgrades: the model can auto-download, and you get actual inference controls instead of just a confidence slider. If you're starting fresh and don't have a YOLOv8 model lying around, this is the one to use.

The model handling is the headline convenience. The model_name dropdown lists yolo11n.pt through yolo11x.pt (all marked "需下载" / "needs download"), and if you pick one that isn't in ComfyUI/models/yolo/ yet, the node hands the name to Ultralytics, which fetches it automatically. That's a nice touch - no manual hunting for weights. Anything with "yolo11" in the filename that you drop into the models folder also appears in the dropdown.

Then the inference knobs, which are the real Ultralytics predict() parameters exposed as inputs:

  • device - auto, cpu, cuda, or mps (macOS). Default auto is right for most people; force cpu if you're out of VRAM and want it to just run.
  • iou_threshold (default 0.45) - how much overlap two detections need before NMS merges them. Lower it if you're getting double-boxes on the same object.
  • imgsz (320-1280, default 640) - the inference resolution. Bigger is more accurate but slower and thirstier.
  • max_det (default 300) - cap on detections per image, mainly a safety valve for crowds.
  • augment - test-time augmentation; slower, marginally better accuracy.
  • agnostic_nms - class-agnostic non-max suppression, if you want overlapping classes to compete properly.

Everything else carries over from the v8 node: confidence, class_filter (comma-separated classes or 全部), the crop-shaping trio of square_size / object_margin / vertical_offset + horizontal_offset, the nine-way sort_by, crop_mode (now with a 批量处理 batch mode in addition to all/single/per-class), and object_index.

Outputs mirror the v8 crop node - 裁剪图像 (IMAGE list), 遮罩 (MASK), 边界框 (BBOXES), 检测信息 (STRING), 检测数量 (INT) - plus one bonus: 平均置信度 (average confidence, FLOAT), handy if you want to log detection quality or gate downstream steps on it. The BBOXES output feeds the pack's V11 paste node to complete the loop.

Honest note on "improved detection performance": YOLO11 is a real, newer architecture and Ultralytics' default weights, but for the ComfyUI use case - cropping faces and people for detailer loops - the practical difference from a good YOLOv8 model is small. The auto-download and device control are the actual reasons to reach for this one. Same AGPL-3.0 licensing caveat as all Ultralytics work, which matters if you ship anything commercial.

Install

Part of Pond Nodes:

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

Restart after (or Manager → "comfy_Pond_Nodes"). Needs ultralytics>=8.2.0 (in requirements; the code checks for it) and, if you don't auto-download, a yolo11 model in ComfyUI/models/yolo/. Pack caveat: console spam if comfyui_HiDream-Sampler is installed alongside.

Category🐳Pond/yolo

Inputs (17)

NameTypeDefaultDescription
imageIMAGE
model_nameCOMBOyolo11n.pt (需下载)5 options: yolo11n.pt (需下载), yolo11s.pt (需下载), yolo11m.pt (需下载), yolo11l.pt (需下载), yolo11x.pt (需下载)
deviceCOMBOauto4 options: auto, cpu, cuda, mps
confidenceFLOAT0.250–1
iou_thresholdFLOAT0.450–1
imgszINT640320–1280
max_detINT3001–1000
class_filterSTRING全部要检测的类别,用逗号分隔(如:人,汽车)或'全部'检测所有
square_sizeFLOAT10010–200基于检测对象大小的百分比调整
object_marginFLOAT1.51–3在检测对象周围添加的额外边距系数
vertical_offsetFLOAT0-50–50
horizontal_offsetFLOAT0-50–50
sort_byCOMBO从左到右9 options: 默认, 从左到右, 从右到左, 从上到下, 从下到上, 置信度降序, +3
crop_modeCOMBO全部对象4 options: 全部对象, 单个对象, 按类别, 批量处理
object_indexINT00–100
augmentBOOLEANfalse
agnostic_nmsBOOLEANfalse

Outputs (6)

NameTypeDescription
裁剪图像IMAGE
遮罩MASK
边界框BBOXES
检测信息STRING
检测数量INT
平均置信度FLOAT