typefile
{
"brightness_threshold": 0,
"dot_scale": 1,
"grid_size": 24,
"image": "https://replicate.delivery/pbxt/N4zRsaMPgp3JBBcSArOOPKrEkWUVEFvCY3rvJanziMTPYpgs/GraZnzHbAAMX8Nm.jpeg",
"output_width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_6FI**********************************
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 lucataco/vectorized-dot-grid using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/vectorized-dot-grid:a5b8700fc30c78475b838305ed9e8f1a582d96f31da6d4233443bb89a9bb1208",
{
input: {
brightness_threshold: 0,
dot_scale: 1,
grid_size: 24,
image: "https://replicate.delivery/pbxt/N4zRsaMPgp3JBBcSArOOPKrEkWUVEFvCY3rvJanziMTPYpgs/GraZnzHbAAMX8Nm.jpeg",
output_width: 1024
}
}
);
// 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_6FI**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/vectorized-dot-grid using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/vectorized-dot-grid:a5b8700fc30c78475b838305ed9e8f1a582d96f31da6d4233443bb89a9bb1208",
input={
"brightness_threshold": 0,
"dot_scale": 1,
"grid_size": 24,
"image": "https://replicate.delivery/pbxt/N4zRsaMPgp3JBBcSArOOPKrEkWUVEFvCY3rvJanziMTPYpgs/GraZnzHbAAMX8Nm.jpeg",
"output_width": 1024
}
)
# 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_6FI**********************************
This is your API token. Keep it to yourself.
Run lucataco/vectorized-dot-grid 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": "lucataco/vectorized-dot-grid:a5b8700fc30c78475b838305ed9e8f1a582d96f31da6d4233443bb89a9bb1208",
"input": {
"brightness_threshold": 0,
"dot_scale": 1,
"grid_size": 24,
"image": "https://replicate.delivery/pbxt/N4zRsaMPgp3JBBcSArOOPKrEkWUVEFvCY3rvJanziMTPYpgs/GraZnzHbAAMX8Nm.jpeg",
"output_width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "nwb1c8xtw9rm80cq1zest2153m",
"model": "lucataco/vectorized-dot-grid",
"version": "a5b8700fc30c78475b838305ed9e8f1a582d96f31da6d4233443bb89a9bb1208",
"input": {
"brightness_threshold": 0,
"dot_scale": 1,
"grid_size": 24,
"image": "https://replicate.delivery/pbxt/N4zRsaMPgp3JBBcSArOOPKrEkWUVEFvCY3rvJanziMTPYpgs/GraZnzHbAAMX8Nm.jpeg",
"output_width": 1024
},
"logs": "",
"output": "https://replicate.delivery/xezq/oe3wl7hf6aiJfpveF095ZcVkP1qpl50VtL3bEhLewbH0X0FmC/dot_grid_output.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-27T03:51:19.01Z",
"started_at": "2025-05-27T03:51:26.682964Z",
"completed_at": "2025-05-27T03:51:26.899111Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/nwb1c8xtw9rm80cq1zest2153m/cancel",
"get": "https://api.replicate.com/v1/predictions/nwb1c8xtw9rm80cq1zest2153m",
"stream": "https://stream.replicate.com/v1/files/bcwr-tyj65mf4rqmjiy3f7wjpmmikpcpxxxoh32obpenleewe6zig4b3q",
"web": "https://replicate.com/p/nwb1c8xtw9rm80cq1zest2153m"
},
"metrics": {
"predict_time": 0.216146716,
"total_time": 7.889111
}
}
