Skip to main content
POST
Generate image from text and reference images (Flux Kontext Model)
Text to image endpoint result

Request

Make a POST request to below endpoint and pass the required parameters as a request body.
curl

Body

json

Body

application/json
key
string
required

Your API Key used for request authorization.

model_id
string
default:flux-kontext-dev
required

The ID of the model. Must be 'flux-kontext-dev' for Flux Kontext model.

prompt
string
required

A text description of the things you want in the generated image, referencing elements from the input images.

init_image
string<uri>
required

URL of the primary reference image to use as a base for the generation.

negative_prompt
string

Items you don't want in the image. Helps exclude unwanted elements, artifacts, or styles from the generation.

init_image_2
string<uri>

URL of the secondary reference image to incorporate elements from. Optional for single-image workflows.

safety_checker
boolean

Whether to run the safety checker

num_inference_steps
default:28

The number of denoising steps. Values typically range from 1 to 50. Can be provided as integer or string.

Required range: 1 <= x <= 50
strength
default:0.5

Controls how much the output image should resemble the input image. 0.0 means identical to input, 1.0 means completely different. Can be provided as number or string.

Required range: 0 <= x <= 1
guidance
default:2.5

Scale for classifier-free guidance. Higher values make the model follow the prompt more closely. Can be provided as number or string.

Required range: 0 <= x <= 20
enhance_prompt
boolean | null

Enhance prompts for better results. Set to null to use model defaults.

width
integer
default:512

The width of the output image in pixels. Maximum value is 1024.

Required range: x <= 1024
height
integer
default:512

The height of the output image in pixels. Maximum value is 1024.

Required range: x <= 1024
samples
integer
default:1

The number of images to be returned in response. Maximum value is 4.

Required range: x <= 4
seed
integer | null

Used to reproduce results. The same seed will generate the same image again. Pass null for a random number.

base64
boolean
default:false

Get response as a base64 string.

webhook
string<uri>

URL to receive a POST API call once image generation is complete.

track_id
string

This ID is returned in the response to the webhook API call and is used to identify the webhook request.

temp
boolean
default:false

Create a temporary image link valid for 24 hours.

Response

Flux Kontext Image to Image generation response

status
enum<string>

Status of the image generation.

Available options:
success
generationTime
number

Time taken to generate the image in seconds.

id
integer

Unique identifier for the image generation request.

output
string<uri>[]

Array of generated image URLs.

Array of proxy image URLs.

meta
object

Metadata about the image generation including all parameters used.

nsfw_content_detected
boolean

Indicates if NSFW content was detected in the generated image.