DINO-X Object Detector
Object detection and masks, straight from the cloud
- image
- box_annotated
- binary_mask
Let's get the first thing out of the way, because it changes everything about how you use this node: DINO-X is not a local model. It's ByteDance's detection API, and this node is a thin wrapper that sends your image to the cloud and waits. No VRAM, no model downloads, no weights on your disk - and also no image privacy, and a token you have to go beg for. If that still sounds like your kind of deal, it's a genuinely slick way to get open-vocabulary detection and segmentation masks from one text prompt.
What it actually does
You feed it an image and a list of objects like "wheel . eye . helmet", and it comes back with two things: the image with bounding boxes and labels drawn on, and a binary mask of everything it found. That's the classic GroundingDINO-then-SAM pipeline (text prompt → boxes → masks) collapsed into a single node - the same targeted-masking trick the background-removal crowd uses before inpainting or compositing, just without any of the local dependency weight. Where the fully-local route needs ComfyUI-RMBG or Impact Pack's SAM detectors plus a few GB of weights, this needs only an API key and a network connection.
How it works
The node converts your tensor to a JPEG, uploads it to the DINO-X API via the dds-cloudapi-sdk, and runs a DinoxTask with your prompt and threshold. The API answers with boxes and run-length-encoded masks, which the node decodes, draws over with supervision's box and label annotators, and ORs together into one mask. One nice touch in the source: IS_CHANGED returns NaN, so the node never caches and always re-runs. That's deliberate - API results can differ run to run, and you want to see every one of the credits you're paying for.
The inputs that matter
- api_token - non-negotiable. Get it from the DeepDataSpace apply-token page. Empty token is rejected before anything runs.
- text_prompt - the objects, separated by dots, not commas. The default is
"wheel . eye . helmet . mouse . mouth . vehicle . steering wheel . ear . nose". - bbox_threshold - detection confidence, 0 to 1, default 0.25. Lower catches more with more junk, higher is cleaner.
- image - one gotcha: the code only reads the first frame of a batch, so don't feed it multiple images expecting a sweep.
Where people get burned: type "person, car, dog" like a normal text prompt and the node will crash with a KeyError, because the code splits on . and then looks each detected category up in the resulting dict. Dots. Every time.
Outputs
- box_annotated (IMAGE) - the scene with boxes and
class 0.92-style labels. Wire it to PreviewImage or SaveImage. - binary_mask (MASK) - the union of all detected objects. This is the one you'll actually reach for: feed it to an inpainting node to remove or replace a named object, exactly the automated-pipeline path the KB describes for SAM/GroundingDINO. If nothing is found, you get the original image and an empty mask - handled gracefully rather than erroring.
Install
ComfyUI Manager (search "DINO-X") or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/Style-Mosaic/dino-x-comfyui-node
cd dino-x-comfyui-node
pip install -e .
The README's own clone URL is a placeholder (yourusername/comfyui-dinox-detector) - ignore it, use the one above. Dependencies are dds-cloudapi-sdk, supervision, opencv-python, numpy, Pillow. There are no model files to download; the only "download" is the API token.
The fine print
Your image leaves your machine and lands on ByteDance's servers, so don't route anything you can't afford to leak through it. The API is freemium - a small free allowance, then paid - which matters because the node deliberately never caches. And if your instinct is "free local, or paid cloud?" - the local alternative exists and is well-trodden, but it costs VRAM and a download. This node is the trade-back the other way: no GPU cost, cloud cost instead.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| text_prompt | STRING | wheel . eye . helmet . mouse . mouth . vehicle . steering wheel . ear . nose | — |
| api_token | STRING | — | |
| bbox_threshold | FLOAT | 0.250–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| box_annotated | IMAGE | — |
| binary_mask | MASK | — |