Skip to main content

Model Overview

Flux image editing and text-to-image generation share the same /v1/images/generations endpoint. Without input_image, the request is text-to-image. With input_image, it becomes image editing. With input_image_2 through input_image_8, it becomes multi-image fusion editing.
Key structureFlux 2 image editing uses application/json. Reference images are string fields: input_image, input_image_2, input_image_3input_image_8. Values can be public image URLs or data:image/png;base64,... data URLs.

Models and Pricing

Actual model availability and pricing are shown in the console.

Quick Start

Single-Image Edit cURL

Multi-Image Edit cURL

Local Multi-Image Edit cURL

Do not upload local files with -F "image=@...". Convert local images to data URLs first, then place them in input_image, input_image_2, and input_image_3.
The returned image URL expires quickly, so download it immediately:
Do not use /v1/images/edits or multipart -F "image=@..." for Flux 2 multi-image editing. Flux 2 multi-image editing uses /v1/images/generations with JSON input_image fields.

Python Examples

URL Inputs

Local File Inputs

Convert local images to data URLs before placing them in input_image fields.

Parameters

Prompt Tips

  • Refer to sources explicitly as image 1, image 2, and image 3
  • Name the key elements that must be preserved
  • State that the output should be one coherent new image
  • Say what to avoid, such as collage, split-screen, borders, or labels

Important Notes

  1. Endpoint: Flux text-to-image, single-image editing, and multi-image editing all use /v1/images/generations
  2. Request format: Use JSON, not multipart form data
  3. Multi-image limit: Flux 2 Pro / Max / Flex support up to 8 reference images
  4. Image source: Public URLs are recommended; local files can be converted to data URLs
  5. Result URL: data[0].url is valid for about 10 minutes, so download immediately