Skip to main content
Black Forest LabsMediumUltra

FLUX Kontext Pro

State-of-the-art text-based image editing model that transforms images through natural language. Excellent for style transfer, object modification, text replacement, background changes, and character consistency.

120 credits
per image
Text-driven image editing with high fidelity
Style transfer and transformation
Object and text replacement
Background editing
Character consistency across edits

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

llms.txt

Quick Start

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "black-forest-labs/flux-kontext-pro",
  "input": {
    "prompt": "Make this a 90s cartoon",
    "input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
    "aspect_ratio": "match_input_image",
    "output_format": "jpg",
    "safety_tolerance": 2
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Editing instruction or generation prompt
input_imagestringNo-URL of the source image to edit (jpeg, png, gif, or webp)
aspect_ratiostringNomatch_input_imageOutput aspect ratio. Use match_input_image to preserve the input ratio
match_input_image1:116:99:164:33:43:22:34:55:421:99:212:11:2
output_formatstringNopngOutput image format
jpgpng
safety_toleranceintegerNo2Safety tolerance: 0 strictest, 6 most permissive. Max 2 when input_image is provided
prompt_upsamplingbooleanNofalseAuto-improve prompt before generation
seedintegerNo-Random seed for reproducibility

How to Provide File Input

There are 3 ways to provide files for the input_image parameter:

Recommended

Direct Upload (Multipart)

Attach files directly to POST /v1/predictions/upload. No separate upload step needed.

curl -X POST "https://api.core.today/v1/predictions/upload" \
  -H "X-API-Key: cdt_your_api_key" \
  -F "model=black-forest-labs/flux-kontext-pro" \
  -F 'input={"prompt":"your prompt here"}' \
  -F "file:input_image=@your_file.png"

Image URL

Pass a publicly accessible URL directly. You can also use file_url from the Storage API.

{
  "model": "black-forest-labs/flux-kontext-pro",
  "input": {
    "prompt": "your prompt here",
    "input_image": "https://example.com/image.jpg"
  }
}
See the File Upload docs for more upload methods including Presigned URLs.

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

Style Transfer

Convert a photo into a 90s cartoon style

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "black-forest-labs/flux-kontext-pro",
  "input": {
    "prompt": "Make this a 90s cartoon",
    "input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
    "aspect_ratio": "match_input_image",
    "output_format": "jpg",
    "safety_tolerance": 2
  }
}'

Tips & Best Practices

1Provide input_image to use editing mode โ€” without one it generates from scratch
2Use match_input_image when you want to preserve the original aspect ratio
3Lower safety_tolerance values reject more outputs โ€” start at 2
4Use a fixed seed when iterating on a single edit

Use Cases

Photo retouching and stylization
Marketing creative variations
Product image background swaps
Character-consistent illustrations