FLUX.1 Kontext [dev]

Overview

FLUX.1 Kontext [dev] is the community-accessible variant of Kontext — an open‑weight, lightweight 12 B diffusion transformer distilled directly from FLUX.1 Kontext [pro]. It preserves the high fidelity editing, regional prompt adherence, image semantics, and character consistency of the pro-grade model, while being significantly more efficient and customizable — ideal for adaptation, fine-tuning, and scientific exploration.

  • Pro-level editing fidelity: Maintains precision in local edits and scene-wide modifications without finetuning, offering the same editing quality as the [pro] model.

  • Character & semantic consistency: Ensures subjects and styles remain coherent across iterative edits, avoiding drift or semantic errors.

  • Open weights & adaptability: Released with fully open weights under a source-available license, enabling easy extension and research-driven experimentation.

  • Efficiency: The 12B parameter design is optimized for fast inference on research hardware, supporting interactive editing workflows while keeping computational needs low.

Find out more about FLUX.1 Kontext.

Getting Started

Before generating images, make sure your account is ready to use the Inference API. Follow the Getting Started guide to create an account and top up your balance.

Authorization

To access and use these API endpoints, authorization is required. Please visit our Authorization page for detailed instructions on obtaining and using a bearer token for secure API access.

Generating images

Parameters

prompt (string)

The text description to generate an image from. This is the core input that drives the output.


size (string)

The resolution of the output image in "width*height" format. Default: "1024*1024"


num_inference_steps (integer)

How many denoising steps to run during generation. More steps may improve quality, at the cost of speed. Default: 28


seed (integer)

A seed value for reproducibility. The same seed + prompt + model version = same image. Use -1 to randomize. Default: -1


guidance_scale (float)

CFG (Classifier-Free Guidance) controls how closely the image follows the prompt. Higher values = stronger prompt adherence, but may reduce creativity. Default: 3.5


num_images (integer)

How many images to generate per request. Default: 1


enable_safety_checker (boolean)

If enabled, content will be checked for safety violations. Default: true


output_format (string)

The file format of the generated image. Possible values: "jpeg", "png", "webp" Default: "jpeg"


output_quality (integer)

Applies to "jpeg" and "webp" formats. Defines compression quality. Range: 1–100 Default: 95


enable_base64_output (boolean)

If true, the API will return the image as a base64-encoded string in the response. Default: false


image (string, base64-encoded)

The input image for image-to-image generation. Must be provided as a base64-encoded string.

This image acts as the visual starting point for generation. The model will modify or transform this input based on your prompt

Text to image

curl --request POST "https://inference.datacrunch.io/flux-kontext-dev/predict" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <your_api_key>" \
--data '{
    "input": {
        "prompt": "a scientist racoon eating icecream in a datacenter",
        "enable_base64_output": true
    }
}'

Image to image

# Encode the image
INPUT_BASE64=$(base64 -i palm.jpg)

# Write JSON payload to a file
cat > payload.json <<EOF
{
  "input": {
    "prompt": "Add a tresure chest on the beach",
    "image": "${INPUT_BASE64}",
    "enable_base64_output": true
  }
}
EOF

# Send the request
curl --request POST "https://inference.datacrunch.io/flux-kontext-dev/predict" \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <your_api_key>" \
  --data @payload.json

Last updated

Was this helpful?