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.
tmappdev /img2watermarkmask:26e60527
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 tmappdev/img2watermarkmask using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tmappdev/img2watermarkmask:26e6052742b519144681a9070f7cb4964ad19051bf40056c7a254d4869ade10f",
{
input: {
image: "https://replicate.delivery/pbxt/M1T9TkwjQLMURzACOs72BiRVKs5paTuqJEi1kAMqUxvSRFP6/out-0-12.webp"
}
}
);
// 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 tmappdev/img2watermarkmask using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tmappdev/img2watermarkmask:26e6052742b519144681a9070f7cb4964ad19051bf40056c7a254d4869ade10f",
input={
"image": "https://replicate.delivery/pbxt/M1T9TkwjQLMURzACOs72BiRVKs5paTuqJEi1kAMqUxvSRFP6/out-0-12.webp"
}
)
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 tmappdev/img2watermarkmask 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": "tmappdev/img2watermarkmask:26e6052742b519144681a9070f7cb4964ad19051bf40056c7a254d4869ade10f",
"input": {
"image": "https://replicate.delivery/pbxt/M1T9TkwjQLMURzACOs72BiRVKs5paTuqJEi1kAMqUxvSRFP6/out-0-12.webp"
}
}' \
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": "2024-11-23T13:45:00.671939Z",
"created_at": "2024-11-23T13:43:38.560000Z",
"data_removed": false,
"error": null,
"id": "bkzhhgc981rj60ckb51t9vmbcr",
"input": {
"image": "https://replicate.delivery/pbxt/M1T9TkwjQLMURzACOs72BiRVKs5paTuqJEi1kAMqUxvSRFP6/out-0-12.webp"
},
"logs": null,
"metrics": {
"predict_time": 7.741180391,
"total_time": 82.111939
},
"output": "https://replicate.delivery/yhqm/XJz2ehHOrN3VHi0zY5UqMz6vvXYZDGTArmb2xO9T2JPuc85JA/mask_img.png",
"started_at": "2024-11-23T13:44:52.930759Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/qoxq-y6hdyr7s3gnzveqyfumqb2ij35cd2vpf4gsqwnqept5pigirifhq",
"get": "https://api.replicate.com/v1/predictions/bkzhhgc981rj60ckb51t9vmbcr",
"cancel": "https://api.replicate.com/v1/predictions/bkzhhgc981rj60ckb51t9vmbcr/cancel"
},
"version": "26e6052742b519144681a9070f7cb4964ad19051bf40056c7a254d4869ade10f"
}