typetext
{
"api_key": "sk_ba8d51db7829aef7ec445bb80dd59b7ff2c320d851eb6ae4cf41aacfab4df81c690774957983ebcc02f08429fccdfe42b4d8ee6a40b404399c10ca3bcabdbb72024KnIELzWIzzblw1gtM6",
"aspect_ratio": "16:9",
"output_format": "png",
"prompt": "Generate me an image of ocean",
"steps": 4
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_1xp**********************************
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 jigsawstack/image-generation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jigsawstack/image-generation:43d5bce2e1c97fa1e7d8996187a85cd5c882787989091af3b135c7a16ca23b79",
{
input: {
api_key: "sk_ba8d51db7829aef7ec445bb80dd59b7ff2c320d851eb6ae4cf41aacfab4df81c690774957983ebcc02f08429fccdfe42b4d8ee6a40b404399c10ca3bcabdbb72024KnIELzWIzzblw1gtM6",
aspect_ratio: "16:9",
output_format: "png",
prompt: "Generate me an image of ocean",
steps: 4
}
}
);
// 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_1xp**********************************
This is your API token. Keep it to yourself.
import replicate
Run jigsawstack/image-generation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jigsawstack/image-generation:43d5bce2e1c97fa1e7d8996187a85cd5c882787989091af3b135c7a16ca23b79",
input={
"api_key": "sk_ba8d51db7829aef7ec445bb80dd59b7ff2c320d851eb6ae4cf41aacfab4df81c690774957983ebcc02f08429fccdfe42b4d8ee6a40b404399c10ca3bcabdbb72024KnIELzWIzzblw1gtM6",
"aspect_ratio": "16:9",
"output_format": "png",
"prompt": "Generate me an image of ocean",
"steps": 4
}
)
# 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_1xp**********************************
This is your API token. Keep it to yourself.
Run jigsawstack/image-generation 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": "jigsawstack/image-generation:43d5bce2e1c97fa1e7d8996187a85cd5c882787989091af3b135c7a16ca23b79",
"input": {
"api_key": "sk_ba8d51db7829aef7ec445bb80dd59b7ff2c320d851eb6ae4cf41aacfab4df81c690774957983ebcc02f08429fccdfe42b4d8ee6a40b404399c10ca3bcabdbb72024KnIELzWIzzblw1gtM6",
"aspect_ratio": "16:9",
"output_format": "png",
"prompt": "Generate me an image of ocean",
"steps": 4
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "ht737qy26xrme0cqpb98sp1e60",
"model": "jigsawstack/image-generation",
"version": "43d5bce2e1c97fa1e7d8996187a85cd5c882787989091af3b135c7a16ca23b79",
"input": {
"api_key": "sk_ba8d51db7829aef7ec445bb80dd59b7ff2c320d851eb6ae4cf41aacfab4df81c690774957983ebcc02f08429fccdfe42b4d8ee6a40b404399c10ca3bcabdbb72024KnIELzWIzzblw1gtM6",
"aspect_ratio": "16:9",
"output_format": "png",
"prompt": "Generate me an image of ocean",
"steps": 4
},
"logs": "",
"output": "https://replicate.delivery/xezq/zqqhsjDgDYbRGFfd6zZDs2yVXop4yZ7F6jxH7p6t3WMkAldKA/output.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-06-27T19:17:26.199Z",
"started_at": "2025-06-27T19:17:26.206297Z",
"completed_at": "2025-06-27T19:17:28.020446Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/ht737qy26xrme0cqpb98sp1e60/cancel",
"get": "https://api.replicate.com/v1/predictions/ht737qy26xrme0cqpb98sp1e60",
"stream": "https://stream.replicate.com/v1/files/bcwr-iki7om732lqw4uhrzhqhwn5wixvdujj7jt5n32osfumqn4mi4cwq",
"web": "https://replicate.com/p/ht737qy26xrme0cqpb98sp1e60"
},
"metrics": {
"predict_time": 1.814149156,
"total_time": 1.821446
}
}