Image Editing
FLUX.1 Kontext [pro] is a model designed for Text-to-Image generation and advanced Image Editing. This guide focuses on its Image Editing capabilities. Unlike other models, you don’t need to fine-tune or create complex workflows to achieve this - Flux.1 Kontext [pro] handles it out of the box.
Kontext’s image editing, accessed via the /flux-kontext-pro
endpoint, provides the following key functionalities:
- Simple Editing: Change specific parts of an image while keeping the rest untouched
- Smart Changes: Make edits that look natural and fit with the rest of the image
- Text in Images: Add or modify text within your images
For comprehensive prompting techniques and advanced editing strategies, see our detailed Prompting Guide - Image-to-Image.
Examples of Editing
Basic Object Modifications
FLUX.1 Kontext is really good at straightforward object modification, for example if we want to change the colour of an object, we can prompt it.
For example: Change the car color to red
Before editing
After editing
Iterative Editing
FLUX.1 Kontex excels at character consistency, even after multiple edits. Starting from a reference picture, we can see that the character is consistent throughout the sequence.
First edit
Second edit
Third edit
Fourth edit
Text Editing
FLUX.1 Kontext can directly edit text that appears in images, making it easy to update signs, posters, labels, and more without recreating the entire image.
The most effective way to edit text is using quotation marks around the specific text you want to change:
Prompt Structure: Replace '[original text]' with '[new text]'
Example - We can see below where we have an input image with “Choose joy” written, and we replace “joy” with “BFL” - note the upper case format for BFL.
Input image
JOY replaced with BFL
Input image
Sync & Bloom changed to 'FLUX & JOY'
Using FLUX.1 Kontext API for Image Editing
This requires both a text prompt and an input image to work, with the input image serving as the base that will be edited according to your prompt.
To use Kontext for image editing, you’ll make a request to the /flux-kontext-pro
endpoint:
Create Request
A successful response will be a json object containing the request’s id, that will be used to retrieve the actual result.
Poll for Result
After submitting a request, you need to poll the /v1/get_result
endpoint using the request_id
to check the status and retrieve the output when ready.
A successful response will be a json object containing the result, and result['sample']
is a signed URL for retrieval.
Our signed URLs are only valid for 10 minutes. Please retrieve your result within this timeframe.
FLUX.1 Kontext Image Editing Parameters (for /flux-kontext-pro)
FLUX.1 Kontext creates 1024x1024 images by default. Use aspect_ratio
to adjust the dimensions while keeping the same total pixels.
- Supported Range: Aspect ratios can range from 3:7 (portrait) to 7:3 (landscape).
- Default Behavior: If
aspect_ratio
is not specified, the model will default to a standard aspect ratio like 1:1 (e.g. 1024x1024).
List of Kontext parameters for image editing via the /flux-kontext-pro
endpoint:
Parameter | Type | Default | Description | Required |
---|---|---|---|---|
prompt | string | Text description of the edit to be applied. | Yes | |
input_image | string | Base64 encoded image to use as reference. | Yes | |
aspect_ratio | string / null | "1:1" | Desired aspect ratio (e.g., “16:9”). All outputs are ~1MP total. Supports ratios from 3:7 to 7:3. | No |
seed | integer / null | null | Seed for reproducibility. If null or omitted, a random seed is used. Accepts any integer. | No |
prompt_upsampling | boolean | false | If true, performs upsampling on the prompt | No |
safety_tolerance | integer | 2 | Moderation level for inputs and outputs. Value ranges from 0 (most strict) to 2 (balanced) | No |
output_format | string | "jpeg" | Desired format of the output image. Can be “jpeg” or “png”. | No |
webhook_url | string / null | null | URL for asynchronous completion notification. Must be a valid HTTP/HTTPS URL. | No |
webhook_secret | string / null | null | Secret for webhook signature verification, sent in the X-Webhook-Secret header. | No |