Skip to main content
FLUX.1 Kontext [pro] is a context-aware image generation model from Black Forest Labs, available through Anyfast. It can generate new images from text prompts, or edit existing images based on text instructions. Both endpoints are synchronous — they return the generated image directly as base64-encoded data.
  • Text-to-image — POST JSON to /v1/images/generations
  • Image editing — POST multipart form data to /v1/images/edits

Key capabilities

  • Image editing — Modify existing images with text instructions (e.g. “change the red car to blue”)
  • Text-to-image — Generate images from text prompts
  • Context-aware — Understands and preserves context from the reference image
  • Reproducible — Use seed for deterministic generation

Quick example

Text-to-image

curl https://www.anyfast.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-1-kontext-pro",
    "prompt": "A cute baby polar bear",
    "size": "1024x1024"
  }'

Image editing

curl https://www.anyfast.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=flux-1-kontext-pro" \
  -F "image=@/path/to/photo.jpg" \
  -F "prompt=Change the background to a sunset beach" \
  -F "size=1024x1024"

Text-to-image parameters

ParameterTypeRequiredDescription
modelstringYesMust be flux-1-kontext-pro
promptstringYesImage description. ⚠️ Prompt must be in English
nintegerNoNumber of images. Only 1 is supported
sizestringNoOutput size, e.g. 1024x1024
output_formatstringNojpeg or png
seedintegerNoRandom seed for reproducibility

Image editing parameters

ParameterTypeRequiredDescription
modelstringYesMust be flux-1-kontext-pro
imagefileYesImage file to edit (multipart upload)
promptstringYesEditing instructions. ⚠️ Prompt must be in English
nintegerNoNumber of images. Only 1 is supported
sizestringNoOutput size, e.g. 1024x1024

Response

FieldDescription
data[].b64_jsonBase64-encoded image data
createdUnix timestamp

API Reference

View the interactive API playground for FLUX.1 Kontext [pro].