FLUX.1 Kontext [pro]
Overview
FLUX.1 Kontext [pro] offers state-of-the-art editing capabilities with extra speed and fidelity. It maintains strong prompt adherence while executing region-level edits and scene-wide changes, with excellent character consistency and image semantics across iterations. No fine-tuning like LoRAs required.
FLUX.1 Kontext [pro] is hosted outside of DataCrunch infrastructure.
Below please find examples on how to use DataCrunch Inference API to generate images with FLUX.1 Kontext [pro].
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
Text to image
curl --request POST "https://relay.datacrunch.io/bfl/flux-kontext-pro" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <your_api_key>" \
--output "picture.png" \
--data '{
"prompt": "a scientist racoon eating icecream in a datacenter",
"steps": 50,
"guidance": 3.0,
"prompt_upsampling":true
}'
Image to image
INPUT_BASE64="data:image/png;base64,$(base64 -i <your_picture>.png)"
read -r -d '' PAYLOAD <<EOF
{
"prompt": "Make the picture a pencil sketch",
"steps": 50,
"guidance": 2.0,
"input_image": "$INPUT_BASE64"
}
EOF
curl --request POST "https://relay.datacrunch.io/bfl/flux-kontext-pro" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <your_api_key>" \
--output "picture.png" \
--data "$PAYLOAD"
Last updated
Was this helpful?