
BiRefNet General
Removes the background from a photo and returns the subject on a transparent background, or as a black-and-white mask.
Fine-tunableTEED_EDGE_DETECTIONDraws the edges and fine lines of a picture as a clean edge map, soft or pure black and white, the kind of line map used to guide image generation. Fine-tune it on your own pictures and edge maps.

TEED (Tiny and Efficient Edge Detector) by Xavier Soria Poma, released under the MIT License, Copyright (c) 2022 Xavier Soria Poma.
| Name | Type | Required | Default | Details |
|---|---|---|---|---|
image | file | Yes | — | The picture: PNG, JPEG or WebP, at most 30 MB and 40 megapixels, at least 16 pixels a side. 1–2048 characters · image/png, jpeg, webp |
threshold | number | No | 0.5 | For the binary style: the lowest edge strength (0 to 1) that becomes white; lower keeps more, fainter edges. 0.01–0.99 |
style | text | No | soft | soft: the edge strength as 8-bit gray, white = edge; binary: pure white edges on black, wherever the strength reaches the threshold. Allowed: soft, binary |
Output. Returns PNG image: PNG at the picture's size: the edge map, 8-bit grayscale, white = edge.
Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=TEED_EDGE_DETECTION" \
-H "X-API-Key: kg_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"input": {
"image": "https://example.com/input.png",
"style": "soft",
"threshold": 0.5
},
"outputFormat": "json"
}'
# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
-H "X-API-Key: kg_your_api_key"from kainguru import KainguruClient
with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
submitted = client.executions.execute(
"TEED_EDGE_DETECTION",
{
"image": "https://example.com/input.png",
"style": "soft",
"threshold": 0.5
},
output_format="json",
)
result = client.executions.await_completion(submitted.id)
print(result.execution.output)You can fine-tune TEED Edge Detection on your own data and run the tuned model through the same API. Dataset: One ZIP (at most 4 GB, no password) with 4 to 1000 pictures, an edge map for each and a manifest.jsonl with one {"file", "edges"} line per pair. More rules: Good to know, in the README.
The steps are in the docs.
Price per image: 0.0874 credits ($0.000874). The price is shown again before every run; all prices are on the pricing page.

Removes the background from a photo and returns the subject on a transparent background, or as a black-and-white mask.
Fine-tunable
Finds the clothes a person wears in a photo and returns a mask for the upper body, the lower body and full-body…
Fine-tunable
Splits a picture into its objects and regions, such as people, cars, sky and road, with a label and a mask for each one.
Fine-tunable
Removes the background from a photo with fine detail at hair and edges, and returns the subject on a transparent…
Fine-tunable
Estimates metric depth, surface normals and the camera's field of view from a single photo of any scene, indoors or out.
Fine-tunable
Finds every face in a photo and returns a box around each one with five landmarks, the eyes, the nose tip and the…
Fine-tunable