Skip to content

Krea 2 Medium

Text-to-Image • krea

View as MarkdownAgent setup

Model ID

Use with the Workers AI binding, the AI Gateway REST API, or the Unified API.

Calling the provider directly? Use the provider's model name instead, including with provider-native endpoints or the provider's own SDK. For example, Anthropic's name for anthropic/claude-opus-4.8 is claude-opus-4-8.

  • Third-party

Smaller, faster, more cost-efficient. Extensive post-training makes outputs especially stable and consistent across generations. Strongest on illustration, anime, painting, and other expressive or artistic styles.

Model Info
Terms and Licenselink ↗
More informationlink ↗
Pricing
  • Per image$0.03

Usage

const response = await env.AI.run(
  'krea/krea-2-medium',
  {
    prompt: "An igloo village glowing with Aurora's colors.",
    aspect_ratio: '1:1',
    resolution: '1K',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "krea/krea-2-medium",
  "input": {
    "prompt": "An igloo village glowing with Aurora'\''s colors.",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }
}'
Default
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/krea/krea-2-medium/default.png"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

Parameters

prompt
stringrequiredText prompt describing the image to generate.
aspect_ratio
stringrequiredenum: 1:1, 4:3, 3:2, 16:9, 2.35:1, 4:5, 2:3, 9:16Aspect ratio of the generated image.
resolution
stringrequiredenum: 1KResolution scale.
seed
numberRandom seed for reproducible generations. Pass null or omit for a random seed.
creativity
stringdefault: lowenum: raw, low, medium, highPrompt expansion mode. `raw` disables expansion; `low`, `medium`, `high` control strength. Does not affect the K2 Intensity, Complexity, or Movement slider LoRAs.
intensity
integerdefault: 0minimum: -100maximum: 100K2 Intensity slider (-100 to 100). 0 disables the slider LoRA.
complexity
integerdefault: 0minimum: -100maximum: 100K2 Complexity slider (-100 to 100). 0 disables the slider LoRA.
movement
integerdefault: 0minimum: -100maximum: 100K2 Movement slider (-100 to 100). 0 disables the slider LoRA.
image
stringformat: uriPresigned URL for the generated image.

API Schemas (Raw)

Input
Output

Was this helpful?