Skip to content
Docs menu

Image models

FLUX.2

On this page

FLUX.2 — fast, high-fidelity AI image generation & editing.

modelIdflux-2-pro-text-to-image, flux-2-pro-image-to-image, flux-2-flex-text-to-image, flux-2-flex-image-to-image
Modalityimage
PricingSee this model on the Pricing page for the current per-call price (with your markup).

Operations

OperationmodelIdEndpointRequired input
Pro Text To Imageflux-2-pro-text-to-imagePOST /api/v1/generateprompt, aspect_ratio, resolution
Pro Image To Imageflux-2-pro-image-to-imagePOST /api/v1/generateinput_urls, prompt, aspect_ratio, resolution
Flex Text To Imageflux-2-flex-text-to-imagePOST /api/v1/generateprompt, aspect_ratio, resolution
Flex Image To Imageflux-2-flex-image-to-imagePOST /api/v1/generateinput_urls, prompt, aspect_ratio, resolution
Poll taskGET /api/v1/task/{id}?model=flux-2-pro-text-to-image

Pro Text To Image — flux-2-pro-text-to-image

FieldTypeRequiredValues / example
promptstringYesMust be between 3 and 5000 characters. Max 5000 characters. (default: Hyperrealistic studio photo of a glass terrarium shaped like a vintage camera, a tiny forest growing inside, product lighting.)
aspect_ratiostringYesAspect ratio for the generated image. Select 'auto' to match the first input image ratio (requires input image). (options: 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3) (default: 1:1)
resolutionstringYesOutput image resolution. (options: 1K | 2K) (default: 1K)
nsfw_checkerbooleanNoA configurable parameter. Defaults to true in the Playground. (true/false) (default: true)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"flux-2-pro-text-to-image","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","aspect_ratio":"1:1","resolution":"1K","nsfw_checker":true}}'

Pro Image To Image — flux-2-pro-image-to-image

FieldTypeRequiredValues / example
input_urlsstring[]YesInput reference images (1-8 images). (image URL)
promptstringYesMust be between 3 and 5000 characters. Max 5000 characters. (default: Restyle this into a textured oil painting of a weathered fisherman mending his nets on the dock at dawn, thick impasto brushwork and a warm, salt-worn harbor palette.)
aspect_ratiostringYesAspect ratio for the generated image. Select 'auto' to match the first input image ratio (requires input image). (options: 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3 | auto) (default: 4:3)
resolutionstringYesOutput image resolution. (options: 1K | 2K) (default: 1K)
nsfw_checkerbooleanNoA configurable parameter. Defaults to true in the Playground. (true/false) (default: true)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"flux-2-pro-image-to-image","input":{"input_urls":["https://example.com/input.jpg"],"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","aspect_ratio":"4:3","resolution":"1K","nsfw_checker":true}}'

Flex Text To Image — flux-2-flex-text-to-image

FieldTypeRequiredValues / example
promptstringYesMust be between 3 and 5000 characters. Max 5000 characters. (default: A tower of pastel macarons stacked on a pale marble slab, soft window light raking across their crisp shells, scattered crumbs and one bitten macaron in the foreground, shallow depth of field, editorial food photography.)
aspect_ratiostringYesAspect ratio for the generated image. Select 'auto' to match the first input image ratio (requires input image). (options: 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3) (default: 1:1)
resolutionstringYesOutput image resolution. (options: 1K | 2K) (default: 1K)
nsfw_checkerbooleanNoA configurable parameter. Defaults to true in the Playground. (true/false) (default: true)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"flux-2-flex-text-to-image","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","aspect_ratio":"1:1","resolution":"1K","nsfw_checker":true}}'

Flex Image To Image — flux-2-flex-image-to-image

FieldTypeRequiredValues / example
input_urlsstring[]YesInput reference images (1-8 images). (image URL)
promptstringYesMust be between 3 and 5000 characters. Max 5000 characters. (default: Transform this into stained glass — recast the subject in glowing colored panes with dark lead-line outlines, sunlight streaming through and scattering rainbow shards across a pale marble floor.)
aspect_ratiostringYesAspect ratio for the generated image. Select 'auto' to match the first input image ratio (requires input image). (options: 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3 | auto) (default: 1:1)
resolutionstringYesOutput image resolution. (options: 1K | 2K) (default: 1K)
nsfw_checkerbooleanNoA configurable parameter. Defaults to true in the Playground. (true/false) (default: true)
bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"flux-2-flex-image-to-image","input":{"input_urls":["https://example.com/input.jpg"],"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","aspect_ratio":"1:1","resolution":"1K","nsfw_checker":true}}'