Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
lightweight-ai /test_bgrem:92a9a781
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lightweight-ai/test_bgrem using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lightweight-ai/test_bgrem:92a9a78104861948211c7ace8dd671a424d712c0a8e335937262ad49df5b1f76",
{
input: {
image: "https://replicate.delivery/pbxt/MK89YZGY5050parhZUeSPLGncmiMk2AuQ6LNAygeh95Aw7vi/u6363347132_an_orc_heavily_armored_using_a_mace_and_shield_in_76f1e963-b17b-4fa1-ac23-93f53d8a41ef_3.png"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run lightweight-ai/test_bgrem using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lightweight-ai/test_bgrem:92a9a78104861948211c7ace8dd671a424d712c0a8e335937262ad49df5b1f76",
input={
"image": "https://replicate.delivery/pbxt/MK89YZGY5050parhZUeSPLGncmiMk2AuQ6LNAygeh95Aw7vi/u6363347132_an_orc_heavily_armored_using_a_mace_and_shield_in_76f1e963-b17b-4fa1-ac23-93f53d8a41ef_3.png"
}
)
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=<paste-your-token-here>
Find your API token in your account settings.
Run lightweight-ai/test_bgrem 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": "lightweight-ai/test_bgrem:92a9a78104861948211c7ace8dd671a424d712c0a8e335937262ad49df5b1f76",
"input": {
"image": "https://replicate.delivery/pbxt/MK89YZGY5050parhZUeSPLGncmiMk2AuQ6LNAygeh95Aw7vi/u6363347132_an_orc_heavily_armored_using_a_mace_and_shield_in_76f1e963-b17b-4fa1-ac23-93f53d8a41ef_3.png"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2025-01-15T03:30:08.731274Z",
"created_at": "2025-01-15T03:29:32.805000Z",
"data_removed": false,
"error": null,
"id": "4g23j1twgnrmc0cmd01ag4jydr",
"input": {
"image": "https://replicate.delivery/pbxt/MK89YZGY5050parhZUeSPLGncmiMk2AuQ6LNAygeh95Aw7vi/u6363347132_an_orc_heavily_armored_using_a_mace_and_shield_in_76f1e963-b17b-4fa1-ac23-93f53d8a41ef_3.png"
},
"logs": null,
"metrics": {
"predict_time": 4.734080652,
"total_time": 35.926274
},
"output": "https://replicate.delivery/xezq/pGsieZwDNHUSaiA6MBzdZgPyBrfkHfDEPfvkSPy4tGEBc3UQB/output.png",
"started_at": "2025-01-15T03:30:03.997194Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/bcwr-kjjh7inlv64vnkdfpy4iizth3oduvck6iip2d7varwpktf3zns6q",
"get": "https://api.replicate.com/v1/predictions/4g23j1twgnrmc0cmd01ag4jydr",
"cancel": "https://api.replicate.com/v1/predictions/4g23j1twgnrmc0cmd01ag4jydr/cancel"
},
"version": "92a9a78104861948211c7ace8dd671a424d712c0a8e335937262ad49df5b1f76"
}