llms.txt

Krea 2 Medium

Generate high-quality images from text with Krea 2 Medium, supporting aspect ratio, creativity controls, seeds, and optional style references.

Overview

Pricing

For every image you generate, you will be charged $0.030 (text-to-image) or $0.035 (using image_style_references).

For more details, see fal.ai pricing.

API Information

This model can be used via our HTTP API or more conveniently via our client libraries. See the input and output schema below, as well as the usage examples.

Input Schema

The API accepts the following input parameters:

Required Parameters Example:

{
  "prompt": "A Van Gogh-tinged Provençal farmhouse under starry nights."
}

Full Example:

{
  "prompt": "A Van Gogh-tinged Provençal farmhouse under starry nights.",
  "aspect_ratio": "1:1",
  "creativity": "medium",
  "image_style_references": [],
  "styles": [],
  "moodboards": []
}

Output Schema

The API returns the following output format:

Example Response:

{
  "images": [
    {
      "url": "https://v3.fal.media/files/panda/krea_v2_example.png"
    }
  ],
  "seed": 12345
}

Usage Examples

cURL

curl --request POST \
  --url https://fal.run/krea/v2/medium/text-to-image \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "A Van Gogh-tinged Provençal farmhouse under starry nights."
   }'

Python

Ensure you have the Python client installed:

pip install fal-client

Then use the API client to make requests:

import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "krea/v2/medium/text-to-image",
    arguments={
        "prompt": "A Van Gogh-tinged Provençal farmhouse under starry nights."
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)

JavaScript

Ensure you have the JavaScript client installed:

npm install --save @fal-ai/client

Then use the API client to make requests:

import { fal } from "@fal-ai/client";

const result = await fal.subscribe("krea/v2/medium/text-to-image", {
  input: {
    prompt: "A Van Gogh-tinged Provençal farmhouse under starry nights."
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);