---
title: "Generate or edit an image with FLUX.2 [flex]"
method: POST
path: "/v1/flux-2-flex"
tags: ["Models"]
---

# Generate or edit an image with FLUX.2 [flex]

`POST /v1/flux-2-flex`

Submits an image generation or editing task with FLUX.2 [flex]. Specialized for typography and text rendering, and for preserving small details. Supports text-to-image and image-to-image editing workflows.

## Request body

- Flux2FlexInputs
  - `prompt` string, required — Text prompt for image generation.
  - `prompt_upsampling` boolean, nullable — Whether to use prompt upsampling.
  - `input_image` string, nullable — Path to the input image.
  - `input_image_2` string, nullable — Path to the second input image.
  - `input_image_3` string, nullable — Path to the third input image.
  - `input_image_4` string, nullable — Path to the fourth input image.
  - `input_image_5` string, nullable — Path to the fifth input image.
  - `input_image_6` string, nullable — Path to the sixth input image.
  - `input_image_7` string, nullable — Path to the seventh input image.
  - `input_image_8` string, nullable — Path to the eighth input image.
  - `input_image_blob_path` string, nullable — Blob path to the input image.
  - `seed` integer, nullable — Optional seed for reproducibility.
  - `width` integer, nullable — Width of the image
  - `height` integer, nullable — Height of the image
  - `guidance` number, nullable — Guidance scale for image generation. High guidance scales improve prompt adherence at the cost of reduced realism.
  - `steps` integer, nullable — Number of steps for image generation. Higher steps lead to more detailed and realistic images.
  - `safety_tolerance` integer — Tolerance level for input and output moderation. Between 0 and 5, 0 being most strict, 5 being least strict. If you wish to increase the safety_tolerance beyond these levels please reach out to the team.
  - `output_format` 'jpeg' | 'png' | 'webp'
  - `webhook_url` string, uri, nullable — URL to receive webhook notifications
  - `webhook_secret` string, nullable — Optional secret for webhook signature verification

## Response `200`

Successful Response

- union
  - AsyncResponse
    - `id` string, required
    - `polling_url` string, required
    - `cost` number, nullable — Cost in credits for this request
    - `input_mp` number, nullable — Input megapixels (2 decimal places)
    - `output_mp` number, nullable — Output megapixels (2 decimal places)
  - AsyncWebhookResponse
    - `id` string, required
    - `status` string, required
    - `webhook_url` string, required
    - `cost` number, nullable — Cost in credits for this request
    - `input_mp` number, nullable — Input megapixels (2 decimal places)
    - `output_mp` number, nullable — Output megapixels (2 decimal places)

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/bfl/apis/bfl-api.md) · [All operations](https://skmtc.net/bfl/apis/bfl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bfl/bfl-api/versions/a0209bab18e1/schema)
