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
Examples8
CODE
Ready-to-use code snippets for common workflows
Glassblower Conference Speaker Headshot Cutout

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"
}
}{
"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"
}Fringed Pendant Virtual Staging Cutout

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"
}
}{
"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"
}Kelp Risograph Exhibit Restyle

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"
}
}{
"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"
}Salmon Fly Composite Cutout

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"
}
}{
"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"
}Windblown Violinist With Tulle

import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
outputFormat: 'PNG',
model: 'runware:112@9',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/ba1482d7-22af-4e12-8f82-6d990c877416.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({
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/ba1482d7-22af-4e12-8f82-6d990c877416.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": "93982a70-14e2-4479-938e-4eec589d91ca",
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/ba1482d7-22af-4e12-8f82-6d990c877416.jpg"
}
}
]'runware run runware:112@9 \
outputFormat=PNG \
inputs.image=https://assets.runware.ai/assets/inputs/ba1482d7-22af-4e12-8f82-6d990c877416.jpg{
"taskType": "removeBackground",
"taskUUID": "93982a70-14e2-4479-938e-4eec589d91ca",
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/ba1482d7-22af-4e12-8f82-6d990c877416.jpg"
}
}{
"taskType": "imageBackgroundRemoval",
"taskUUID": "93982a70-14e2-4479-938e-4eec589d91ca",
"imageUUID": "a491d878-0be6-4c73-b9af-1ed94cc89429",
"imageURL": "https://im.runware.ai/image/os/a11d13/ws/4/ii/a491d878-0be6-4c73-b9af-1ed94cc89429.png",
"cost": 0.0006,
"inputImageUUID": "197859c7-e3ad-48f9-b672-07a59cadd11e"
}Feathered Masked Dancer Silhouette

import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
outputFormat: 'PNG',
model: 'runware:112@9',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/e5e6dad7-85b7-450a-910c-2e1cb39c4bfe.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({
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/e5e6dad7-85b7-450a-910c-2e1cb39c4bfe.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": "2fddb7e1-3a59-4038-be65-a4368711fffa",
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/e5e6dad7-85b7-450a-910c-2e1cb39c4bfe.jpg"
}
}
]'runware run runware:112@9 \
outputFormat=PNG \
inputs.image=https://assets.runware.ai/assets/inputs/e5e6dad7-85b7-450a-910c-2e1cb39c4bfe.jpg{
"taskType": "removeBackground",
"taskUUID": "2fddb7e1-3a59-4038-be65-a4368711fffa",
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/e5e6dad7-85b7-450a-910c-2e1cb39c4bfe.jpg"
}
}{
"taskType": "imageBackgroundRemoval",
"taskUUID": "2fddb7e1-3a59-4038-be65-a4368711fffa",
"imageUUID": "ced629b8-3116-4bd7-ab8c-bed4ffbeac39",
"imageURL": "https://im.runware.ai/image/os/a11d13/ws/4/ii/ced629b8-3116-4bd7-ab8c-bed4ffbeac39.png",
"cost": 0.0006,
"inputImageUUID": "176ae8f4-7655-4fee-a042-8cac708efb6d"
}Windblown Violinist on Rooftop

import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
outputFormat: 'PNG',
model: 'runware:112@9',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/40368d91-3c29-4e9e-93e2-84716a70ee19.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({
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/40368d91-3c29-4e9e-93e2-84716a70ee19.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": "37cc2a0c-371b-453f-8c0d-747cb8a43b56",
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/40368d91-3c29-4e9e-93e2-84716a70ee19.jpg"
}
}
]'runware run runware:112@9 \
outputFormat=PNG \
inputs.image=https://assets.runware.ai/assets/inputs/40368d91-3c29-4e9e-93e2-84716a70ee19.jpg{
"taskType": "removeBackground",
"taskUUID": "37cc2a0c-371b-453f-8c0d-747cb8a43b56",
"outputFormat": "PNG",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/40368d91-3c29-4e9e-93e2-84716a70ee19.jpg"
}
}{
"taskType": "imageBackgroundRemoval",
"taskUUID": "37cc2a0c-371b-453f-8c0d-747cb8a43b56",
"imageUUID": "0018dbce-7026-453a-a945-0e34bee42a88",
"imageURL": "https://im.runware.ai/image/os/a24d12/ws/4/ii/0018dbce-7026-453a-a945-0e34bee42a88.png",
"cost": 0.0006,
"inputImageUUID": "b1ca79d4-38e9-475e-9c57-af81b008f764"
}Dandelion-Crowned Afghan Hound

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/1a1c4eaa-9b4e-4e5e-9954-4b528d7f13de.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/1a1c4eaa-9b4e-4e5e-9954-4b528d7f13de.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": "0fbe4051-c02e-4efb-b8bd-66017afe1658",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/1a1c4eaa-9b4e-4e5e-9954-4b528d7f13de.jpg"
}
}
]'runware run runware:112@9 \
inputs.image=https://assets.runware.ai/assets/inputs/1a1c4eaa-9b4e-4e5e-9954-4b528d7f13de.jpg{
"taskType": "removeBackground",
"taskUUID": "0fbe4051-c02e-4efb-b8bd-66017afe1658",
"model": "runware:112@9",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/1a1c4eaa-9b4e-4e5e-9954-4b528d7f13de.jpg"
}
}{
"taskType": "imageBackgroundRemoval",
"taskUUID": "0fbe4051-c02e-4efb-b8bd-66017afe1658",
"imageUUID": "a747914a-879d-45b7-87ad-f5b810bf032f",
"imageURL": "https://im.runware.ai/image/os/a02d21/ws/5/ii/a747914a-879d-45b7-87ad-f5b810bf032f.png",
"cost": 0.0006,
"inputImageUUID": "29b13c9e-bad4-4ae1-b32e-e8db124f5aab"
}