Skip to main content

Flux

Flux is a high-quality image generation model developed by Black Forest Labs, supporting multiple variants.

Via OpenAI Format

POST /v1/images/generations
Call Flux models using the OpenAI-compatible format.

Supported Models

ModelDescription
flux-1.1-proFlux 1.1 Pro, high-quality generation
flux-1.1-pro-ultraFlux 1.1 Pro Ultra, ultra-high quality
flux-devFlux Dev, development version
flux-schnellFlux Schnell, fast generation
flux-kontext-proFlux Kontext Pro, context-aware
flux-kontext-devFlux Kontext Dev

Request Examples

curl -X POST https://crazyrouter.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "flux-1.1-pro",
    "prompt": "A photorealistic portrait of a woman with flowing red hair in golden hour lighting",
    "n": 1,
    "size": "1024x1024"
  }'

Resolution Options

SizeAspect Ratio
1024x10241:1
1024x7684:3
768x10243:4
1024x57616:9
576x10249:16
1536x10243:2
1024x15362:3

Response Example

{
  "created": 1709123456,
  "data": [
    {
      "url": "https://crazyrouter.com/files/flux_abc123.png"
    }
  ]
}

Via Replicate Format

POST /replicate/v1/models/black-forest-labs/flux-kontext-dev/predictions
Call Flux Kontext models using the Replicate native format, with support for more advanced parameters.

Request Example

cURL
curl -X POST https://crazyrouter.com/replicate/v1/models/black-forest-labs/flux-kontext-dev/predictions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Prefer: wait" \
  -d '{
    "input": {
      "prompt": "Change the background to a tropical beach",
      "image": "https://example.com/photo.jpg",
      "aspect_ratio": "16:9",
      "safety_tolerance": 2,
      "output_format": "webp"
    }
  }'

Response Example

{
  "id": "prediction_abc123",
  "status": "succeeded",
  "output": [
    "https://replicate.delivery/pbxt/.../output.webp"
  ]
}
Flux models excel at photorealistic styles and portrait generation. The Flux Kontext series supports reference image-based editing and style transfer.