typetext
{
"aspect_ratio": "4:3",
"creativity": "medium",
"moodboard_strength": 0.35,
"prompt": "The text \"Krea 2\" positioned in the dead center, in large helvetica font. An authentic, candid film portrait of a young woman, captured on high-ISO analog stock. Rich textures, fine film grain, and a subtle vintage color cast. A wide-open aperture creates a shallow depth of field, dissolving the background into creamy bokeh and pulling all focus to the expression in her eyes. There is a golden hour glow with glints of rainbow bokeh.",
"style_reference_images": [],
"style_reference_strength": 0.5
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_8AN**********************************
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 krea/krea-2-medium using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "4:3",
creativity: "medium",
moodboard_strength: 0.35,
prompt: "The text \"Krea 2\" positioned in the dead center, in large helvetica font. An authentic, candid film portrait of a young woman, captured on high-ISO analog stock. Rich textures, fine film grain, and a subtle vintage color cast. A wide-open aperture creates a shallow depth of field, dissolving the background into creamy bokeh and pulling all focus to the expression in her eyes. There is a golden hour glow with glints of rainbow bokeh.",
style_reference_images: [],
style_reference_strength: 0.5
};
const output = await replicate.run("krea/krea-2-medium", { input });
// 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_8AN**********************************
This is your API token. Keep it to yourself.
import replicate
Run krea/krea-2-medium using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"krea/krea-2-medium",
input={
"aspect_ratio": "4:3",
"creativity": "medium",
"moodboard_strength": 0.35,
"prompt": "The text \"Krea 2\" positioned in the dead center, in large helvetica font. An authentic, candid film portrait of a young woman, captured on high-ISO analog stock. Rich textures, fine film grain, and a subtle vintage color cast. A wide-open aperture creates a shallow depth of field, dissolving the background into creamy bokeh and pulling all focus to the expression in her eyes. There is a golden hour glow with glints of rainbow bokeh.",
"style_reference_images": [],
"style_reference_strength": 0.5
}
)
# 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_8AN**********************************
This is your API token. Keep it to yourself.
Run krea/krea-2-medium 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": "4:3",
"creativity": "medium",
"moodboard_strength": 0.35,
"prompt": "The text \\"Krea 2\\" positioned in the dead center, in large helvetica font. An authentic, candid film portrait of a young woman, captured on high-ISO analog stock. Rich textures, fine film grain, and a subtle vintage color cast. A wide-open aperture creates a shallow depth of field, dissolving the background into creamy bokeh and pulling all focus to the expression in her eyes. There is a golden hour glow with glints of rainbow bokeh.",
"style_reference_images": [],
"style_reference_strength": 0.5
}
}' \
https://api.replicate.com/v1/models/krea/krea-2-medium/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "8phbgtd8kxrmr0cydk1s4f644w",
"model": "krea/krea-2-medium",
"version": "hidden",
"input": {
"aspect_ratio": "4:3",
"creativity": "medium",
"moodboard_strength": 0.35,
"prompt": "The text \"Krea 2\" positioned in the dead center, in large helvetica font. An authentic, candid film portrait of a young woman, captured on high-ISO analog stock. Rich textures, fine film grain, and a subtle vintage color cast. A wide-open aperture creates a shallow depth of field, dissolving the background into creamy bokeh and pulling all focus to the expression in her eyes. There is a golden hour glow with glints of rainbow bokeh.",
"style_reference_images": [],
"style_reference_strength": 0.5
},
"logs": "Using seed: 860786844\nSubmitted Krea 2 medium job 482fc64a-fe2d-40a0-b4e8-b8e53ad7ba3f\nGenerated in 11.7s\nDownloading 1098838 bytes\nDownloaded 1.05MB in 0.34sec",
"output": "https://replicate.delivery/xezq/elMSHfl7EIrfdJ9bS2KLSGei5n5tUAKoCiCOu3v5PaMLXclaB/tmpf7r525i5.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2026-05-28T04:07:02.559Z",
"started_at": "2026-05-28T04:07:02.569229Z",
"completed_at": "2026-05-28T04:07:14.927965Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/8phbgtd8kxrmr0cydk1s4f644w/cancel",
"get": "https://api.replicate.com/v1/predictions/8phbgtd8kxrmr0cydk1s4f644w",
"stream": "https://stream.replicate.com/v1/files/jbxs-d5yuodqtuzmgngnt3xufdoptp4yurc7pw3rpqglsr7a7o5iphkoa",
"web": "https://replicate.com/p/8phbgtd8kxrmr0cydk1s4f644w"
},
"metrics": {
"image_output_count": 1,
"model_variant": "text_to_image",
"predict_time": 12.358736213,
"total_time": 12.368965663
}
}