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)
List of Kontext parameters for image editing via the /flux-kontext-pro
endpoint:
Parameter | Description | Default | Range |
---|---|---|---|
prompt | Text description of what you want to generate | Required | |
input_image | Base64 encoded image to use as reference | Required | |
seed | Optional seed for reproducibility | None | Any integer |
safety_tolerance | Moderation level (0=strict, 6=permissive) | 2 | 0-6 |
output_format | Format of the output image | ”jpeg" | "jpeg”, “png” |
webhook_url | URL for asynchronous completion notification | None | Valid URL |
webhook_secret | Secret for webhook signature verification | None | String |