typetext
{
"img_path": "https://replicate.delivery/yhqm/mPQwGLxvhSqeKiFkHC6bNLiGpdwCg6sRLBa1AXoEMjPdEMEKA/upsampled_image.png",
"input_shoreline": "[[52,135], [95,103], [111,54], [109,35], [82,24], [70,19], [82,11], [101,17], [129,45], [159,107], [148,143], [111,153], [73,153], [60,145]]"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_bih**********************************
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 wzesk/littoral_draw_refine using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"wzesk/littoral_draw_refine:46b194b18f33a7aa49cbf3116ad408cd40ef416d95345f060620ba37bc3c387f",
{
input: {
img_path: "https://replicate.delivery/yhqm/mPQwGLxvhSqeKiFkHC6bNLiGpdwCg6sRLBa1AXoEMjPdEMEKA/upsampled_image.png",
input_shoreline: "[[52,135], [95,103], [111,54], [109,35], [82,24], [70,19], [82,11], [101,17], [129,45], [159,107], [148,143], [111,153], [73,153], [60,145]]"
}
}
);
// 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_bih**********************************
This is your API token. Keep it to yourself.
import replicate
Run wzesk/littoral_draw_refine using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"wzesk/littoral_draw_refine:46b194b18f33a7aa49cbf3116ad408cd40ef416d95345f060620ba37bc3c387f",
input={
"img_path": "https://replicate.delivery/yhqm/mPQwGLxvhSqeKiFkHC6bNLiGpdwCg6sRLBa1AXoEMjPdEMEKA/upsampled_image.png",
"input_shoreline": "[[52,135], [95,103], [111,54], [109,35], [82,24], [70,19], [82,11], [101,17], [129,45], [159,107], [148,143], [111,153], [73,153], [60,145]]"
}
)
# 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_bih**********************************
This is your API token. Keep it to yourself.
Run wzesk/littoral_draw_refine 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": "wzesk/littoral_draw_refine:46b194b18f33a7aa49cbf3116ad408cd40ef416d95345f060620ba37bc3c387f",
"input": {
"img_path": "https://replicate.delivery/yhqm/mPQwGLxvhSqeKiFkHC6bNLiGpdwCg6sRLBa1AXoEMjPdEMEKA/upsampled_image.png",
"input_shoreline": "[[52,135], [95,103], [111,54], [109,35], [82,24], [70,19], [82,11], [101,17], [129,45], [159,107], [148,143], [111,153], [73,153], [60,145]]"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "zwssqt99qnrg80cmkrkb5nemw0",
"model": "wzesk/littoral_draw_refine",
"version": "46b194b18f33a7aa49cbf3116ad408cd40ef416d95345f060620ba37bc3c387f",
"input": {
"img_path": "https://replicate.delivery/yhqm/mPQwGLxvhSqeKiFkHC6bNLiGpdwCg6sRLBa1AXoEMjPdEMEKA/upsampled_image.png",
"input_shoreline": "[[52,135], [95,103], [111,54], [109,35], [82,24], [70,19], [82,11], [101,17], [129,45], [159,107], [148,143], [111,153], [73,153], [60,145]]"
},
"logs": "float division by zero",
"output": "https://replicate.delivery/czjl/9jLOzrUMHvLFIZpRiHn9IgbFtxK7EeM7OJjsV06e7BifNXRoA/refined_shoreline.csv",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-01-25T15:48:08.765Z",
"started_at": "2025-01-25T15:48:15.785616Z",
"completed_at": "2025-01-25T15:48:15.976392Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/zwssqt99qnrg80cmkrkb5nemw0/cancel",
"get": "https://api.replicate.com/v1/predictions/zwssqt99qnrg80cmkrkb5nemw0",
"stream": "https://stream.replicate.com/v1/files/fddq-74n5bnv3mcfn573fvrpoq44fr2ubryrwpru2ejgyy7okhb3zomtq",
"web": "https://replicate.com/p/zwssqt99qnrg80cmkrkb5nemw0"
},
"metrics": {
"predict_time": 0.190775754,
"total_time": 7.211392
}
}