b90337dc87d8240584f3cf039beb4c8dc11fdbb1
Add Qwen2.5-VL detection node
ComfyUI Qwen2.5-VL Object Detection Node
This repository provides a custom ComfyUI node for running object detection with the Qwen 2.5 VL model. The node downloads the selected model on demand, runs a detection prompt and outputs bounding boxes that can be used with segmentation nodes such as SAM2.
Nodes
DownloadAndLoadQwenModel
Downloads a chosen Qwen 2.5-VL model into models/Qwen and returns the loaded model and processor.
QwenVLDetection
Runs a detection prompt on an input image using the loaded model. The node outputs the raw text response and the bounding box coordinates.
The bounding boxes are converted to absolute pixel coordinates so that they can be directly fed into the SAM2 nodes.
Usage
- Place the
qwen_vl_comfyfolder inside yourComfyUI/custom_nodesdirectory. - From the Download and Load Qwen2.5-VL Model node, select the model you want to use. It will be downloaded automatically if not present.
- Connect the output model to Qwen2.5-VL Object Detection, provide an image and a prompt like
Locate the cat and output its bbox coordinates in JSON format. - Feed the resulting bounding boxes into the SAM2 workflow for further processing.
Languages
Python
100%