typetext
{
"aspect_ratio": "4:3",
"creativity": "medium",
"moodboard_strength": 0.35,
"prompt": "The text \"Krea 2 Medium\" 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.",
"style_reference_images": [],
"style_reference_strength": 0.5
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_abq**********************************
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 Medium\" 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.",
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_abq**********************************
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 Medium\" 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.",
"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_abq**********************************
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 Medium\\" 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.",
"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": "gj3e5yerm9rmt0cydjwvgz60fc",
"model": "krea/krea-2-medium",
"version": "hidden",
"input": {
"aspect_ratio": "4:3",
"creativity": "medium",
"moodboard_strength": 0.35,
"prompt": "The text \"Krea 2 Medium\" 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.",
"style_reference_images": [],
"style_reference_strength": 0.5
},
"logs": "Using seed: 1862924799\nSubmitted Krea 2 medium job 7a266466-b283-4cff-b884-378cd3dc4242\nGenerated in 50.2s\nDownloading 1006763 bytes\nDownloaded 0.96MB in 0.05sec",
"output": "https://replicate.delivery/xezq/SLdpwMDrUI7LLdLDFABUte73RqJCzxBJdwYrLNcLx4FLeWpWA/tmp9e_8dzk5.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2026-05-28T03:56:19.49Z",
"started_at": "2026-05-28T03:56:19.5012Z",
"completed_at": "2026-05-28T03:57:10.148301Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/gj3e5yerm9rmt0cydjwvgz60fc/cancel",
"get": "https://api.replicate.com/v1/predictions/gj3e5yerm9rmt0cydjwvgz60fc",
"stream": "https://stream.replicate.com/v1/files/jbxs-hrjp7bvxurnlyc4dzkcqmsxh4p2diw7ufdboqrnabbtxjvzqd3sa",
"web": "https://replicate.com/p/gj3e5yerm9rmt0cydjwvgz60fc"
},
"metrics": {
"image_output_count": 1,
"model_variant": "text_to_image",
"predict_time": 50.647101003,
"total_time": 50.658301828
}
}