# FLUX Kontext > FLUX.1 Kontext [pro] handles both text and reference images as inputs, seamlessly enabling targeted, local edits and complex transformations of entire scenes. ## Overview - **Endpoint**: `https://api.runflow.io/v1/run/black-forest-labs/flux-pro/kontext` - **Model ID**: `black-forest-labs/flux-pro/kontext` - **Provider**: Black Forest Labs - **License**: commercial - **Last Updated**: 2026-04-06 ## Pricing - **Base price**: $0.04/image - **Note**: ~25 runs per $1 ## Input Schema ### `prompt` (string, required) Editing instruction describing the desired transformation. ### `image_url` (image, required) URL of the source image to edit. ### `aspect_ratio` (string, optional) Output aspect ratio. Options: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9. - **Options**: `square_hd`, `square`, `portrait_4_3`, `portrait_16_9`, `landscape_4_3`, `landscape_16_9` ### `num_images` (integer, optional) Number of images to generate per request. Range: 1–4. Default: 1. - **Default**: `1` - **Min**: 1 - **Max**: 4 ### `guidance_scale` (number, optional) How closely the model follows the prompt. Range: 1–20. Default: 3.5. - **Default**: `3` - **Min**: 1 - **Max**: 20 ### `output_format` (string, optional) Output format. Options: "jpeg", "png". Default: "jpeg". - **Default**: `jpeg` - **Options**: `jpeg`, `png` ### `safety_tolerance` (string, optional) Content moderation strictness. 1 = most strict, 6 = most permissive. Default: 2. - **Default**: `2` ### `enhance_prompt` (boolean, optional) Automatically enhance the prompt for better results. Default: false. - **Default**: `false` ### `seed` (integer, optional) Random seed for reproducible outputs. ### `sync_mode` (boolean, optional) Return media as data URI without storing in request history. Default: false. - **Default**: `false` ## Usage Examples ### cURL ```bash curl -X POST https://api.runflow.io/v1/run/black-forest-labs/flux-pro/kontext \ -H "Authorization: Bearer $RUNFLOW_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A professional headshot, soft studio lighting", "image_url": "https://example.com/input.jpg", "output_format": "png" }' ``` ### Python ```python import requests response = requests.post( "https://api.runflow.io/v1/run/black-forest-labs/flux-pro/kontext", headers={"Authorization": "Bearer RUNFLOW_API_KEY"}, json={ "prompt": "A professional headshot, soft studio lighting", "image_url": "https://example.com/input.jpg", "output_format": "png", }, ) data = response.json() print(data["images"][0]["url"]) ``` ### JavaScript ```javascript const response = await fetch( "https://api.runflow.io/v1/run/black-forest-labs/flux-pro/kontext", { method: "POST", headers: { "Authorization": "Bearer RUNFLOW_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ prompt: "A professional headshot, soft studio lighting", image_url: "https://example.com/input.jpg", output_format: "png", }), } ); const data = await response.json(); console.log(data.images[0].url); ``` ## Additional Resources - [Playground](https://www.runflow.io/models/black-forest-labs/flux-pro/kontext) - [API Reference](https://www.runflow.io/models/black-forest-labs/flux-pro/kontext/api) - [Documentation](https://www.runflow.io/docs)