typefile
{
"image": "https://replicate.delivery/pbxt/MXVMYKMbmDEtKqsegGtgTgmZQAhDRXydmVnt0tRA65Cr8L3H/replicate-prediction-vc34d0cgt9rme0cn57f8qqzp8m.webp",
"instruction": "segment the snowboarder"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DCk**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run bytedance/sa2va-4b-image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"bytedance/sa2va-4b-image:ccf8e58352ce5b2a6cbf5cb68b947ca3bc62009ce66e82071eeae14555414411",
{
input: {
image: "https://replicate.delivery/pbxt/MXVMYKMbmDEtKqsegGtgTgmZQAhDRXydmVnt0tRA65Cr8L3H/replicate-prediction-vc34d0cgt9rme0cn57f8qqzp8m.webp",
instruction: "segment the snowboarder"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DCk**********************************
This is your API token. Keep it to yourself.
import replicate
Run bytedance/sa2va-4b-image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"bytedance/sa2va-4b-image:ccf8e58352ce5b2a6cbf5cb68b947ca3bc62009ce66e82071eeae14555414411",
input={
"image": "https://replicate.delivery/pbxt/MXVMYKMbmDEtKqsegGtgTgmZQAhDRXydmVnt0tRA65Cr8L3H/replicate-prediction-vc34d0cgt9rme0cn57f8qqzp8m.webp",
"instruction": "segment the snowboarder"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DCk**********************************
This is your API token. Keep it to yourself.
Run bytedance/sa2va-4b-image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "bytedance/sa2va-4b-image:ccf8e58352ce5b2a6cbf5cb68b947ca3bc62009ce66e82071eeae14555414411",
"input": {
"image": "https://replicate.delivery/pbxt/MXVMYKMbmDEtKqsegGtgTgmZQAhDRXydmVnt0tRA65Cr8L3H/replicate-prediction-vc34d0cgt9rme0cn57f8qqzp8m.webp",
"instruction": "segment the snowboarder"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 2 properties
Sure, [SEG].<|end|>
{
"id": "688a7frg6nrme0cn5g1a7z9pmr",
"model": "bytedance/sa2va-4b-image",
"version": "ccf8e58352ce5b2a6cbf5cb68b947ca3bc62009ce66e82071eeae14555414411",
"input": {
"image": "https://replicate.delivery/pbxt/MXVMYKMbmDEtKqsegGtgTgmZQAhDRXydmVnt0tRA65Cr8L3H/replicate-prediction-vc34d0cgt9rme0cn57f8qqzp8m.webp",
"instruction": "segment the snowboarder"
},
"logs": "propagate in video: 0%| | 0/1 [00:00<?, ?it/s]\npropagate in video: 100%|██████████| 1/1 [00:00<00:00, 5440.08it/s]",
"output": {
"img": "https://replicate.delivery/xezq/RpmiVeAdOlXML6j7HGw1wkhKR25wt4ArBN8k2DQWkRFuV4IKA/output.png",
"response": "Sure, [SEG].<|end|>"
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-22T04:54:47.605Z",
"started_at": "2025-02-22T04:55:55.804497Z",
"completed_at": "2025-02-22T04:55:56.870658Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/688a7frg6nrme0cn5g1a7z9pmr/cancel",
"get": "https://api.replicate.com/v1/predictions/688a7frg6nrme0cn5g1a7z9pmr",
"web": "https://replicate.com/p/688a7frg6nrme0cn5g1a7z9pmr"
},
"metrics": {
"predict_time": 1.066160757,
"total_time": 69.265658
}
}
