typefile
{
"mask_image": "https://replicate.delivery/pbxt/KOcrnJnDUKyUiAVRvfRE3MoxHUMgkGMJr9QbHPBQfUM7w3x0/data_mask.png",
"org_image": "https://replicate.delivery/pbxt/KOcrnMbsQViY6fhLhhf1UfbLukBlQbOJrTo3OCb2dZkHD7Xn/data.png"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_9yF**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run codeplugtech/object_remover using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"codeplugtech/object_remover:499559d430d997c34aa80142bfede2ad182b78e9dda9e8e03be5689d99969282",
{
input: {
mask_image: "https://replicate.delivery/pbxt/KOcrnJnDUKyUiAVRvfRE3MoxHUMgkGMJr9QbHPBQfUM7w3x0/data_mask.png",
org_image: "https://replicate.delivery/pbxt/KOcrnMbsQViY6fhLhhf1UfbLukBlQbOJrTo3OCb2dZkHD7Xn/data.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=r8_9yF**********************************
This is your API token. Keep it to yourself.
import replicate
Run codeplugtech/object_remover using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"codeplugtech/object_remover:499559d430d997c34aa80142bfede2ad182b78e9dda9e8e03be5689d99969282",
input={
"mask_image": "https://replicate.delivery/pbxt/KOcrnJnDUKyUiAVRvfRE3MoxHUMgkGMJr9QbHPBQfUM7w3x0/data_mask.png",
"org_image": "https://replicate.delivery/pbxt/KOcrnMbsQViY6fhLhhf1UfbLukBlQbOJrTo3OCb2dZkHD7Xn/data.png"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_9yF**********************************
This is your API token. Keep it to yourself.
Run codeplugtech/object_remover 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": "codeplugtech/object_remover:499559d430d997c34aa80142bfede2ad182b78e9dda9e8e03be5689d99969282",
"input": {
"mask_image": "https://replicate.delivery/pbxt/KOcrnJnDUKyUiAVRvfRE3MoxHUMgkGMJr9QbHPBQfUM7w3x0/data_mask.png",
"org_image": "https://replicate.delivery/pbxt/KOcrnMbsQViY6fhLhhf1UfbLukBlQbOJrTo3OCb2dZkHD7Xn/data.png"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "jvadfbdbvejgcx7yq72aef7mxi",
"model": "codeplugtech/object_remover",
"version": "499559d430d997c34aa80142bfede2ad182b78e9dda9e8e03be5689d99969282",
"input": {
"mask_image": "https://replicate.delivery/pbxt/KOcrnJnDUKyUiAVRvfRE3MoxHUMgkGMJr9QbHPBQfUM7w3x0/data_mask.png",
"org_image": "https://replicate.delivery/pbxt/KOcrnMbsQViY6fhLhhf1UfbLukBlQbOJrTo3OCb2dZkHD7Xn/data.png"
},
"logs": "",
"output": "https://replicate.delivery/pbxt/PeUSD8TLKs0lXSTavj96kkOSfpoAKhRIG8LY5U0erX53QgskA/in-painted.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-02-13T11:18:46.638425Z",
"started_at": "2024-02-13T11:18:46.675061Z",
"completed_at": "2024-02-13T11:18:52.878584Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/jvadfbdbvejgcx7yq72aef7mxi/cancel",
"get": "https://api.replicate.com/v1/predictions/jvadfbdbvejgcx7yq72aef7mxi"
},
"metrics": {
"predict_time": 6.203523,
"total_time": 6.240159
}
}

