🐳YOLOv11智能裁剪
The newer detector with auto-download and real inference knobs
- image
- 裁剪图像
- 遮罩
- 边界框
- 检测信息
- 检测数量
- 平均置信度
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, ormps(macOS). Defaultautois right for most people; forcecpuif 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.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model_name | COMBO | yolo11n.pt (需下载) | 5 options: yolo11n.pt (需下载), yolo11s.pt (需下载), yolo11m.pt (需下载), yolo11l.pt (需下载), yolo11x.pt (需下载) |
| device | COMBO | auto | 4 options: auto, cpu, cuda, mps |
| confidence | FLOAT | 0.250–1 | — |
| iou_threshold | FLOAT | 0.450–1 | — |
| imgsz | INT | 640320–1280 | — |
| max_det | INT | 3001–1000 | — |
| class_filter | STRING | 全部 | 要检测的类别,用逗号分隔(如:人,汽车)或'全部'检测所有 |
| square_size | FLOAT | 10010–200 | 基于检测对象大小的百分比调整 |
| object_margin | FLOAT | 1.51–3 | 在检测对象周围添加的额外边距系数 |
| vertical_offset | FLOAT | 0-50–50 | — |
| horizontal_offset | FLOAT | 0-50–50 | — |
| sort_by | COMBO | 从左到右 | 9 options: 默认, 从左到右, 从右到左, 从上到下, 从下到上, 置信度降序, +3 |
| crop_mode | COMBO | 全部对象 | 4 options: 全部对象, 单个对象, 按类别, 批量处理 |
| object_index | INT | 00–100 | — |
| augment | BOOLEAN | false | — |
| agnostic_nms | BOOLEAN | false | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| 裁剪图像 | IMAGE | — |
| 遮罩 | MASK | — |
| 边界框 | BBOXES | — |
| 检测信息 | STRING | — |
| 检测数量 | INT | — |
| 平均置信度 | FLOAT | — |