BiRefNet Matting
BiRefNet Matting extends binary segmentation into continuous alpha prediction, enabling smooth transitions for fine structures such as hair, fur, and semi-transparent regions.

API Reference
INTEGRATE
Complete technical specification for integration
RequestResponse
Examples4
CODE
Ready-to-use code snippets for common workflows
remove-background
Fringed Pendant Virtual Staging Cutout$0.0006~6s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:112@9',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/9bea8a4f-009c-4432-8e1a-682ab29e31d2.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/9bea8a4f-009c-4432-8e1a-682ab29e31d2.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "removeBackground",
"taskUUID": "516edb9a-8172-4fe8-9005-c49e9b798921",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/9bea8a4f-009c-4432-8e1a-682ab29e31d2.jpg"
}
}
]'runware run runware:112@9 \
inputs.image=https://assets.runware.ai/assets/inputs/9bea8a4f-009c-4432-8e1a-682ab29e31d2.jpg{
"taskType": "removeBackground",
"taskUUID": "516edb9a-8172-4fe8-9005-c49e9b798921",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/9bea8a4f-009c-4432-8e1a-682ab29e31d2.jpg"
}
}Response
{
"taskType": "imageBackgroundRemoval",
"taskUUID": "516edb9a-8172-4fe8-9005-c49e9b798921",
"imageUUID": "425eb4e4-9ec6-4ba5-ae8e-761dfd8f8b17",
"imageURL": "https://im.runware.ai/image/os/a03d21/ws/5/ii/425eb4e4-9ec6-4ba5-ae8e-761dfd8f8b17.png",
"cost": 0.0006,
"inputImageUUID": "e13e11ed-85ce-48c0-b45f-4b48a0ecbcf8"
}remove-background
Kelp Risograph Exhibit Restyle$0.0006~5s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:112@9',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/0b35d54d-84dc-470f-890e-231d7f61bf9b.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/0b35d54d-84dc-470f-890e-231d7f61bf9b.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "removeBackground",
"taskUUID": "c391eb2b-ed54-4769-b0bc-d0ccb17de6c6",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/0b35d54d-84dc-470f-890e-231d7f61bf9b.jpg"
}
}
]'runware run runware:112@9 \
inputs.image=https://assets.runware.ai/assets/inputs/0b35d54d-84dc-470f-890e-231d7f61bf9b.jpg{
"taskType": "removeBackground",
"taskUUID": "c391eb2b-ed54-4769-b0bc-d0ccb17de6c6",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/0b35d54d-84dc-470f-890e-231d7f61bf9b.jpg"
}
}Response
{
"taskType": "imageBackgroundRemoval",
"taskUUID": "c391eb2b-ed54-4769-b0bc-d0ccb17de6c6",
"imageUUID": "45243d91-7eb0-49a0-8329-aa5c0def3817",
"imageURL": "https://im.runware.ai/image/os/a01d21/ws/5/ii/45243d91-7eb0-49a0-8329-aa5c0def3817.png",
"cost": 0.0006,
"inputImageUUID": "91fdc7b7-12dc-430b-b0cb-78e958c0f181"
}remove-background
Salmon Fly Composite Cutout$0.0006~6s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:112@9',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/d68fab27-4ea8-4d91-b2f9-8ac1e893f9a9.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/d68fab27-4ea8-4d91-b2f9-8ac1e893f9a9.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "removeBackground",
"taskUUID": "280c8066-e71a-4879-945d-2612d03d474f",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/d68fab27-4ea8-4d91-b2f9-8ac1e893f9a9.jpg"
}
}
]'runware run runware:112@9 \
inputs.image=https://assets.runware.ai/assets/inputs/d68fab27-4ea8-4d91-b2f9-8ac1e893f9a9.jpg{
"taskType": "removeBackground",
"taskUUID": "280c8066-e71a-4879-945d-2612d03d474f",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/d68fab27-4ea8-4d91-b2f9-8ac1e893f9a9.jpg"
}
}Response
{
"taskType": "imageBackgroundRemoval",
"taskUUID": "280c8066-e71a-4879-945d-2612d03d474f",
"imageUUID": "0de2f7bf-12b4-4338-a437-c0e5177a605a",
"imageURL": "https://im.runware.ai/image/os/a01d21/ws/5/ii/0de2f7bf-12b4-4338-a437-c0e5177a605a.png",
"cost": 0.0006,
"inputImageUUID": "539d4f8f-2958-4057-80c3-2d1671f9c058"
}remove-background
Glassblower Conference Speaker Headshot Cutout$0.0006~6s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:112@9',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/190d60fe-5bfe-4cc5-ba77-4920f40f6fdb.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/190d60fe-5bfe-4cc5-ba77-4920f40f6fdb.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "removeBackground",
"taskUUID": "b1e3f83b-e734-4168-b041-b98abe7c464c",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/190d60fe-5bfe-4cc5-ba77-4920f40f6fdb.jpg"
}
}
]'runware run runware:112@9 \
inputs.image=https://assets.runware.ai/assets/inputs/190d60fe-5bfe-4cc5-ba77-4920f40f6fdb.jpg{
"taskType": "removeBackground",
"taskUUID": "b1e3f83b-e734-4168-b041-b98abe7c464c",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/190d60fe-5bfe-4cc5-ba77-4920f40f6fdb.jpg"
}
}Response
{
"taskType": "imageBackgroundRemoval",
"taskUUID": "b1e3f83b-e734-4168-b041-b98abe7c464c",
"imageUUID": "f7678718-eb04-47cc-9e3b-173e38ea9f75",
"imageURL": "https://im.runware.ai/image/os/a10dlim3/ws/5/ii/f7678718-eb04-47cc-9e3b-173e38ea9f75.png",
"cost": 0.0006,
"inputImageUUID": "589ed5ad-2f1c-40d2-81a6-7fbe777431aa"
}