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.
moonpig /dis-background-removal:85045bfc
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";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run moonpig/dis-background-removal using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"moonpig/dis-background-removal:85045bfc27d832efcc5f07ae57110246919d595c441d0036d058ec6221650b87",
{
input: {
images: ["https://replicate.delivery/pbxt/MW6ClsSPWSCkLwedMooddfLtWsTBtfYLtz1OFRzisZWsLP9p/bee.png"]
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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 moonpig/dis-background-removal using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"moonpig/dis-background-removal:85045bfc27d832efcc5f07ae57110246919d595c441d0036d058ec6221650b87",
input={
"images": ["https://replicate.delivery/pbxt/MW6ClsSPWSCkLwedMooddfLtWsTBtfYLtz1OFRzisZWsLP9p/bee.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 moonpig/dis-background-removal 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": "moonpig/dis-background-removal:85045bfc27d832efcc5f07ae57110246919d595c441d0036d058ec6221650b87",
"input": {
"images": ["https://replicate.delivery/pbxt/MW6ClsSPWSCkLwedMooddfLtWsTBtfYLtz1OFRzisZWsLP9p/bee.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-02-17T20:44:08.079167Z",
"created_at": "2025-02-17T20:44:07.468000Z",
"data_removed": false,
"error": null,
"id": "4tyd60k7nhrgc0cn2pkv6f9fb4",
"input": {
"images": [
"https://replicate.delivery/pbxt/MW6ClsSPWSCkLwedMooddfLtWsTBtfYLtz1OFRzisZWsLP9p/bee.png"
]
},
"logs": "Preprocessing took 0.034 seconds\nInference took 0.144 seconds\nPost processing took 0.231 seconds\nTotal time: 0.409 seconds",
"metrics": {
"predict_time": 0.59625028,
"total_time": 0.611167
},
"output": [
"https://replicate.delivery/czjl/XyZS3NfGDZXGWqBhs5O0x6jXAokPiXQKyj7xjBeBrsdYGVQUA/output.png"
],
"started_at": "2025-02-17T20:44:07.482916Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/fddq-mev5o7rodgymxhsbal6nwqfz2qrg4fzzwbpc3mtwqmyckzuecafq",
"get": "https://api.replicate.com/v1/predictions/4tyd60k7nhrgc0cn2pkv6f9fb4",
"cancel": "https://api.replicate.com/v1/predictions/4tyd60k7nhrgc0cn2pkv6f9fb4/cancel"
},
"version": "85045bfc27d832efcc5f07ae57110246919d595c441d0036d058ec6221650b87"
}
Preprocessing took 0.034 seconds
Inference took 0.144 seconds
Post processing took 0.231 seconds
Total time: 0.409 seconds