Remove background from this image
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate"; 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
import replicate
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.
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.
{ "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" }
View more examples
This model runs on Nvidia T4 GPU hardware. We don't yet have enough runs of this model to provide performance information.
This model doesn't have a readme.
flux_schnell model img2img inference
flux dev
This model is cold. You'll get a fast response if the model is warm and already running, and a slower response if the model is cold and starting up.
Choose a file from your machine
Hint: you can also drag files onto the input