typetext
{
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 95,
"prompt": "a shaded pencil drawing of a pirate ship deck on a pure white background, no background. People can be seen loading cannon balls, adjusting sales, and manning the wheel",
"prompt_strength": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_bbe**********************************
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 black-forest-labs/flux-krea-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "1:1",
go_fast: true,
guidance: 3,
megapixels: "1",
num_inference_steps: 28,
num_outputs: 1,
output_format: "webp",
output_quality: 95,
prompt: "a shaded pencil drawing of a pirate ship deck on a pure white background, no background. People can be seen loading cannon balls, adjusting sales, and manning the wheel",
prompt_strength: 0.8
};
const output = await replicate.run("black-forest-labs/flux-krea-dev", { input });
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_bbe**********************************
This is your API token. Keep it to yourself.
import replicate
Run black-forest-labs/flux-krea-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-krea-dev",
input={
"aspect_ratio": "1:1",
"go_fast": True,
"guidance": 3,
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 95,
"prompt": "a shaded pencil drawing of a pirate ship deck on a pure white background, no background. People can be seen loading cannon balls, adjusting sales, and manning the wheel",
"prompt_strength": 0.8
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].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_bbe**********************************
This is your API token. Keep it to yourself.
Run black-forest-labs/flux-krea-dev 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 $'{
"input": {
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 95,
"prompt": "a shaded pencil drawing of a pirate ship deck on a pure white background, no background. People can be seen loading cannon balls, adjusting sales, and manning the wheel",
"prompt_strength": 0.8
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-krea-dev/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "rqnshtcwy1rme0csxbtrfftnf0",
"model": "black-forest-labs/flux-krea-dev",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 95,
"prompt": "a shaded pencil drawing of a pirate ship deck on a pure white background, no background. People can be seen loading cannon balls, adjusting sales, and manning the wheel",
"prompt_strength": 0.8
},
"logs": "Using seed: 450726\n 0%| | 0/28 [00:00<?, ?it/s]\n 54%|█████▎ | 15/28 [00:00<00:00, 19.26it/s]\n100%|██████████| 28/28 [00:01<00:00, 23.56it/s]\nGeneration took 1.40 seconds\nTotal safe images: 1 out of 1",
"output": [
"https://replicate.delivery/xezq/EQTQFxGX6wq3IhtshL6ZOUC4GbvgPgYG0tZU6mBf7TSTjwvKA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-10-16T02:59:49.104Z",
"started_at": "2025-10-16T02:59:49.121995Z",
"completed_at": "2025-10-16T02:59:50.680855Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/rqnshtcwy1rme0csxbtrfftnf0/cancel",
"get": "https://api.replicate.com/v1/predictions/rqnshtcwy1rme0csxbtrfftnf0",
"stream": "https://stream.replicate.com/v1/files/bcwr-ghetarbov5mpibq7lvhrllwu52reerwvgypi5x5ittpgo7px2zta",
"web": "https://replicate.com/p/rqnshtcwy1rme0csxbtrfftnf0"
},
"metrics": {
"predict_time": 1.558859747,
"total_time": 1.576855
}
}