Kontext
AI-generatedSummary
Generate or edit images using the Flux Kontext model by providing a textual prompt and optionally an input image URL for editing; submits a job to the Kie.ai API and can wait for its completion.
Inputs
- modelKontext — Select between 'Flux Kontext Max' or 'Flux Kontext Pro' models to use for generation.
- prompt (required) — Textual prompt describing the desired image content or edits.
- imageUrlKontext — URL of an input image to edit; if omitted, generates a new image from the prompt.
- outputFormat — Output image format, either JPEG or PNG.
- seedKontext — Numeric seed value for generation randomness; 0 means random seed.
- promptUpsampling — If enabled, enhances prompt detail potentially increasing processing time.
- ratio — Aspect ratio of the generated or edited image, e.g., 1:1 or 16:9.
- strength — Degree (0-1) to transform the input image when editing.
- replyUrl — Webhook URL to be called upon task completion.
- replyRef — Custom reference string returned with the webhook callback.
- waitForCompletion — Whether to wait for the task to finish before returning the result; if true, polls the task status until completion or timeout.
Output shape
A single JSON object containing the API response, typically including task details and the resulting image URLs upon completion.
If 'waitForCompletion' is true, the output contains the final task result after polling; otherwise, the immediate task creation response with a task ID is returned. Errors during execution are returned as objects with an 'error' message if 'Continue On Fail' is enabled.