Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Parameters for image generation
The text prompt to generate an image from
The model to use for generation
Number of images to generate
The size of the generated images
256x256
, 512x512
, 1024x1024
The format in which the generated images are returned
url
, b64_json
A unique identifier representing your end-user
Base64-encoded image data URL for img2img generation. Single image input for models that support image-to-image transformation. Format: data:image/[type];base64,[data]. Note: Direct URL input is not supported - images must be converted to base64 data URLs before submission.
"data:image/jpeg;base64,/9j/4AAQ..."
Array of base64-encoded image data URLs for models supporting multiple image inputs (e.g., flux-kontext, gpt-4o-image, gpt-image-1). Each URL must follow the format: data:image/[type];base64,[data]
[
"data:image/jpeg;base64,/9j/4AAQ...",
"data:image/png;base64,iVBORw0KGgo..."
]
Base64-encoded mask image data URL for inpainting models (e.g., flux-lora/inpainting). White areas indicate regions to edit. Format: data:image/[type];base64,[data]
"data:image/png;base64,iVBORw0KGgo..."
Controls how much the output differs from the input image in img2img mode. Lower values produce outputs closer to the input.
0 <= x <= 1
How closely the model follows the text prompt. Higher values result in images more closely aligned with the prompt.
0 <= x <= 20
Number of denoising steps. More steps generally produce higher quality but take longer.
1 <= x <= 100
Random seed for reproducible generation. Use the same seed with the same parameters to get identical results.
42
Enable enhanced context mode for flux-kontext model. Provides better understanding of input images.