RM Multi-Detect & Crop
Detect with several models at once and crop every hit
- image
- cropped_region
- region_data
- region_count
RMFaceDetectCrop runs one YOLO model and crops every face. RMMultiDetectCrop is the generalization: run several detection models on the same image - a face model and a hand model and a person model - each with its own confidence threshold, merge all the detections into one flat list, and crop every single hit for downstream processing. If your workflow fixes more than just faces, this is the node that means one detect step instead of three parallel ones.
How it works
The node runs each configured BBOX model over the image once and collects every bounding box above that model's threshold, dropping anything smaller than drop_size. All detections - regardless of which model found them - are merged into one list, then each region goes through the same expansion pipeline as the face node: crop_factor expansion around the box, dilation on the mask, and scaling to roughly megapixels MP.
The models are dynamic inputs, added with an Add BBOX button (the same frontend pattern as the pack's LoRA loader). Each entry is a {on, model, threshold} dict, so you toggle models on and off and set per-model confidence without touching anything else. The output uses OUTPUT_IS_LIST, so every detected region flows independently through the downstream nodes - each crop gets its own encode, its own sampler pass. region_data is the same RM_FACE_DATA structure the face node emits (yes, the type is still called "face data" even though it now holds hands, bodies, whatever - the author reused the type), so it composites back with the pack's RMFaceComposite.
Inputs and outputs that matter
- image (IMAGE, required)
- dilation (default 10), crop_factor (default 1.5), drop_size (default 10), megapixels (default 1.0) - the shared crop settings.
- Dynamic BBOX inputs - one per model, with its own model picker and threshold.
- Outputs: cropped_region (IMAGE, list), region_data (RM_FACE_DATA), region_count (INT).
How to install it
cd ComfyUI/custom_nodes
git clone https://github.com/Moser9815/ComfyUI-RMAutomation
pip install ultralytics opencv-python
Then drop your YOLO .pt models into ComfyUI/models/ultralytics/bbox/ and restart. The pack ships no models. Remember opencv-python is imported at module level, so without it the entire pack fails to load.
Common issues
No detections from any model prints when a configured model returns nothing - either the model file is missing from ultralytics/bbox, or its threshold is set too high for your image. The dynamic inputs are easy to forget about: if region_count is 0, check that at least one BBOX entry is switched on and isn't pointing at "none". Detection quality is only as good as your models - a generic face model crammed into a multi-detect for hands will silently find nothing, so pair each model with the threshold it actually needs. And keep drop_size sane: a tiny value means every spurious detection becomes a crop that runs through your whole refinement pipeline, costing time on garbage.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| dilation | INT | 10-512–512 | — |
| crop_factor | FLOAT | 1.51–10 | — |
| drop_size | INT | 101–8192 | — |
| megapixels | FLOAT | 1.00.1–16 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| cropped_region | IMAGE | — |
| region_data | RM_FACE_DATA | — |
| region_count | INT | — |